Jogging

Jogging instructions move a robot arm in small increments along a desired direction or to a desired pose instead of following a whole path in one go. They require continuous input or confirmation to continue the motion.

Jogging instructions are especially helpful in an HMI application where they are used for maintenance interactions with the robotic system, programming robotic movements as well as debugging them.

Jogging instructions can not be mixed with normal instructions. Each type of instruction can only be processed exclusively at any given time. Issuing normal instructions will raise an error while jogging is active and vice versa.

Note

Jogging features are currently only available for robots of the Victor Robot Behavior Group.

Jogging of a joint

To jog with a single robot joint, the jog_joint_v method can be used. As long as the method is called repeatedly, the robot will keep jogging into the desired direction. Once calls are absent, the axis will decelerate and come to a stop.

Supply the joint index for the joint you want to jog, starting at 0 for the first joint.

The velocity of the movement can be controlled by specifying a maximum velocity in radian per second for rotational joints and meter per second for prismatic joints. By specifying a higher maximum velocity, the speed of the movement can be increased. The velocity also defines the direction of the jogging. A negative velocity moves the robot in the opposite direction.

Furthermore, a maximum acceleration in radian per second squared for rotational joints and meter per second squared for prismatic joints can be specified. The acceleration has to be a positive value. Note that other limits might apply before the provided maximum velocity or maximum acceleration is reached.

future = robot.jog_joint_v(
    joint_index=0,
    velocity=0.5,
    acceleration=0.5,
)

Similar to other instructions, you can call result() to synchronize with the Python interpreter. A jogging future is done when the jogging movement is finished, that means when the robot does not move anymore.

future.result()

To keep the motion alive, refresh the jogging instruction by periodically calling the jog_joint_v method again. Calling the method should have a cool down period as calling without throttling causes undesired side effects and will therefore raise an error. The example below jogs the robot for a specified duration by continuously refreshing the jogging instruction using a while loop. Note that all jogging futures of the loop are only done when the last jogging instruction is finished.

while time.time() - start_time < duration_s:
    future = robot.jog_joint_v(
        joint_index=0,
        velocity=0.5,
        acceleration=0.5,
    )
    time.sleep(throttling_time_s)

Jogging the Tool Center Point in Cartesian Space

To perform jogging in Cartesian space, the jog_tcp_v method can be used. As long as the method is called repeatedly, the tool center point of the robot will keep jogging into the desired direction of the coordinate system specified. Once calls are absent, the axis will decelerate and come to a stop.

Supply the coordinate system in which you want to move, a Cartesian velocity and optionally a Cartesian acceleration magnitude.

The Cartesian velocity describes the maximum velocity in each direction of the coordinate system in meter per second for the translational and in radian per second for the rotational velocities. Its possible to specify a single direction as well as multiple directions for this argument. Its also possible to jog into the opposite direction by specifying negative velocities.

The Cartesian acceleration magnitude describes the maximum acceleration for the translation in meter per second squared and the rotation in radian per second squared of the movement. A Cartesian acceleration magnitude should be a tuple of positive values. Note that other limits might apply before the provided maximum velocity or maximum acceleration is reached.

future = robot.jog_tcp_v(
    cs=CSVictor.ROBOT,
    velocity=CartesianVelocity(x=0.1, y=0.1),
    acceleration=CartesianAccelerationMagnitude(translational=1.0),
)
time.sleep(throttling_time_s)

Similar to other instructions, you can call result() to synchronize with the Python interpreter. A jogging future is done when the jogging movement is finished, that means when the robot does not move anymore.

future.result()

To jog continuously, refresh the jogging motion by periodically calling the jog_tcp_v method again. Calling the method should have a cool down period as calling without throttling causes undesired side effects and will therefore raise an error. The example below jogs the robot for a specified duration by continuously refreshing the jogging instruction using a while loop. Note that all jogging futures of the loop are only done when the last jogging instruction is finished.

while time.time() - start_time < duration_s:
    future = robot.jog_tcp_v(
        cs=CSVictor.ROBOT,
        velocity=CartesianVelocity(x=0.1, y=0.1),
        acceleration=CartesianAccelerationMagnitude(translational=1.0),
    )
    time.sleep(throttling_time_s)

Jogging to a Pose

A jogging instruction to a target pose behaves similar to a normal movement like move_ptp() or move_linear().

Use the methods jog_ptp_v() and jog_linear_v() for absolute motions and jog_ptp_relative_v() and jog_linear_relative_v() for relative motions.

The following first example jogs linear to a previously defined pose, while the second example jogs only the first joint by 60°.

jogging_handle = robot.jog_linear_v(HOME)
jogging_handle = robot.jog_ptp_relative_v(JointPose(j1=radians(60)))

The methods return a so called JoggingHandle, which allows to track the state of the jogging operation.

In contrast to the normal movement instructions and similarly to the continuous jogging ones, a keep alive call is required via continue_jogging() of the JoggingHandle to continue the execution. This way, it is guaranteed, that the jogging stops if a user input is removed or the application crashes or loses connection.

jogging_handle = robot.jog_linear_v(HOME)

start_time = time.time()
while (
    time.time() - start_time < duration_s
    and not jogging_handle.is_done()
):
    jogging_handle.continue_jogging()
    time.sleep(throttling_time_s)

jogging_handle.result()

As shown above, the JoggingHandle can furthermore be used similarly to the Future of other instructions to observe the overall result of the operation with result(). The JoggingHandle has a positive result if the desired pose is reached. It will raise if there was an exception, e.g. a robot error. Missing the keep alive call with continue_jogging() will also abort the overall instruction and raise an exception once result() is called.

Calling continue_jogging() should have a cool down period as calling without throttling causes undesired side effects and will therefore raise an error.

Full Example of Performing Jogging

The following example shows a simple application in which the jogging methods are used:

Definition of the Jogging Methods

The continuous jogging in joint space is defined in the JogJointVictorTrait:

The continuous jogging in Cartesian space is defined in the JogTcpVictorTrait:

The jogging in joint space is defined in the JogPTPVictorTrait:

The jogging in Cartesian space is defined in the JogLinearVictorTrait: