Get Safety Mode
SUMMARY
Get Safety Mode returns the current safety state of the robot as a brand-specific integer code.
On Universal Robots, this corresponds to the RTDE safety_mode field (e.g. 1 = normal, 3 = protective stop).
SUPPORTED ROBOTS
This skill is currently supported on Universal Robots only. Calling this method on other robot brands will raise a NotImplementedError.
The Skill
safety_mode = robot.get_safety_mode()The Code
Example: Read and Log Safety Mode
Connect to the robot and read its current safety mode.
from loguru import logger
from telekinesis.synapse.robots.manipulators import universal_robots
robot_ip = "192.168.1.2" # replace with your robot's IP
robot = universal_robots.UniversalRobotsUR10E()
# Connect
robot.connect(ip=robot_ip)
safety_mode = robot.get_safety_mode()
logger.success(f"Safety mode: {safety_mode}")
# Disconnect
robot.disconnect()The Explanation of the Code
get_safety_mode reads the safety_mode field from the RTDE data stream. On Universal Robots the code maps to: 1 = NORMAL, 2 = REDUCED, 3 = PROTECTIVE_STOP, 4 = RECOVERY, 5 = SAFEGUARD_STOP, 6 = SYSTEM_EMERGENCY_STOP, 7 = ROBOT_EMERGENCY_STOP, 8 = VIOLATION, 9 = FAULT. Consult the UR RTDE Interface documentation for the authoritative table.
How to Tune the Parameters
This skill takes no input parameters.
Return Value
| Type | Description |
|---|---|
str | Current safety mode as a brand-specific integer code. |
Where to Use the Skill
- Pre-motion safety checks — Confirm the robot is in NORMAL mode before issuing motion commands
- Fault detection — Poll the safety mode to detect and react to protective stops
- Operator dashboards — Surface the safety state in monitoring UIs
When Not to Use the Skill
Do not use Get Safety Mode when:
- You need the operating mode — use Get Robot Mode instead
- You need a simple boolean — use Is Protective Stopped or Is Emergency Stopped for direct boolean checks

