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).
UNITS
Returns TCP pose [x, y, z, rx, ry, rz] - translation in meters, orientation in Euler XYZ degrees.
The Skill
pose = robot.get_cartesian_pose()The Code
"""
Reads the manipulator's TCP Cartesian pose.
Supports Universal Robots (UR), Epson, virtual, and Isaac Sim.
Usage:
python get_cartesian_pose.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:
"""Log the TCP pose [m, deg]."""
#===================== Create Robot ==========================================
robot = universal_robots.UniversalRobotsUR10E(name='UR10e')
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 ============================================
logger.success(f"tcp_pose [m, deg]: {robot.get_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="Read TCP Cartesian pose Synapse example")
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
python get_cartesian_pose.pypython get_cartesian_pose.py --prim_path /World/ur10epython get_cartesian_pose.py --ip 192.168.1.100For all options:
python get_cartesian_pose.py --helpParameter Configuration
This skill takes no input parameters.
Returns
| Type | Description |
|---|---|
list[float] | TCP pose [x, y, z, rx, ry, rz] in the robot base frame. Position in meters, orientation as Euler XYZ in degrees. |
Raises
get_cartesian_pose reads from robot.state and does not raise under normal use. On Epson, reading live hardware state instead queries the controller directly and can raise RuntimeError if the robot is not connected or the controller command fails.
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
- You need joint angles - use Get Joint Positions instead.
- You need the active TCP speed - use Get TCP Speed instead.