Skip to content

Set Joint Acceleration ​

SUMMARY

Set Joint Acceleration sets the default joint acceleration used by motions that are called without an explicit acceleration. The initial value is 80 deg/s².

UNITS

acceleration is in deg/s² of the leading axis.

The Skill ​

python
robot.set_joint_acceleration(40.0)

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.

python
"""
Set the default joint acceleration, then make a joint move that uses it.

Supports Universal Robots (UR), Epson, virtual, and Isaac Sim.

Usage:
    python set_joint_acceleration.py [--ip <ROBOT_IP>] [--prim_path <PRIM_PATH>]
"""

import argparse

from loguru import logger

from telekinesis.synapse.robots.manipulators import universal_robots


def main(ip: str | None, prim_path: str | None) -> None:
    """Set the default joint acceleration and move with it."""

    #===================== Create Robot ==========================================
    robot = universal_robots.UniversalRobotsUR10E(name='UR10e')

    # ==================== Visualization (Optional) =============================
    # Live: subscribes to the robot's state topic and redraws as it moves.
    robot.visualize_rerun(live=True)

    try:
        #===================== Connect Robot ==========================================
        if ip:
            robot.connect(ip=ip)
        elif prim_path:
            robot.connect(simulation_prim_path=prim_path)
            robot.set_joint_positions(robot.default_joint_configuration)

        # ==================== Run Skill ============================================
        # Joint acceleration [deg/s^2] for joint moves called without one
        robot.set_joint_acceleration(acceleration=40)
        logger.info("Default joint acceleration set to 40 deg/s^2.")

        #===================== Move With Defaults ==========================================
        target_joint_positions = list(robot.get_joint_positions())
        target_joint_positions[0] += 20  # +20 deg on joint 0

        # Called without speed/acceleration, so the defaults set above are used
        robot.set_joint_positions(joint_positions=target_joint_positions)
        logger.success(f"Moved to target joint positions: {target_joint_positions}")
    except (ConnectionError, OSError) as e:
        logger.error(f"Error occurred: {e}")
    finally:
        robot.disconnect()
        robot.shutdown()


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="Set the default joint acceleration and move with it.")
    parser.add_argument("--ip", type=str, default=None,
                         help="UR robot IP address for real hardware, e.g. 192.168.1.100")
    parser.add_argument("--prim_path", type=str, default=None,
                         help='Isaac Sim articulation prim path, e.g. "/World/ur10e"')
    args = parser.parse_args()

    main(ip=args.ip, prim_path=args.prim_path)

Running the Example ​

bash
python set_joint_acceleration.py
bash
python set_joint_acceleration.py --prim_path /World/ur10e
bash
python set_joint_acceleration.py --ip 192.168.1.100

For all options:

bash
python set_joint_acceleration.py --help

Parameter Configuration ​

ParameterTypeDefaultDescription
accelerationfloatrequiredNew default joint acceleration in deg/s². Must be finite and positive.

Returns ​

TypeDescription
NoneThe default is stored on the robot and used by Set Joint Positions and Set Cartesian Pose in Joint Space.

Raises ​

ExceptionCondition
TypeErroracceleration is not a number
ValueErroracceleration is not finite and positive

How to Tune the Parameters ​

Applies to Set Joint Positions and Set Cartesian Pose in Joint Space when they are called without an explicit acceleration; an explicit value passed to the motion still wins. Start conservatively while validating a new path, then raise the default once the motion is confirmed clear.

Where to Use the Skill ​

  • Program-wide defaults - Set the speed once instead of passing it to every move.
  • Commissioning - Slow everything down while testing a new cell.

When Not to Use the Skill ​