Get Joint Torques
SUMMARY
Get Joint Torques returns the net torque at each joint after gravity and friction compensation, in N·m, ordered base to wrist. Non-zero values on a stationary robot indicate an externally applied load. Reads from the manipulator state - live values when connected, zero-filled offline.
SUPPORTED ROBOTS
Available on all supported manipulators in offline mode. Live hardware readings are currently supported only on Universal Robots.
UNITS
Returns joint torques in N·m, ordered base to wrist.
The Skill
joint_torques = robot.get_joint_torques()The Code
"""
Read joint torques example for the Synapse SDK.
Returns the manipulator's joint torques [N·m]. 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_joint_torques.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 joint torques [N·m]."""
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"joint_torques [N·m]: {robot.get_joint_torques()}")
finally:
if ip is not None:
robot.disconnect()
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Read joint torques 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
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.
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 (zero-filled) instead of live hardware.
logger.success(f"joint_torques [N·m]: {robot.get_joint_torques()}")Read the net joint torques in N·m, gravity- and friction-compensated, ordered base to wrist. When connected this is the live controller value; offline the cache is zero-filled.
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
| Type | Description |
|---|---|
list[float] | Net joint torques in N·m, one value per joint, ordered base to wrist. Gravity and friction are compensated. Zero-filled offline. |
Where to Use the Skill
- External load monitoring - Detect contact forces or unexpected loads without a dedicated F/T sensor.
- Compliant control - Use torque feedback for admittance or impedance control.
- Collision detection - Trigger a safe stop when a joint torque exceeds a configured threshold.
When Not to Use the Skill
- You need TCP-frame forces - use Get TCP Force for the wrench at the tool center point.

