Robot.plan_cartesian_motion
-
Robot.
plan_cartesian_motion
(frames_WCF, start_configuration=None, max_step=0.01, jump_threshold=1.57, avoid_collisions=True, group=None, path_constraints=None, attached_collision_meshes=None)[source] Calculates a cartesian motion path (linear in tool space).
- Parameters
frames_WCF (list of
compas.geometry.Frame
) – The frames through which the path is defined.start_configuration (
Configuration
, optional) – The robot’s full configuration, i.e. values for all configurable joints of the entire robot, at the starting position. Defaults to the all-zero configuration.max_step (float) – The approximate distance between the calculated points. (Defined in the robot’s units)
jump_threshold (float) – The maximum allowed distance of joint positions between consecutive points. If the distance is found to be above this threshold, the path computation fails. It must be specified in relation to max_step. If this theshhold is 0, ‘jumps’ might occur, resulting in an invalid cartesian path. Defaults to pi/2.
avoid_collisions (bool, optional) – Whether or not to avoid collisions. Defaults to True.
group (str, optional) – The planning group used for calculation. Defaults to the robot’s main planning group.
path_constraints (list of
compas_fab.robots.Constraint
, optional) – Optional constraints that can be imposed along the solution path. Note that path calculation won’t work if the start_configuration violates these constraints. Defaults to None.attached_collision_meshes (list of
compas_fab.robots.AttachedCollisionMesh
) – Defaults to None.
- Returns
compas_fab.robots.JointTrajectory
– The calculated trajectory.
Examples
>>> frames = [Frame([0.3, 0.1, 0.5], [1, 0, 0], [0, 1, 0]), Frame([0.4, 0.3, 0.4], [0, 1, 0], [0, 0, 1])] >>> start_configuration = Configuration.from_revolute_values([-0.042, 4.295, -4.110, -3.327, 4.755, 0.]) >>> group = robot.main_group_name >>> trajectory = robot.plan_cartesian_motion(frames, start_configuration, max_step=0.01, jump_threshold=1.57, avoid_collisions=True, group=group) >>> type(trajectory) <class 'compas_fab.robots.trajectory.JointTrajectory'>