Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The TRPL is based on Python. All commands interpreted by the TRPL interpreter are Python code, which means you can use any Python code to control the robot. However, the graphical conversational programming utility only supports re-interpretation of a subset of commands as defined here.

...

...

Anchor
robot_command.rpl.set_units
robot_command.rpl.set_units
robot_command.rpl.set_units(angularlinear: Optional[Union[str, pint.util.SharedRegistryObject]] = None, linearangular: Optional[Union[str, pint.util.SharedRegistryObject]] = None) -> None

Sets the active linear and angular units for the program.

Parameters:
  • linear – Linear/length unit type: m, mm, inch

  • angular – Angular/rotation unit type: deg, rad

Examples

Code Block
languagepython
linenumbersfalse
set_units("mm", "deg")
set_units(linear="in")
set_units(angular="rad")

...

Anchor
robot_command.rpl.Joints
robot_command.rpl.Joints
class 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
languagepython
linenumbersfalse
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.joints.Joints

Creates a copy of the joints object. :return:

Returns:

Copy of the joints object.

Anchor
robot_command.rpl.Joints.from_list
robot_command.rpl.Joints.from_list
static from_list(joint_list: List[float]) -> robot_command.rpl.joints.Joints

Creates a new joint object from a list of joint positions.

Parameters:
param

joint_list

:

List of the six joint positions.

Returns:
return:

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:
param

angular_unit

:

Unit type for the angular joint positions.

Returns:
return:

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:
return:

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.joints.Joints

Converts 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:
param

angular_unit

:

Unit type for the angular joint positions.

Returns:
return:

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.joints.Joints

Adds 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:
param

angular_unit

:

Unit type for the angular joint positions.

Returns:
return:

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.joints.Joints

Removes units from the joint positions if any. If no unit type is specified ROS units are assumed.

Parameters:
param

angular_unit

:

Unit type for the angular joint positions.

Returns:
return:

The resulting joints object.

...

Anchor
robot_command.rpl.JointsFactory
robot_command.rpl.JointsFactory
class robot_command.rpl.JointsFactory

The JointFactory JointsFactory class helps constructing Joints object using a shorthand notation. In the robot program it can be accessed using the j[] shortcut.

Examples

Code Block
languagepython
linenumbersfalse
waypoint_1 = j[0.764, 1.64, 0.741, 0.433, 0.140, 2.74]
Anchor
robot_command.rpl.get_joint_values
robot_command.rpl.get_joint_values
robot_command.rpl.get_joint_values() -> robot_command.rpl.joints.Joints

Returns the current joint values.

Returns:

Current joint values.

Examples

Code Block
languagepython
linenumbersfalse
joint_value = get_joint_values()

...

Anchor
robot_command.rpl.Pose
robot_command.rpl.Pose
class robot_command.rpl.Pose(x: float = Union[numbers.Number, pint.quantity.build_quantity_class.<locals>.Quantity] = 0.0, y: float Union[numbers.Number, pint.quantity.build_quantity_class.<locals>.Quantity] = 0.0, z: float Union[numbers.Number, pint.quantity.build_quantity_class.<locals>.Quantity] = 0.0, a: float Union[numbers.Number, pint.quantity.build_quantity_class.<locals>.Quantity] = 0.0, b: float Union[numbers.Number, pint.quantity.build_quantity_class.<locals>.Quantity] = 0.0, c: float = 0.0Union[numbers.Number, pint.quantity.build_quantity_class.<locals>.Quantity] = 0.0, offset: str = '')

A robot pose consists of XYZ position ABC orientation parameters.

Optionally, an offset frame can be recorded with a waypoint.

Examples

Code Block
languagepython
linenumbersfalse
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.copy__mul__
robot_command.rpl.Pose.copy
copy() -> robot_command.rpl.Pose

Creates a copy of the pose object. :return: A copy of the pose.

Anchor
robot_command.rpl.Pose.from_kdl_frame__mul__
__mul__(other: robot_command.rpl.Pose.from_kdl_frame static from_kdl_frame(frame: PyKDL.Framepose.Pose) -> robot_command.rpl.pose.Pose

Converts a Use KDL frame multiplication to apply an offset to a pose object. :param frame: KDL frame. :return:

Parameters:

other – Other pose.

Returns:

New pose object.

Code Block
languagepython
linenumbersfalse
new_wp = waypoint_1 * Pose(x=10) # translates waypoint_1 by x=10
old_wp = new_wp * Pose(x=10).inverse() # translates new_wp back
Anchor
robot_command.rpl.Pose.from_listcopy
robot_command.rpl.Pose.from_list
static from_list(pose_list: List[float]
copy
copy() -> robot_command.rpl.pose.Pose

Creates a new copy of the pose object from a list of coordinates. :param pose_list: List of the six coordinates. :return: New pose object

Returns:

A copy of the pose.

Anchor
robot_command.rpl.Pose.from_roskdl_poseframe
robot_command.rpl.Pose.from_roskdl_poseframe
static from_roskdl_poseframe(pose: Union[geometry_msgs.msg._Pose.Pose, geometry_msgs.msg._PoseStamped.PoseStamped]frame: PyKDL.Frame) -> robot_command.rpl.pose.Pose

Converts a ROS native pose KDL frame to a pose object. :param pose: The ROS stamped pose. :return:

Parameters:

frame – KDL frame.

Returns:

New pose object.

Anchor
robot_command.rpl.Pose.from_ros_unitslist
robot_command.rpl.Pose.from_ros_unitslist
static from_ros_unitslist(linearpose_unitlist: 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. :param linear_unit: Unit type for linear coordinates. :param angular_unit: Unit type for angular coordinates. :return: The resulting pose.
List[float]) -> robot_command.rpl.pose.Pose

Creates a new pose object from a list of coordinates.

Parameters:

pose_list – List of the six coordinates.

Returns:

New pose object.

Anchor
robot_command.rpl.Pose.inversefrom_ros_pose
robot_command.rpl.Pose.inverse
inverse(
from_ros_pose
static from_ros_pose(pose: Union[geometry_msgs.msg._Pose.Pose, geometry_msgs.msg._PoseStamped.PoseStamped]) -> robot_command.rpl.pose.Pose

Creates the inverse of the pose. Useful for calculating offset. :return: Converts a ROS native pose to a pose object.

Parameters:

pose – The ROS stamped pose.

Returns:

New pose object.

Anchor
robot_command.rpl.Pose.tofrom_kdlros_frameunits
robot_command.rpl.Pose.tofrom_kdlros_frameunits
tofrom_kdlros_frame() -> PyKDL.Frameunits(linear_unit: Optional[Union[str, pint.util.SharedRegistryObject]] = None, angular_unit: Optional[Union[str, pint.util.SharedRegistryObject]] = None)

Converts the pose object to a KDL frame. :return: KDL framefrom 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.to_listinverse
robot_command.rpl.Pose.to_list
to_list
inverse
inverse() -> List[float]
Convert the pose to a list of the coordinates. :return: List of the six coordinates
robot_command.rpl.pose.Pose

Creates the inverse of the pose. Useful for calculating offset.

Returns:

New pose object.

Anchor
robot_command.rpl.Pose.to_roskdl_poseframe
robot_command.rpl.Pose.to_roskdl_poseframe
to_roskdl_poseframe() -> geometry_msgs.msg._Pose.PosePyKDL.Frame

Converts the pose object to a native ROS pose. :return: ROS poseKDL frame.

Returns:

KDL frame.

Anchor
robot_command.rpl.Pose.to_ros_unitslist
robot_command.rpl.Pose.to_ros_unitslist
to_ros_units(linear_unit: Optional[Union[str, pint.util.SharedRegistryObject]] = None, angular_unit: Optional[Union[str, pint.util.SharedRegistryObject]] = None) -> robot_command.rpl.Pose
Converts 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. :param linear_unit: Unit type for linear coordinates. :param angular_unit: Unit type for angular coordinates. :return: The resulting pose.
list() -> List[float]

Convert the pose to a list of the coordinates. :return: List of the six coordinates.

Anchor
robot_command.rpl.Pose.withto_ros_unitspose
robot_command.rpl.Pose.with_units
with
to_ros_pose
to_ros_pose() -> geometry_msgs.msg._Pose.Pose

Converts 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.pose.Pose

Adds a unit type to all coordinates of Converts the pose . The defaults are the to native ROS units. In case a coordinate already has units, removing the unit type is converted accordingly. :param 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.

:param
  • angular_unit

:
  • Unit type for angular coordinates.

Returns:
return:

The resulting pose.

Anchor
robot_command.rpl.Pose.withoutwith_units
robot_command.rpl.Pose.withoutwith_units
withoutwith_units(linear_unit: Optional[Union[str, pint.util.SharedRegistryObject]] = None, angular_unit: Optional[Union[str, pint.util.SharedRegistryObject]] = None) -> robot_command.rpl.pose.Pose

Removes units from the coordinates if any. If no unit type is specified ROS units are assumed. :param linear_unit: Adds 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_unitUnit type for linear coordinates.

:param
  • angular_unit

:
  • Unit type for angular coordinates.

Returns:
return:

The resulting pose.

Anchor
robot_command.rpl.Pose.
PoseFactory
without_units
robot_command.rpl.
PoseFactory class
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.
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
pose.Pose

Removes 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.

...

Anchor
robot_command.rpl.PoseFactory
robot_command.rpl.PoseFactory
class 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
languagepython
linenumbersfalse
waypoint_1 = p[202.73, 750.08, 91.75, 6.63, 53.21, "table"]  # captured with table work offset
Anchor
robot_command.rpl.get_pose
robot_command.rpl.get_pose
robot_command.rpl.get_pose(apply_work_offset: bool = True, apply_tool_offset: bool = True) -> robot_command.rpl.pose.Pose

Returns the current robot pose.

Parameters:
  • apply_work_offset – Applies the active work offset to the world pose.

  • apply_tool_offset – Applies the active tool offset to the world pose.

Returns:

Current robot pose.

Examples

Code Block
languagepython
linenumbersfalse
current_pose = get_pose()

Pose Arithmetic

Poses can be used as transforms using multiplication.

Code Block
languagepython
linenumbersfalse
new_wp = waypoint_1 * Pose(x=10) # translates waypoint_1 by x=10
old_wp = new_wp * Pose(x=10).inverse() # translates new_wp back

Setting and getting global waypoints from robot programs

...

Setting and getting global waypoints from robot programs

Robot programs can set or get a global waypoint as part of its execution. Setting of a new global waypoint is achieved by calling robot_command.rpl.set_global_waypoint(). Getting of existing global waypoints is accomplished by calling robot_command.rpl.get_global_waypoint().

Anchor
robot_command.rpl.set_global_waypoint
robot_command.rpl.set_global_waypoint
class robot_command.rpl.set_global_waypoint(name: str, value: Union[

alias of robot_command.rpl.

Pose, robot_command.rpl.Joints])

Set global waypoint pose or joints value.

Parameters:
  • name – Name of the global waypoint

  • value – Pose or joints value

Examples

Code Block
languagepython
linenumbersfalse
set_global_waypoint("point", p[500.0, 0.0, 900.0, 0.0, -90.0, 0.0])

_create_doc_commands.<locals>.funct

...

Anchor
robot_command.rpl.get_global_waypoint
robot_command.rpl.get_global_waypoint
class robot_command.rpl.get_global_waypoint(name: str)

Get global waypoint pose or joints value.

Parameters:

name – Name of the global waypoint.

Returns:

Pose or Joints of the global waypoint or None if it does not exist.

Examples

Code Block
languagepython
linenumbersfalse
point = get_global_waypoint("point")

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.Pose, robot_command.rpl.joints.Joints], v: float = 1.0, probe: int = 0) -> Optional[Tuple[int, rospy.rostime.Time, robot_command.rpl.joints.Joints, robot_command.rpl.pose.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 target

  • v – 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

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
languagepython
linenumbersfalse
movej(waypoint_1)
movej("global_waypoint_1")
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.Pose, robot_command.rpl.joints.Joints], a: float = 0.5, v: float = 0.5, probe: int = 0) -> Optional[Tuple[int, rospy.rostime.Time, robot_command.rpl.joints.Joints, robot_command.rpl.pose.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

  • 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
languagepython
linenumbersfalse
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])

...

Anchor
robot_command.rpl.movec
robot_command.rpl.movec
robot_command.rpl.movec(interim: Union[robot_command.rpl.pose.Pose, robot_command.rpl.joints.Joints], target: Union[robot_command.rpl.pose.Pose, robot_command.rpl.joints.Joints], a: float = 0.5, v: float = 0.5, probe: int = 0) -> Optional[Tuple[int, rospy.rostime.Time, robot_command.rpl.joints.Joints, robot_command.rpl.pose.Pose]]

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.0

  • 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)

...

Anchor
robot_command.rpl.movef
robot_command.rpl.movef
robot_command.rpl.movef(target: Union[robot_command.rpl.pose.Pose, robot_command.rpl.joints.Joints]) -> None

Free move command.

Parameters:

target – target target

...

Anchor
robot_command.rpl.MovePlanningError
robot_command.rpl.MovePlanningError
exception robot_command.rpl.MovePlanningError
Exception thrown when a move command is failing due to a planning error.
Anchor
Anchor
robot_command.rpl.MoveExecutionError
robot_command.rpl.MoveExecutionError
exception robot_command.rpl.MoveExecutionError
Exception thrown when a move command is failing due to an error during execution.
(message=None, error_code=None)

...

Examples

Code Block
languagepython
linenumbersfalse
try:
    movel(waypoint)
except MovePlanningError:  # is raised in case of a planning error
    notify("Move planning failed", warning=True)

...

Anchor
robot_command.rpl.set_path_blending
robot_command.rpl.set_path_blending
robot_command.rpl.set_path_blending(enable: bool, blend_radius: Optional[float] = None) -> None

Enables or disables path blending and sets the blend radius.

Parameters:
  • enable – Enable or disable path blending.

  • blend_radius – The blend radius between moves in meters.

Examples

Code Block
languagepython
linenumbersfalse
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_work_offset
robot_command.rpl.change_work_offset
robot_command.rpl.change_work_offset(name: Optional[str]) -> None

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.

Parameters:

name – The name of the tool offset to activate or None to disable work offsets.

Examples

Code Block
languagepython
linenumbersfalse
change_work_offset("table")
change_work_offset(None) # disable any active offsets
Anchor
robot_command.rpl.set_work_offset
robot_command.rpl.set_work_offset
robot_command.rpl.set_work_offset(name: str, pose: Optional[Union[robot_command.rpl.pose.Pose, str]] = None, position: Optional[Union[robot_command.rpl.pose.Pose, str]] = None, orientation: Optional[Union[robot_command.rpl.pose.Pose, str]] = None) -> None

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.

Parameters:
  • 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.

  • orientation – Use the orientation of this pose to override the orientation of the pose.

Examples

Code Block
languagepython
linenumbersfalse
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
Anchor
robot_command.rpl.get_work_offset
robot_command.rpl.get_work_offset
robot_command.rpl.get_work_offset(name: str) -> Optional[robot_command.rpl.pose.Pose]

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

Code Block
languagepython
linenumbersfalse
pose = get_work_offset("table")
Anchor
robot_command.rpl.work_offset
robot_command.rpl.work_offset
class robot_command.rpl.work_offset(pose: Optional[Union[robot_command.rpl.Pose, str]] =None, position: Optional[Union[robot_command.rpl.Pose, str]] =None, orientation: Optional[Union[robot_command.rpl.Pose, str]] =None, world: bool =False)

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 name.

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 absolute.

Examples

Code Block
languagepython
linenumbersfalse
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

...

Anchor
robot_command.rpl.set_tool_offset
robot_command.rpl.set_tool_offset
robot_command.rpl.set_tool_offset(name: str, pose: Optional[Union[robot_command.rpl.pose.Pose, str]] = None, position: Optional[Union[robot_command.rpl.pose.Pose, str]] = None, orientation: Optional[Union[robot_command.rpl.pose.Pose, str]] = None) -> None

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:
  • 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.

Examples

Code Block
languagepython
linenumbersfalse
set_tool_offset("some_tool", p[0, 0, 100, 0, 0, 0])
set_tool_offset("other_tool", waypoint_2, position=Pose(z=0.1))
set_tool_offset("other_tool") # clears offset other_tool
Anchor
robot_command.rpl.get_tool_offset
robot_command.rpl.get_tool_offset
robot_command.rpl.get_tool_offset(name: str) -> Optional[robot_command.rpl.pose.Pose]

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

Code Block
languagepython
linenumbersfalse
pose = get_tool_offset("tool1")

...

Anchor
robot_command.rpl.set_machine_offset
robot_command.rpl.set_machine_offset
robot_command.rpl.set_machine_offset(pose: Union[robot_command.rpl.pose.Pose, str], instance: str = '') -> None

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
languagepython
linenumbersfalse
set_machine_offset(p[0,0,0,90,0,0], "instance")
set_machine_offset(Pose(x=100))  # sets offset for default instance

...

Anchor
robot_command.rpl.notify
robot_command.rpl.notify
robot_command.rpl.notify(message: str, warning: bool = False, error: bool = False, image_path: str = '', timeout: Optional[float] = None) -> None

Creates a popup notification message on the robot UI.

The message argument text is shown to the user.

By default, the message is displayed as informational and thus will not block the program flow. The warning argument shows a warning message, which breaks program flow and can be declined by the operator. The error argument shows a blocking error message, which aborts the program.

The optional image_path argument can be used to display an informational image along with the message

Parameters:
  • message – Message text to display in the popup.

  • warning – Set to true if this message is a warning.

  • error – Set to true if this message is an error message.

  • image_path – Optional path to an image file to displayed in the popup.

  • timeout – Optional timeout in seconds.

Examples

Code Block
languagepython
linenumbersfalse
notify("Hello World!")
notify("No part found, check the palette.", warning=True)
notify("This should not happen.", error=True, image_path="./fatal_error.png")

...

Anchor
robot_command.rpl.sleep
robot_command.rpl.sleep
robot_command.rpl.sleep(secs: float) -> None
Parameters:

secs – sleep time in seconds

Examples

Code Block
languagepython
linenumbersfalse
sleep(5.0)
The sleep command pauses the program execution for t seconds.
Anchor
robot_command.rpl.pause
robot_command.rpl.pause
robot_command.rpl.pause(optional: bool = False, active: bool = False) -> None

The pause command pauses the program execution. Equivalent to M01 break.

The optional states whether the pause is optional or not. Optional pause can be enabled in the robot UI by the operator.

Parameters:
  • optional – If this pause is optional or not.

  • active – When set to true, this indicates an active pause allowing to operator to jog the program.

Examples

Code Block
languagepython
linenumbersfalse
pause()
pause(optional=True)

...

Anchor
robot_command.rpl.get_param
robot_command.rpl.get_param
robot_command.rpl.get_param(name: str, default: Optional[object] = None) -> object

Fetch a stored user parameter.

Parameters:
  • name – Parameter name.

  • default – Default value return if the parameter is not defined.

Returns:

Returns a base Python type, construct rpl types or returns a dict if the parameter is set, else returns the default value.

Examples

...

Code Block

...

The probel command is a simple probing cycle:

Anchorrobot_
language

...

Under development

python
linenumbersfalse
wp = get_param("my_waypoint", Pose())

Probing

Warning

Under development

The probel command is a simple probing cycle:

...

Anchor
robot_command.rpl.probel
robot_command.rpl.probel
robot_command.rpl.probel(target: Union[robot_command.rpl.pose.Pose, robot_command.rpl.joints.Joints, str], a: float = 0.5, v: float = 0.1, v_retract: float = 0.1, away: bool = False) -> robot_command.rpl.pose.Pose

Simple probing cycle that returns to the initial pose (regardless of the probe result). The sequence is:

  1. Linear move at specified vel / accel scale towards the target position

  2. Stop at probe contact, error condition, or motion end

  3. Retract to original position

  4. 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

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
languagepython
linenumbersfalse
contact_pose = probel(probe_goal_pose, a=0.5, v=0.01, v_retract=0.1, away=False)

...

Info

if the probe fails to make contact in mode 3 (or leave contact in mode 5), movel will return “None” instead of a result tuple.

Glossary of Probe Errors

...

of a result tuple.

Glossary of Probe Errors

There are several probing-specific errors that are reported as python exceptions. All of them are derived from the ProbeError exception class.

...

Anchor
robot_command.rpl.ProbeUnexpectedContactError
robot_command.rpl.ProbeUnexpectedContactError
exception robot_command.rpl.ProbeUnexpectedContactError(error_code=None)

...

Anchor
robot_command.rpl.ProbeContactAtStartError
robot_command.rpl.ProbeContactAtStartError
exception robot_command.rpl.ProbeContactAtStartError(error_code=None)

...

Anchor
robot_command.rpl.ProbeFailedError
robot_command.rpl.ProbeFailedError
exception robot_command.rpl.ProbeFailedError(error_code=None)

...

Calibration

The robot_command.calibration module contains a few useful functions to write custom calibration programs. Note that these functions must be imported manually.

Anchor
module-robot_command.calibration
module-robot_command.calibration

...

Anchor
robot_command.calibration.calculate_tool_offset_4
robot_command.calibration.calculate_tool_offset_4
robot_command.calibration.calculate_tool_offset_4(wp1: robot_command.rpl.pose.Pose, wp2: robot_command.rpl.pose.Pose, wp3: robot_command.rpl.pose.Pose, wp4: robot_command.rpl.pose.Pose) -> robot_command.rpl.pose.Pose

Calculate the XYZ coordinates of the tool offset 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 pose containing the XYZ tool offset.

...

Anchor
robot_command.calibration.calculate_work_offset_3
robot_command.calibration.calculate_work_offset_3
robot_command.calibration.calculate_work_offset_3(origin_wp: robot_command.rpl.pose.Pose, x_axis_wp: robot_command.rpl.pose.Pose, y_axis_wp: robot_command.rpl.pose.Pose) -> robot_command.rpl.pose.Pose

Calculates the work offset 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 offset.

...

Anchor
robot_command.rpl.ProbeUnexpectedContactErrorcalibration.calculate_work_offset_4
robot_command.rpl.ProbeUnexpectedContactError
exception
calibration.calculate_work_offset_4
robot_command.calibration.calculate_work_offset_4(origin_wp: robot_command.rpl.ProbeUnexpectedContactError

An unexpected “contact” (rising or falling edge on the probe signal) is seen during normal motion or a probe retract.

Anchor.pose.Pose, x_axis_wp: robot_command.rpl.pose.Pose, y_axis_wp: robot_command.rpl.ProbeContactAtStartError.pose.Pose, position_wp: robot_command.rpl.ProbeContactAtStartError exception .pose.Pose) -> robot_command.rpl.ProbeContactAtStartError

A motion was commanded when the probe was already in contact (applies to non-probing motions and probe modes 2 and 3)

Anchorrobot_command.rpl.ProbeFailedErrorrobot_command.rpl.ProbeFailedError exception robot_command.rpl.ProbeFailedErrorProbe signal was unchanged during a probing move, meaning the motion failed to make contact (for probe modes 2 and 4)
pose.Pose

Calculates the work offset 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 offset.

Returns:

Origin waypoint of the constructed work offset.