Moving a Robot on a Linear Path

A linear motion is a movement where the robot travels to a target position along a straight-line path in Cartesian space. Unlike point-to-point (PTP) motion, which follows the shortest path in joint space, a linear motion ensures a predictable trajectory in Cartesian coordinates. However, depending on the robot’s kinematics, this type of movement may not always be the fastest.

This chapter specifically explains linear movements. For detailed information on how to use these methods synchronously or asynchronously, see the asynchronous instructions chapter.

Performing a Linear Movement

Performing a linear movement can be done using the method move_linear(), which requires a target pose of either type JointPose or CartesianPose.

Perform a Linear Movement using a CartesianPose

To perform a linear movement to a target defined in Cartesian space, use a CartesianPose as an input target argument:

cartesian_pose = CartesianPose().from_list(
    [0.1382, 0.550, 0.296, 3.14159, 0.0, 0.0]
)
robot.move_linear(cartesian_pose, velocity_mps=1.0).result()

The velocity_mps argument defines the maximum translational velocity for the tool center point in meter per second. Giving no argument results in a speed of 1 m/s. Since a Cartesian pose is ambiguous for a six axis robot, the resulting joint configuration at the target can differ depending on the starting pose of the robot.

Note

The CartesianPose is interpreted in the world coordinate system. No specific tool is assumed. The behavior depends on the specific robot in use.

A CartesianPose itself can be ambiguous in regards to the exact joint configuration of the robot. It is at the discretion of the underlying robot control to choose a convenient joint configuration to reach the given pose. This means, that the robot configuration reached depends on the starting position.

Perform a Linear Movement using a JointPose

To perform a linear movement to a target defined in joint space, use a JointPose as an input target argument:

joints_in_deg = [90, -90, 90, -90, -90, 0]
joints_in_rad = [radians(joint) for joint in joints_in_deg]
joint_pose = JointPose().from_list(joints_in_rad)
robot.move_linear(joint_pose, velocity_mps=1.0).result()

Perform a Relative Linear Movement

For moving linear relative to its current pose, use the move_linear_relative() method. Other than that, the method accepts the same arguments as move_linear().

cartesian_pose: CartesianPose = z(0.1)
robot.move_linear_relative(cartesian_pose, velocity_mps=1.0).result()

In this example, the robot moves relative in the positive z-direction from its current pose. The z input argument is a CartesianPose, where every argument is zero except the value of z.

Perform a Linear Movement with Blending

Linear movements can use blending by supplying a Factor or Percent input to the blending argument. The higher the blending factor, the more and earlier the blended path will deviate from the original path that would reach the target pose. In most cases this allows the robot to maintain a higher path velocity and complete the overall path faster. Blending only works, if the instructions used for blending are known to robot control in advance. As such, it is not possible to blend two instructions, which are synced to the Python interpreter.

# Pose BLENDING_1 and BLENDING_2 will be blended
robot.move_linear(BLENDING_1, blending=Percent(50))
robot.move_linear(BLENDING_2, blending=Factor(0.5))
# Pose BLENDING_3 will be reached
robot.move_linear(BLENDING_3).result()

Note how the .result(), which syncs the instruction to the Python interpreter, is only used for the last movement command which itself does not contain a blending argument.

Note

The exact behavior and interpretation of the blending parameter as well as implicit limitations are highly dependent on the specific robot used. For more details on how to use and how not to use the blending functionality, please refer to the asynchronous instructions chapter.

Amending blending parameters

If your robot supports sending delayed blending parameters, it is possible to amend a blending parameter after sending the motion instruction using the amend_blending_parameters() method.

robot.move_linear(BLENDING_1)
robot.amend_blending_parameter(blending=Percent(50))
robot.move_linear(BLENDING_2)
robot.amend_blending_parameter(blending=Factor(0.5))
robot.move_linear(BLENDING_3).result()

In this example the robot will blend the poses BLENDING_1 and BLENDING_2 just like in the previous example, but the blending parameters are supplied after sending the motion instruction.

Note that amending the parameter too late - i.e. such that the robot already reached the previous target pose - may result in a drop of the blend request by the robot control.

Full Example of Performing Linear Movements

The following example shows a simple application in which the move_linear() method is being used:

Definition of the Move Linear Method

The move linear method is defined in the MoveLinearTrait:

The methods to amend blending parameters are defined in the AmendBlendingParametersTrait: