Skip to content

Get Robot Mode

SUMMARY

Get Robot Mode returns the current operating mode of the robot as a brand-specific integer code.

On Universal Robots, this corresponds to the RTDE robot_mode field (e.g. 7 = running, 5 = idle).

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
mode = robot.get_robot_mode()

The Code

Example: Read and Log Robot Mode

Connect to the robot and read its current mode.

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)

mode = robot.get_robot_mode()
logger.success(f"Robot mode: {mode}")

# Disconnect
robot.disconnect()

The Explanation of the Code

get_robot_mode reads the robot_mode field from the controller's RTDE data stream. On Universal Robots, the integer maps to a documented mode table (e.g., 7 = RUNNING, 5 = IDLE, 0 = DISCONNECTED). Consult the UR RTDE Interface documentation for the full table.

How to Tune the Parameters

This skill takes no input parameters.

Return Value

TypeDescription
strCurrent robot mode as a brand-specific integer code (returned as a string).

Where to Use the Skill

  • Pre-motion checks — Verify the robot is in RUNNING mode before commanding motion
  • Diagnostics — Log the mode when diagnosing unexpected stops or state transitions
  • Conditional logic — Branch program flow based on the current robot mode

When Not to Use the Skill

Do not use Get Robot Mode when: