Skip to content

Stop Joint Motion

SUMMARY

Stop Joint Motion decelerates the robot and brings any active joint-space motion to a complete stop.

This skill is the safe and controlled way to interrupt a joint move launched with asynchronous=True.

SUPPORTED ROBOTS

Currently supported only on Universal Robots.

UNITS

stopping_speed in deg/s² (deceleration magnitude).

The Skill

python
robot.stop_joint_motion(stopping_speed=0.5)

The Code

Safety first!

A real robot will faithfully do whatever you ask of it - so please take a moment to clear the workspace, keep an E-Stop within reach, and be ready to disconnect.

Operating real hardware is at your own risk.

Example: Stop Joint Motion Mid-Move

Launch an asynchronous joint move, wait briefly, then stop the robot before it reaches the target.

python
"""
Stop Joint Motion example for the Synapse SDK.

Commands an asynchronous joint move and interrupts it mid-trajectory
with ``stop_joint_motion``. ``stopping_speed`` controls the deceleration
profile (deg/s).

Currently supported only for Universal Robots (UR10e).

Usage:
    python stop_joint_motion.py --ip <ROBOT_IP>
"""

import argparse
import time
from loguru import logger

from telekinesis.synapse.robots.manipulators import universal_robots


def main(robot_ip: str):
    """Start an async joint move and interrupt it with stop_joint_motion."""

    # Create robot instance
    robot = universal_robots.UniversalRobotsUR10E()

    # Connect to the robot
    robot.connect(ip=robot_ip)

    # Get initial joint positions [deg]
    initial_joint_positions = robot.get_joint_positions()

    # Asynchronous +20 deg move on joint 0
    target_joint_positions = initial_joint_positions[:]
    target_joint_positions[0] += 20
    robot.set_joint_positions(
        joint_positions=target_joint_positions,
        speed=60,
        acceleration=80,
        asynchronous=True,
    )

    # Let the move run briefly, then interrupt it
    time.sleep(0.3)
    robot.stop_joint_motion(stopping_speed=30)
    logger.info("Stopped joint motion.")

    # Disconnect
    robot.disconnect()


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="UR robot stop joint motion example")
    parser.add_argument("--ip", type=str, required=True, help="IP address of the UR robot")
    args = parser.parse_args()

    main(args.ip)

The Explanation of the Code

stop_joint_motion sends a deceleration command to the robot controller, smoothly bringing any ongoing joint-space move to a halt. stopping_speed is expressed in deg/s - lower values produce gentler, longer stops; higher values produce faster, shorter stops.

How to Tune the Parameters

ParameterTypeDefaultDescription
stopping_speedfloat0.5Deceleration target speed in deg/s.

Return Value

TypeDescription
NoneReturns after the stop command is sent.

Where to Use the Skill

  • Interrupt asynchronous joint moves - Stop a set_joint_positions or set_cartesian_pose_in_joint_space call launched with asynchronous=True
  • Safety-triggered halt - Stop joint motion immediately when a safety condition is detected

When Not to Use the Skill

Do not use Stop Joint Motion when:

  • The active motion is Cartesian-linear - use Stop Cartesian Motion instead
  • The motion is already synchronous - synchronous calls block until completion; there is no motion to interrupt