Skip to content

Get Cartesian Pose

SUMMARY

Get Cartesian Pose returns the Tool Center Point (TCP) pose as [x, y, z, rx, ry, rz] in the robot base frame - position in meters, orientation as Euler XYZ in degrees.

Reads from the manipulator state - live values when connected, the last commanded TCP pose offline (cached by set_cartesian_pose, or FK-derived from the default joint configuration at startup).

SUPPORTED ROBOTS

Available on all supported manipulators in offline mode. Live hardware readings are currently supported only on Universal Robots.

UNITS

Returns TCP pose [x, y, z, rx, ry, rz] - translation in meters, orientation in Euler XYZ degrees.

The Skill

python
pose = robot.get_cartesian_pose()

The Code

python
"""
Read TCP Cartesian pose example for the Synapse SDK.

Returns the TCP pose ``[x, y, z (m), rx, ry, rz (deg)]``. With ``--ip``,
reads live hardware state. Without ``--ip``, reads from the internal
commanded cache (no connection made) and logs a warning.

Illustrated using Universal Robots (UR10e), supported on all robots.

Usage:
    python get_cartesian_pose.py [--ip <ROBOT_IP>]
"""

import argparse
from loguru import logger

from telekinesis.synapse.robots.manipulators import universal_robots


def main(ip: str | None = None):
    """Log the current TCP pose [m, deg]."""

    robot = universal_robots.UniversalRobotsUR10E()

    if ip is not None:
        robot.connect(ip=ip)
    else:
        logger.warning(
            "No --ip provided; reading offline commanded-cache state, "
            "not live hardware readings."
        )

    try:
        logger.success(f"tcp_pose [m, deg]: {robot.get_cartesian_pose()}")
    finally:
        if ip is not None:
            robot.disconnect()


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="Read TCP Cartesian pose Synapse example")
    parser.add_argument("--ip", type=str, default=None, help="UR robot IP address (optional)")
    args = parser.parse_args()

    main(ip=args.ip)

The Explanation of the Code

python
from telekinesis.synapse.robots.manipulators import universal_robots

robot = universal_robots.UniversalRobotsUR10E()

Create the robot. UR10e is used here for illustration; the same pattern works for every supported brand.

python
if ip is not None:
    robot.connect(ip=ip)

Connect to the robot at the given IP. When no --ip is passed, no connection is made and the getter returns from the offline commanded-cache instead of live hardware.

python
logger.success(f"tcp_pose [m, deg]: {robot.get_cartesian_pose()}")

Read the TCP pose as [x, y, z, rx, ry, rz]. When connected, this is the live controller value; offline it returns the last commanded pose (FK-derived from the default joint configuration at startup, or whatever set_cartesian_pose last cached).

python
finally:
    if ip is not None:
        robot.disconnect()

Always release the controller link in a finally block so a failure mid-read still cleans up the connection.

Return Value

TypeDescription
list[float]TCP pose [x, y, z, rx, ry, rz] in the robot base frame. Position in meters, orientation as Euler XYZ in degrees.

Where to Use the Skill

  • Relative Cartesian moves - Read the current TCP pose and apply an offset before calling set_cartesian_pose.
  • Pose logging - Record the TCP pose at key checkpoints in an automation sequence.
  • Grasp verification - Confirm the TCP is at the expected approach pose before closing the gripper.

When Not to Use the Skill