Skip to content

Set Cartesian Pose in Joint Space

SUMMARY

Set Cartesian Pose in Joint Space drives the TCP to a target Cartesian pose [x, y, z, rx, ry, rz] (meters + Euler XYZ degrees) using a trajectory that is linear in joint space.

UNITS

cartesian_pose is [x, y, z, rx, ry, rz] in meters and Euler XYZ degrees. speed in deg/s, acceleration in deg/s² (joint-space limits drive the interpolation).

OFFLINE

To run set_cartesian_pose_in_joint_space purely on the kinematic model and visualize the result in Rerun, follow the Synapse Quickstart - one offline example is shipped for every supported brand.

The Skill

python
robot.set_cartesian_pose_in_joint_space(
    cartesian_pose=target_pose,
    speed=60,
    acceleration=80,
    asynchronous=False,
)

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.

Drive a real UR10e to an absolute Cartesian pose via joint-space interpolation. The synchronous call blocks until the TCP reaches the target.

python
"""
Move the TCP to a target pose along a joint-space-linear trajectory.

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

Usage:
    python set_cartesian_pose_in_joint_space.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:
    """Move the TCP to a target pose along a joint-space-linear trajectory."""

    #===================== 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)

        #===================== Prepare Target ==========================================
        current_cartesian_pose = robot.get_cartesian_pose()
        target_cartesian_pose = current_cartesian_pose.copy()
        target_cartesian_pose[2] += 0.1  # Move 10 cm up in Z

        # ==================== Run Skill ============================================
        robot.set_cartesian_pose_in_joint_space(
            cartesian_pose=target_cartesian_pose,
            speed=60,
            acceleration=80,
        )
        logger.info(f"Moved to target Cartesian pose: {target_cartesian_pose}")
    except (ConnectionError, OSError) as e:
        logger.error(f"Error occurred: {e}")
    finally:
        robot.disconnect()
        robot.shutdown()


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="Move the TCP to a target pose along a joint-space trajectory")
    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_cartesian_pose_in_joint_space.py
bash
python set_cartesian_pose_in_joint_space.py --prim_path /World/ur10e
bash
python set_cartesian_pose_in_joint_space.py --ip 192.168.1.100

For all options:

bash
python set_cartesian_pose_in_joint_space.py --help

Parameter Configuration

ParameterTypeDefaultDescription
cartesian_poselist[float] | np.ndarrayrequiredTarget pose [x, y, z, rx, ry, rz]. Position in meters; orientation as Euler XYZ in degrees.
speedfloat60Leading joint speed in deg/s. Start conservative (20-30) when validating; raise after the path is verified.
accelerationfloat80Leading joint acceleration in deg/s². Tune in tandem with speed.
asynchronousboolFalseIf True, the call returns immediately. Use Stop Joint Motion to interrupt the move before it completes.

Returns

TypeDescription
NoneBlocks until the move completes when asynchronous=False; returns immediately when asynchronous=True. Read robot.get_cartesian_pose() or robot.get_joint_positions() afterward to confirm the result.

Raises

ExceptionCondition
TypeErrorcartesian_pose, speed, acceleration, or asynchronous is not the expected type
ValueErrorcartesian_pose is not a 1D 6-element [x, y, z, rx, ry, rz] vector
NotImplementedErrorConnected to real hardware on a brand that does not implement joint-space Cartesian motion (currently only Universal Robots does)
RuntimeErrorThe hardware backend rejects or fails the move during execution - e.g. the target pose is near a kinematic singularity or outside the reachable workspace

How to Tune the Parameters

speed and acceleration are expressed in joint units (deg/s, deg/s²) even though the target is a Cartesian pose - they bound the leading joint's motion, not the TCP's Cartesian speed. Start conservative (20-30 deg/s) while validating a new trajectory, then raise once the resulting joint-space path has been confirmed safe. Because the trajectory is joint-interpolated, the TCP path is smoother through large reorientations than Set Cartesian Pose but does not trace a straight line - use asynchronous=True together with Stop Joint Motion when the move needs to be interruptible mid-trajectory.

Where to Use the Skill

  • Large reorientations - Joint-space interpolation avoids the singularities and large joint accelerations that can occur with Cartesian-linear moves.
  • Homing to a Cartesian pose - Return to a known safe pose without precomputing the joint configuration.
  • State transitions - Move between operating poses efficiently when the TCP path shape is not critical.

When Not to Use the Skill

  • A straight TCP path is required - joint interpolation does not produce a linear tool path; use Set Cartesian Pose instead.
  • Precise Cartesian speed control is needed - use Set Cartesian Pose, which commands TCP speed directly.
  • You already have the target in joint space - use Set Joint Positions to skip the internal IK solve.