Skip to content

Get Safety Status Bits

SUMMARY

Get Safety Status Bits returns the current safety system state as a packed integer bitmask. Each bit corresponds to a specific safety state. Use bitwise operations to check individual safety conditions.

This is the most granular way to inspect the safety system state programmatically, giving more detail than the higher-level Get Safety Mode skill.

SUPPORTED ROBOTS

This skill is currently supported on Universal Robots only. Calling this method on other robot brands will raise a NotImplementedError.

The Skill

python
bits = robot.get_safety_status_bits()

The Code

Example: Read and Decode the Safety Status Bitmask

Connect to the robot, read the safety status bits, and log them.

python
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)

bits = robot.get_safety_status_bits()
logger.info(f"Safety status bits: {bits:#013b}")

# Check for protective stop (bit 2)
protective_stop = bool(bits & (1 << 2))
logger.info(f"Protective stop active: {protective_stop}")

# Disconnect
robot.disconnect()

The Explanation of the Code

get_safety_status_bits returns the safety system status as a bitmask. The following bit assignments apply:

BitSafety Condition
0Normal mode active
1Reduced mode active
2Protective stopped
3Recovery mode active
4Safeguard stopped
5System emergency stop
6Robot emergency stop
7Emergency stop
8Violation
9Fault
10Stopped due to safety

Use bits & (1 << n) to test a specific condition.

How to Tune the Parameters

This skill takes no parameters.

Return Value

TypeDescription
intSafety system status bitmask. Bits 0–10 correspond to individual safety states.

Where to Use the Skill

  • Safety monitoring — Log full safety state in each control cycle for post-hoc diagnostics
  • Condition-specific handling — Detect individual safety states and trigger appropriate recovery procedures

When Not to Use the Skill

Do not use Get Safety Status Bits when:

  • A high-level summary is sufficient — use Get Safety Mode for a simpler integer safety mode code