...
Anchor robot_command.rpl.set_units robot_command.rpl.set_units robot_command.rpl.
set_units
(linear: Optional[Union[str, pint.util. SharedRegistryObject]] = None, angular: Optional[Union[str, pint.util., SharedRegistryObject]] = None, time: Optional[Union[str, SharedRegistryObject]] = None)Sets the active linear, angular and angular time units for the program.
Parameters: linear – Linear/length unit type: m, mm, inch
angular – Angular/rotation unit type: deg, rad
time – Time unit type: s, min, h
Examples
Code Block language python linenumbers false set_units("mm", "deg", "s") set_units(linear="in") set_units(angular="rad") set_units(time="s")
Anchor robot_command.rpl.get_units robot_command.rpl.get_units robot_command.rpl.
get_units
(with_time: bool = False) -> Union[Tuple[str, str], Tuple[str, str, str]]Returns the active linear, angular and angular time units from the program.
Parameters: time – return the time unit type when set to True
Returns: Linear/length unit type and , angular/rotation unit type .and time unit type
Examples
Code Block language python linenumbers false linear, angular = get_units()
Waypoints
...
linear, angular, time = get_units(with_time=True)
Waypoints
Waypoints are defined either as joint configuration, as list of joint positions, or as a robot pose with location in Cartesian coordinates XYZ and orientation in Euler angles ABC. Robot poses furthermore relate to an offset from the world origin, usually located at the robot base. If no offset is active or specified with the waypoint, reference to the world origin is assumed.
...
classAnchor robot_command.rpl.Joints robot_command.rpl.Joints robot_command.rpl.
Joints
(j1: float = 0.0, j2: float = 0.0, j3: float = 0.0, j4: float = 0.0, j5: float = 0.0, j6: float = 0.0)The Joints object consists of six joint position values to be used as target for move commands or to represent the current robot joint state.
Examples
Code Block language python linenumbers false waypoint_1 = Joint(323.62, 345.37, 477.76, 431.10, 918.62) waypoint_2 = Joint(j3=0.543) # all other joint positions are 0.0 by default
Anchor robot_command.rpl.Joints.copy robot_command.rpl.Joints.copy copy
() -> robot_command.rpl.JointsCreates a copy of the joints object.
Returns: Copy of the joints object.
staticAnchor robot_command.rpl.Joints.from_list robot_command.rpl.Joints.from_list from_list
(joint_list: List[float]) -> robot_command.rpl.JointsCreates a new joint object from a list of joint positions.
Parameters: joint_list – List of the six joint positions.
Returns: New joints object.
Anchor robot_command.rpl.Joints.from_ros_units robot_command.rpl.Joints.from_ros_units from_ros_units
(angular_unit: Optional[Union[str, pint.util. SharedRegistryObject]] = None)Converts the joints object from native ROS units to the target units, removing the unit type if any.
Parameters: angular_unit – Unit type for the angular joint positions.
Returns: The resulting joints object.
Anchor robot_command.rpl.Joints.to_list robot_command.rpl.Joints.to_list to_list
() -> List[float]Convert the joints object to a list of joint positions.
Returns: List of the six joint positions.
Anchor robot_command.rpl.Joints.to_ros_units robot_command.rpl.Joints.to_ros_units to_ros_units
(angular_unit: Optional[Union[str, pint.util. SharedRegistryObject]] = None) -> robot_command.rpl.JointsConverts the joints object to native ROS units, removing the unit type if any. This is useful if you want to send the resulting data to a ROS service.
Parameters: angular_unit – Unit type for the angular joint positions.
Returns: The resulting joints object.
Anchor robot_command.rpl.Joints.with_units robot_command.rpl.Joints.with_units with_units
(angular_unit: Optional[Union[str, pint.util. SharedRegistryObject]] = None) -> robot_command.rpl.JointsAdds a unit type to all positions of the joints object. The defaults are the native ROS units. In case a joint position already has units, the unit type is converted accordingly.
Parameters: angular_unit – Unit type for the angular joint positions.
Returns: The resulting joints object.
Anchor robot_command.rpl.Joints.without_units robot_command.rpl.Joints.without_units without_units
(angular_unit: Optional[Union[str, pint.util. SharedRegistryObject]] = None) -> robot_command.rpl.JointsRemoves units from the joint positions if any. If no unit type is specified ROS units are assumed.
Parameters: angular_unit – Unit type for the angular joint positions.
Returns: The resulting joints object.
...
Anchor robot_command.rpl.get_joint_values robot_command.rpl.get_joint_values robot_command.rpl.
get_joint_values
() -> robot_command.rpl.JointsReturns the current joint values.
Returns: Current joint values.
Examples
Code Block language python linenumbers false joint_value = get_joint_values()
...
classAnchor robot_command.rpl.Pose robot_command.rpl.Pose robot_command.rpl.
Pose
(x: Union[numbers.Number, pint.quantity.build_quantity_class.<locals>. Quantity] = 0.0, y: Union[numbers.Number, pint.quantity.build_quantity_class.<locals>. Quantity] = 0.0, z: Union[numbers.Number, pint.quantity.build_quantity_class.<locals>.Quantity] Quantity] = 0.0, a: Union[numbers.Number, pint.quantity.build_quantity_class.<locals>. Quantity] = 0.0, b: Union[numbers.Number, pint.quantity.build_quantity_class.<locals>. Quantity] = 0.0, c: Union[numbers.Number, pint.quantity.build_quantity_class.<locals>. Quantity] = 0.0, offsetframe: str = '')A robot pose consists of XYZ position ABC orientation parameters.
Optionally, an offset frame frame can be recorded with a waypoint.
Examples
Code Block language python linenumbers false waypoint_1 = Pose(483.21, 34.21, 21.59, 42.03, 71.14) waypoint_2 = Pose(a=0.543) # all other coordinate values are 0.0 per default.
Anchor robot_command.rpl.Pose.__mul__ robot_command.rpl.Pose.__mul__ __mul__
(other: robot_command.rpl.Pose) -> robot_command.rpl.PoseUse KDL frame multiplication to apply an offset a frame to a pose.
Parameters: other – Other pose.
Returns: New pose object.
Code Block language python linenumbers false new_wp = waypoint_1 * Pose(x=10) * waypoint_1 # translates waypoint_1 by x=10 old_wp = new_wp * Pose(x=10).inverse() * new_wp # translates new_wp back
Anchor robot_command.rpl.Pose.copy robot_command.rpl.Pose.copy copy
() -> robot_command.rpl.PoseCreates a copy of the pose object.
Returns: A copy of the pose.
staticAnchor robot_command.rpl.Pose.from_kdl_frame robot_command.rpl.Pose.from_kdl_frame from_kdl_frame
(frame: PyKDL.Frame) -> robot_command.rpl.PoseConverts a KDL frame to a pose object.
Parameters: frame – KDL frame.
Returns: New pose object.
staticAnchor robot_command.rpl.Pose.from_list robot_command.rpl.Pose.from_list from_list
(pose_list: List[float]) -> robot_command.rpl.PoseCreates a new pose object from a list of coordinates.
Parameters: pose_list – List of the six coordinates.
Returns: New pose object.
staticAnchor robot_command.rpl.Pose.from_ros_pose robot_command.rpl.Pose.from_ros_pose from_ros_pose
(pose: Union[geometry_msgs.msg._Pose.Pose, geometry_msgs.msg._PoseStamped. PoseStamped]) -> robot_command.rpl.PoseConverts a ROS native pose to a pose object.
Parameters: pose – The ROS stamped pose.
Returns: New pose object.
Anchor robot_command.rpl.Pose.from_ros_units robot_command.rpl.Pose.from_ros_units from_ros_units
(linear_unit: Optional[Union[str, pint.util. SharedRegistryObject]] = None, angular_unit: Optional[Union[str, pint.util. SharedRegistryObject]] = None)Converts the pose from native ROS units to the target units, removing the unit type.
Parameters: linear_unit – Unit type for linear coordinates.
angular_unit – Unit type for angular coordinates.
Returns: The resulting pose.
Anchor robot_command.rpl.Pose.inverse robot_command.rpl.Pose.inverse inverse
() -> robot_command.rpl.PoseCreates the inverse of the pose. Useful for calculating offsetframes.
Returns: New pose object.
Anchor robot_command.rpl.Pose.to_kdl_frame robot_command.rpl.Pose.to_kdl_frame to_kdl_frame
() -> PyKDL. FrameConverts the pose object to a KDL frame.
Returns: KDL frame.
Anchor robot_command.rpl.Pose.to_list robot_command.rpl.Pose.to_list to_list
() -> List[float]Convert the pose to a list of the coordinates. :return: List of the six coordinates.
Anchor robot_command.rpl.Pose.to_ros_pose robot_command.rpl.Pose.to_ros_pose to_ros_pose
() -> geometry_msgs.msg._Pose. PoseConverts the pose object to a native ROS pose.
Returns: ROS pose.
Anchor robot_command.rpl.Pose.to_ros_units robot_command.rpl.Pose.to_ros_units to_ros_units
(linear_unit: Optional[Union[str, pint.util. SharedRegistryObject]] = None, angular_unit: Optional[Union[str, pint.util. SharedRegistryObject]] = None) -> robot_command.rpl.PoseConverts the pose to native ROS units, removing the unit type if any. This is useful if you want to send the resulting data to a ROS service.
Parameters: linear_unit – Unit type for linear coordinates.
angular_unit – Unit type for angular coordinates.
Returns: The resulting pose.
Anchor robot_command.rpl.Pose.with_units robot_command.rpl.Pose.with_units with_units
(linear_unit: Optional[Union[str, pint.util. SharedRegistryObject]] = None, angular_unit: Optional[Union[str, pint.util. SharedRegistryObject]] = None) -> robot_command.rpl.PoseAdds a unit type to all coordinates of the pose. The defaults are the native ROS units. In case a coordinate already has units, the unit type is converted accordingly.
Parameters: linear_unit – Unit type for linear coordinates.
angular_unit – Unit type for angular coordinates.
Returns: The resulting pose.
Anchor robot_command.rpl.Pose.without_units robot_command.rpl.Pose.without_units without_units
(linear_unit: Optional[Union[str, pint.util. SharedRegistryObject]] = None, angular_unit: Optional[Union[str, pint.util. SharedRegistryObject]] = None) -> robot_command.rpl.PoseRemoves units from the coordinates if any. If no unit type is specified ROS units are assumed.
Parameters: linear_unit – Unit type for linear coordinates.
angular_unit – Unit type for angular coordinates.
Returns: The resulting pose.
classAnchor robot_command.rpl.PoseFactory robot_command.rpl.PoseFactory robot_command.rpl.
PoseFactory
The PoseFactory class helps constructing Pose object using a shorthand notation. In the robot program it can be accessed using the
p[]
shortcut.Examples
Code Block language python linenumbers false waypoint_1 = p[202.73, 750.08, 91.75, 6.63, 53.21, "table"] # captured with table workuser offsetframe
Anchor robot_command.rpl.get_pose robot_command.rpl.get_pose robot_command.rpl.
get_pose
(apply_workuser_offsetframe: bool = True, apply_tool_offsetframe: bool = True) -> robot_command.rpl.PoseReturns the current robot pose.
Parameters: apply_workuser_offsetframe – Applies the active work offset user frame to the world pose.
apply_tool_offsetframe – Applies the active tool offset frame to the world pose.
Returns: Current robot pose.
Examples
Code Block language python linenumbers false current_pose = get_pose()
...
Anchor robot_command.rpl.set_global_waypoint robot_command.rpl.set_global_waypoint robot_command.rpl.
set_global_waypoint
alias of
robot_command.rpl._create_doc_commands.<locals>.funct
Anchor robot_command.rpl.get_global_waypoint robot_command.rpl.get_global_waypoint robot_command.rpl.
get_global_waypoint
alias of
robot_command.rpl._create_doc_commands.<locals>.funct
Movement
The robot can be moved using the following move types:
...
Anchor robot_command.rpl.movej robot_command.rpl.movej robot_command.rpl.
movej
(target: Union[robot_command.rpl.Pose, robot_command.rpl.Joints], v: float = 1.0None, probe: int = 0, velocity_scale: float = 1.0) -> Optional[Tuple[int, rospy.rostime. Time, robot_command.rpl.Joints, robot_command.rpl.Pose]]Moves the robot end effector to the target waypoint with a joints move. Targets can be local waypoints or global waypoints defined as pose or joints.
Parameters: target – target waypoint or joints target
v velocity_scale – scale factor for velocity (default is full speed)
probe – specify the probe mode (2-6, or 0 for no probing) Probe mode 2: look for rising edge on probe signal (i.e. contact), raise ProbeFailedError if move completes without seeing a rising edge Probe mode 3: like mode 2 but does not raise error if move completes without rising edge Probe mode 4: like mode 2 but looks for falling edge Probe mode 5: like mode 4 but does not raise an error if move completes without falling edge Probe mode 6: “retract” mode, ignore falling edges and allow motion while probe signal is active, but raise ProbeUnexpectedContactError if a rising edge is seen
v –
scale factor for velocity (default is full speed)
Note Deprecated since version 3.1.1: use velocity_scale instead
Returns: tuple of probe results (for probing mode 2,3,4,5) or None: (probe contact type (0 = no contact, 1 = rising, 2 = falling), time of probe contact, Joint positions at probe contact, End-effector position / orientation pose at probe contact)
Examples
Code Block language python linenumbers false movej(waypoint_1) movej("global_waypoint_1", velocity_scale=0.6) movej(p[0, 100, 0, 90, 20, 0])
...
Anchor robot_command.rpl.movel robot_command.rpl.movel robot_command.rpl.
movel
(target: Union[robot_command.rpl.Pose, robot_command.rpl.Joints], a: float = 0.5None, v: float = 0.5None, probe: int = 0) -> , velocity: Optional[TupleUnion[int, rospy.rostime.Time, robot_command.rpl.Joints, robot_command.rpl.Pose]]- float, Quantity]] = None, accel: Optional[Union[float, Quantity]] = None, accel_scale: float = 0.5, duration: Optional[Union[float, Quantity]] = None, strict_limits: bool = False) -> Optional[Tuple[int, Time, Joints, Pose]]
Moves the robot end effector in a straight line from the current position to the target waypoint. Targets can be local waypoints or global waypoints defined as pose or joints.
Parameters: target – target target
v – move velocity scaling factor 0.0 - 1.0
a – move acceleration scaling factor 0.0 - 1.0
waypoint
probe – specify the probe mode (2-6, or 0 for no probing) Probe mode 2: look for rising edge on probe signal (i.e. contact), raise ProbeFailedError if move completes without seeing a rising edge Probe mode 3: like mode 2 but does not raise error if move completes without rising edge Probe mode 4: like mode 2 but looks for falling edge Probe mode 5: like mode 4 but does not raise an error if move completes without falling edge Probe mode 6: “retract” mode, ignore falling edges and allow motion while probe signal is active, but raise ProbeUnexpectedContactError if a rising edge is seen
Returns: tuple of probe results: (probe contact type (0 = no contact, 1 = rising, 2 = falling), time of probe contact, Joint positions at probe contact, End-effector position / orientation pose at probe contact)
Examples
Code Block language python linenumbers false movel(waypoint_1) movel("global_waypoint_1", a=0.4, v=0.2) movel(j[0.764, 1.64, 0.741, 0.433, 0.140, 2.74])
movec - Circular Move
Circular/Arc move command.
Parameters: interim – interim waypoint
target – target waypoint
v – move velocity scaling factor 0.0 - 1.0
a – move acceleration scaling factor 0.0 - 1.0velocity – move velocity as absolute value, interpreted in terms of currently set machine units if quantity without units is given.
accel – move acceleration as absolute value, interpreted in terms of currently set machine units if quantity without units is given.
accel_scale – move acceleration scaling factor 0.0 - 1.0
duration – target move duration in seconds. If move duration based on other inputs is longer, the planned duration will be used.
strict_limits – Enforces strict limits. Moves violating the velocity and acceleration limits will error.
v –
move velocity scaling factor 0.0 - 1.0
Note Deprecated since version 3.1.1: use velocity instead
a –
move acceleration scaling factor 0.0 - 1.0
Note Deprecated since version 3.1.1: use accel_scale instead
Returns: tuple of probe results: (probe contact type (0 = no contact, 1 = rising, 2 = falling), time of probe contact, Joint positions at probe contact, End-effector position / orientation pose at probe contact)
Examples
Code Block language python linenumbers false movel(waypoint_1) movel("global_waypoint_1", velocity=100) movel(j[0.764, 1.64, 0.741, 0.433, 0.140, 2.74])
robot_command.rpl.
movec
(interim: Union[robot_command.rpl.Pose, robot_command.rpl.Joints], target: Union[robot_command.rpl.Pose, robot_command.rpl.Joints], a: float = 0.5, v: float = 0.5, probe: int = 0) -> Optional[Tuple[int, rospy.rostime.Time, robot_command.rpl.Joints, robot_command.rpl.Pose]]movec - Circular Move
Anchor robot_command.rpl.movec robot_command.rpl.movec robot_command.rpl.
movec
(interim: Union[Pose, Joints], target: Union[Pose, Joints], a: float = None, v: float = None, probe: int = 0, velocity: Optional[Union[float, Quantity]] = None, accel: Optional[Union[float, Quantity]] = None, accel_scale: float = 0.5, duration: Optional[Union[float, Quantity]] = None, strict_limits: bool = False) -> Optional[Tuple[int, Time, Joints, Pose]]
...
Free move command.
Parameters: | target – target target |
...
Trajectory Execution
In same cases it is beneficial to execute a raw trajectory pre-planned in another program, for example Maya Mimic. The robot program supports loading, saving and executing such trajectories.
Loads a raw joint trajectory from a CSV file and returns them in ROS format.
Parameters: file_path – Path of the CSV file.
Returns: A ROS joint trajectory.
Circular/Arc move command.
Parameters: interim – interim waypoint
target – target waypoint
probe – specify the probe mode (2-6, or 0 for no probing) Probe mode 2: look for rising edge on probe signal (i.e. contact), raise ProbeFailedError if move completes without seeing a rising edge Probe mode 3: like mode 2 but does not raise error if move completes without rising edge Probe mode 4: like mode 2 but looks for falling edge Probe mode 5: like mode 4 but does not raise an error if move completes without falling edge Probe mode 6: “retract” mode, ignore falling edges and allow motion while probe signal is active, but raise ProbeUnexpectedContactError if a rising edge is seen
Returns: tuple of probe results (for probing mode 2,3,4,5) or None: (probe contact type (0 = no contact, 1 = rising, 2 = falling), time of probe contact, Joint positions at probe contact, End-effector position / orientation pose at probe contact)
robot_command.rpl.
load_trajectory
(file_path: str) -> trajectory_msgs.msg._JointTrajectory.JointTrajectory movef - Free-form Move
...
velocity – move velocity as absolute value, interpreted in terms of currently set machine units if quantity without units is given.
accel – move acceleration as absolute value, interpreted in terms of currently set machine units if quantity without units is given.
accel_scale – move acceleration scaling factor 0.0 - 1.0
duration – target move duration in seconds. If move duration based on other inputs is longer, the planned duration will be used.
strict_limits – Enforces strict limits. Moves violating the velocity and acceleration limits will error.
v –
move velocity scaling factor 0.0 - 1.0
Note Deprecated since version 3.1.1: use velocity instead
a –
move acceleration scaling factor 0.0 - 1.0
Note Deprecated since version 3.1.1: use accel_scale instead
Returns: tuple of probe results (for probing mode 2,3,4,5) or None: (probe contact type (0 = no contact, 1 = rising, 2 = falling), time of probe contact, Joint positions at probe contact, End-effector position / orientation pose at probe contact)
Examples
Code Block language python linenumbers false movec(waypoint_1, waypoint_2)
movef - Free-form Move
Anchor robot_command.rpl.save_trajectorymovef robot_command.rpl.save_trajectorymovef robot_command.rpl.
save_trajectory
(file_path: str, trajectory: trajectory_msgs.msg._JointTrajectory.JointTrajectorymovef
(target: Union[Pose, Joints]) -> NoneThe save trajectory command saves a joint trajectory to a CSV fileFree move command.
Parameters: trajectory – The joint trajectory to savefile_path – Path of the CSV file.
target – target target
...
Trajectory Execution
In same cases it is beneficial to execute a raw trajectory pre-planned in another program, for example Maya Mimic. The robot program supports loading, saving and executing such trajectories.
Anchor robot_command.rpl.executeload_trajectory robot_command.rpl.executeload_trajectory robot_command.rpl.
executeload_trajectory
(trajectory: trajectory_msgs.msg._JointTrajectory.JointTrajectory, v: float = 1.0, retime: bool = Falsefile_path: str) -> NoneThe execute trajectory command executes a ROS JointTrajectory. Before running the joint trajectory, the robot moves to the start joint position using a joint move command.
Parameters: trajectory – a ROS joint trajectory
v – move velocity scaling factor 0.0 - 1.0
retime – Enable retiming the trajectory to make use of the velocity scaling.
Examples
Code Block | ||||
---|---|---|---|---|
| ||||
trajectory = load_trajectory('test.csv')
execute_trajectory(trajectory)
save_trajectory('test2.csv', trajectory) |
Glossary of Move Errors
Move commands typically fails due to two major reasons, either during planning or during execution. You can catch those errors and retry a move inside the robot program.
...
Examples
Code Block | ||||
---|---|---|---|---|
| ||||
try:
movel(waypoint)
except MovePlanningError: # is raised in case of a planning error
notify("Move planning failed", warning=True) |
Path Blending
Joint moves as well as linear and circular moves can be blended together into one continuous motion. This behavior can be enabled using the set_path_blending()
method. Note that the motion will be executed before the next non-motion command. To force the execution of blended commands, use the the sync()
method.
enable – Enable or disable path blending.
blend_radius – The blend radius between moves in meters.
- JointTrajectory
Loads a raw joint trajectory from a CSV file and returns them in ROS format.
Parameters: file_path – Path of the CSV file.
Returns: A ROS joint trajectory.
robot_command.rpl.
set_path_blending
(enable: bool, blend_radius: Optional[float] = None) -> NoneEnables or disables path blending and sets the blend radius.
Parameters: |
Examples
language | python |
---|---|
linenumbers | false |
Anchor robot_command.rpl.syncsave_trajectory robot_command.rpl.syncsave_trajectory robot_command.rpl.
sync
(save_trajectory
(file_path: str, trajectory: JointTrajectory) -> NoneThe sync command is used in wait cycles and to force the execution of queued move commands.
Work and Tool Offsets
The TRPL supports an arbitrary number of named work and tool offsets. These offsets are usually defined in the robot UI, however, can also be set inside a program.
...
save trajectory command saves a joint trajectory to a CSV file.
Parameters: file_path – Path of the CSV file.
trajectory – The joint trajectory to save.
...
Anchor robot_command.rpl.change_work_offsetexecute_trajectory robot_command.rpl.execute_trajectory robot_command.rpl.
change_work_offsetrobot_command.rpl.
change_work_offset
(name: Optional[str]) -> Noneexecute_trajectory
(trajectory: JointTrajectory, v: float = None, retime: bool = False, velocity_scale: float = 1.0) -> NoneThe execute trajectory command executes a ROS JointTrajectory. Before running the joint trajectory, the robot moves to the start joint position using a joint move command. :param velocity_scale: move velocity scaling factor 0.0 - 1.0 :param trajectory: a ROS joint trajectory :param retime: Enable retiming the trajectory to make use of the velocity scaling.
Parameters: v –
move velocity scaling factor 0.0 - 1.0
Note Deprecated since version 3.1.1: use velocity_scale instead
Change the currently active work offset. If an empty string or None
is used as as the name parameter, the empty work offset world becomes active.
Examples
...
name – Name of the work offset
...
pose – Pose to use for the work offset
...
position – Use the position of this pose to override the position of the pose.
...
Code Block | ||||
---|---|---|---|---|
|
...
change_work_offset("table")
change_work_offset(None) # disable any active offsets
...
Sets a work offset using a pose, position or orientation or clears an offset.
The position and orientation arguments can be combined to overwrite the pose’s position or orientation.
trajectory = load_trajectory('test.csv')
execute_trajectory(trajectory)
save_trajectory('test2.csv', trajectory) |
Glossary of Move Errors
Move commands typically fails due to two major reasons, either during planning or during execution. You can catch those errors and retry a move inside the robot program.
...
exceptionAnchor robot_command.rpl.MovePlanningError robot_command.rpl.MovePlanningError robot_command.rpl.
MovePlanningError
...
exceptionAnchor robot_command.rpl.MoveExecutionError robot_command.rpl.MoveExecutionError robot_command.rpl.
MoveExecutionError
(message=None, error_code=None)
...
Examples
...
Returns the pose of a work offset.
Parameters: | name – Name of the work offset. |
Returns: | Pose of the work offset. |
Raises: | TypeError – if no work offset with the name is found |
Examples
...
language | python |
---|---|
linenumbers | false |
...
Code Block | ||||
---|---|---|---|---|
|
...
set_work_offset("table", p[0, 100, 0, 0, 0, 0])
set_work_offset("offset_1", waypoint_2, orientation=Pose(a=90))
set_work_offset("offset_1") # clears offset_1
try:
movel(waypoint)
except MovePlanningError: # is raised in case of a planning error
notify("Move planning failed", warning=True) |
Path Blending
Joint moves as well as linear and circular moves can be blended together into one continuous motion. This behavior can be enabled using the set_path_blending()
method. Note that the motion will be executed before the next non-motion command. To force the execution of blended commands, use the the sync()
method.
Anchor robot_command.rpl.workset_path_offsetblending robot_command.rpl.workset_offset robot_command.rpl.
work_offset
(pose=None, position=None, orientation=None, world=False)path_blending robot_command.rpl.
set_path_blending
(enable: bool, blend_radius: Optional[float] = None) -> NoneEnables or disables path blending and sets the blend radius.
Parameters: pose – The offset pose.
position – A pose from which the position is used for the offset.
orientation – A pose from which the orientation is used for the offset.
world – If set to True the offset is absoluteenable – Enable or disable path blending.
blend_radius – The blend radius between moves in meters.
Examples
Code Block language python linenumbers false with work_offset(p[0, 100, 0, 90, 20, 0]): # creates a temporary offset and activates it movel(Pose(x=10)) # move x by 10 starting from the offset # the active offset automatically reset when the scope is left
Scoped offset command. Applies a work offset temporarily on top of the currently active work offset.
The scoped offset command can be used to automatically switch the active offset back to a previous state when the scope is left. Scoped offsets can be nested. Scoped offsets are temporary and do not have a nameTool Offsets
set_path_blending(True, 0.0) # enable path blending, blend radius 0.0m movej(waypoint1) movej(waypoint2) movej(waypoint3) sync() # moves executed before this command set_path_blending(False) # disable path blending again
Anchor robot_command.rpl.change_tool_offsetsync robot_command.rpl.change_tool_offsetsync robot_command.rpl.
change_tool_offset
(name: Optional[str]sync
() -> NoneChange the currently active tool offset. If an empty string or
None
is used as as the name parameter, the empty tool offset none becomes active.Parameters: name – The name of the tool offset to activate or None to disable tool offsets.
Examples
Code Block change_tool_offset("table") change_tool_offset(None) # disable any active offsetslanguage python linenumbers false The sync command is used in wait cycles and to force the execution of queued move commands.
...
Work and Tool Offsets
The TRPL supports an arbitrary number of named work and tool offsets. These offsets are usually defined in the robot UI, however, can also be set inside a program.
Work Offsets
...
Anchor robot_command.rpl.change_work_offset robot_command.rpl.change_work_offset robot_command.rpl.
change_work_offset
(*args, **kwargs) -> None
...
Anchor robot_command.rpl.set_toolwork_offset robot_command.rpl.set_toolwork_offset robot_command.rpl.
set_toolwork_offset
(name: str, pose: Union[robot_command.rpl.Pose, str] = None, position: Union[robot_command.rpl.Pose, str] = None, orientation: Union[*args, **kwargs) -> None
...
Pose, str] = None) -> NoneAnchor robot_command.rpl. name – Name of the tool offset
pose – Pose to use for the tool offset
position – Use the position of this pose to override the position of the pose.
orientation – Use the orientation of this pose to override the orientation of the pose.
get_work_offset robot_command.rpl.get_work_offset robot_command.rpl.
get_work_offset
(*args, **kwargs) -> Optional[Pose]
language | python |
---|---|
linenumbers | false |
Sets a tool offset using a pose, position or orientation or clears an offset.
The position and orientation arguments can be combined to overwrite the pose’s position or orientation.
Parameters: |
Examples
...
Anchor robot_command.rpl.work_offset robot_command.rpl.work_offset robot_command.rpl.
work_offset
(*args, **kwargs)
...
Tool Offsets
...
Anchor robot_command.rpl.change_tool_offset robot_command.rpl.change_tool_offset robot_command.rpl.
change_tool_offset
(*args, **kwargs) -> None
...
Anchor robot_command.rpl.getset_tool_offset robot_command.rpl.getset_tool_offset robot_command.rpl.
getset_tool_offset
(name: str*args, **kwargs) -> Optional[None
...
Pose]Anchor robot_command.rpl. get_tool_offset robot_command.rpl.get_tool_offset robot_command.rpl.
get_tool_offset
( "tool1")- *args, **kwargs) -> Optional[Pose]
language | python |
---|---|
linenumbers | false |
Returns the pose of a tool offset.
Parameters: | name – Name of the tool offset. |
Returns: | Pose of the work offset or None if it does not exist. |
Raises: | TypeError – if no tool offset with the name is found |
Examples
...
Digital I/O
Digital input/output pins can be accessed via their name or by their number.
...
Anchor robot_command.rpl.get_pathpilot_state robot_command.rpl.get_pathpilot_state robot_command.rpl.
get_pathpilot_state
(instance: str = '') -> strReturns the current state of a PathPilot instance. If no instance argument is given, the command is executed on the first connected PathPilot instance.
Possible states are:
“disconnected” - Instance disconnected
“estop” - Emergency stop active
“running” - a program is running
“ready” - instance is ready to start program
“idle” - instance is idle, no program loaded
Parameters: instance – PathPilot instance on which cycle start should be executed.
Returns: The current PathPilot state.
Examples
Code Block language python linenumbers false state = get_pathpilot_instance() while get_pathpilot_instance("left_mill") != "ready": sleep(0.1)
Sets the origin offset for the 3D visualization of the PathPilot remote machine model.
Parameters: pose – Pose to use for the machine offset.
instance – Optional machine instance name. If not given, default instance is used.
Examples
Code Block language python linenumbers false set_machine_offset(p[0,0,0,90,0,0], "instance") set_machine_offset(Pose(x=100)) # sets offset for default instance(0.1)
robot_command.rpl.
set_machine_offset
(pose: Union[robot_command.rpl.Pose, str], instance: str = '') -> None...
Anchor robot_command.rpl.set_machine_offset robot_command.rpl.set_machine_offset robot_command.rpl.
set_machine_offset
(*args, **kwargs) -> None
...
Notifications
The TRPL supports interactive user notifications displayed in the robot UI.
...
Anchor robot_command.rpl.probel robot_command.rpl.probel robot_command.rpl.
probel
(target: Union[robot_command.rpl.Pose, robot_command.rpl.Joints, str], a: float = 0.5, v: float = 0.1, v_retract: float = 0.1, away: bool = False, check_retract_contact: bool = False) -> robot_command.rpl.PoseSimple probing cycle that returns to the initial pose (regardless of the probe result). The sequence is:
Linear move at specified vel / accel scale towards the target position
Stop at probe contact, error condition, or motion end
Retract to original position
Raise any errors from the cycle, or return the probe result
Parameters: target – end point of probing motion (probe cycle uses movel internally)
v – move velocity scaling factor 0.0 - 1.0
a – move acceleration scaling factor 0.0 - 1.0
v_retract – velocity scaling factor to use during retract phase
away – Probe towards work (default) if False, otherwise probe away from work
check_retract_contact – Optionally check for contacts during retract move (to avoid retracting into an obstacle and breaking a probe tip)
Info assumes mode 2/4 for probing, meaning an error will be thrown if it reaches the end without contact. Caller can catch this exception if they want mode 3/5 functionality
Examples
Code Block language python linenumbers false contact_pose = probel(probe_goal_pose, a=0.5, v=0.01, v_retract=0.1, away=False, check_retract_contact=False)
When called, probel()
executes two motions:
...
Anchor robot_command.calibration.calculate_tool_offsetframe_4 robot_command.calibration.calculate_tool_offsetframe_4 robot_command.calibration.
calculate_tool_offsetframe_4
(wp1: robot_command.rpl.Pose, wp2: robot_command.rpl.Pose, wp3: robot_command.rpl.Pose, wp4: robot_command.rpl.Pose) -> robot_command.rpl.> PoseCalculate the XYZ coordinates of the tool offset frame using 4 waypoints using the center of sphere method.
Parameters: wp1 – Waypoint 1
wp2 – Waypoint 2
wp3 – Waypoint 3
wp4 – Waypoint 4
Returns: The tool offset frame pose containing the XYZ tool offsetframe.
Anchor robot_command.calibration.calculate_workuser_offsetframe_3 robot_command.calibration.calculate_workuser_offsetframe_3 robot_command.calibration.
calculate_workuser_offsetframe_3
(origin_wp: robot_command.rpl.Pose, x_axis_wp: robot_command.rpl.Pose, y_axis_wp: robot_command.rpl.Pose) -> robot_command.rpl.PoseCalculates the work offset user frame origin pose based on 3 waypoints that lie on a plane.
The angular unit of all input poses must be in radians.
Parameters: origin_wp – Origin of the plane.
x_axis_wp – A waypoint that lies on the X-axis of the plane.
y_axis_wp – A waypoint that lies in the direction of the Y-axis of the plane.
Returns: Origin waypoint of the constructed work offsetuser frame.
Anchor robot_command.calibration.calculate_workuser_offsetframe_4 robot_command.calibration.calculate_workuser_offsetframe_4 robot_command.calibration.
calculate_workuser_offsetframe_4
(origin_wp: robot_command.rpl.Pose, x_axis_wp: robot_command.rpl.Pose, y_axis_wp: robot_command.rpl.Pose, position_wp: robot_command.rpl.Pose) -> robot_command.rpl.PoseCalculates the work offset user frame origin pose based on 3 waypoints that lie on a plane and one additional waypoint which is used to define the origin location.
The angular unit of all input poses must be in radians.
Parameters: origin_wp – Origin of the plane.
x_axis_wp – A waypoint that lies on the X-axis of the plane.
y_axis_wp – A waypoint that lies in the direction of the Y-axis of the plane.
position_wp – Origin location of the new work offsetuser frame.
Returns: Origin waypoint of the constructed work offsetuser frame.