Skip to content

Get Robot Status

SUMMARY

Get Robot Status returns the robot status as a brand-specific bitmask or integer code.

UNITS

Returns a string mapped from the controller's status bitmask (no units).

The Skill

python
status = robot.get_robot_status()

The Code

Example: Read and Log Robot Status

Connect to the robot and read its current status bitmask.

python
"""
Logs the controller's high-level robot status flags.

Supports Universal Robots (UR).

Usage:
    python get_robot_status.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 robot status."""

    #===================== Create Robot ==========================================
    robot = universal_robots.UniversalRobotsUR10E(name='UR10e')

    try:
        #===================== Connect Robot ==========================================
        if ip:
            robot.connect(ip=ip)

        # ==================== Run Skill ============================================
        logger.success(f"Robot status: {robot.get_robot_status()}")
    except (ConnectionError, OSError) as e:
        logger.error(f"Error occurred: {e}")
    finally:
        robot.disconnect()
        robot.shutdown()


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="Read robot status Synapse example")
    parser.add_argument("--ip", type=str, default=None,
                         help="UR robot IP address for real hardware, e.g. 192.168.1.100")
    args = parser.parse_args()

    main(ip=args.ip)

Running the Example

bash
python get_robot_status.py --ip 192.168.1.100

For all options:

bash
python get_robot_status.py --help

Parameter Configuration

This skill takes no input parameters.

Returns

TypeDescription
strRobot status as a brand-specific bitmask, decoded to a pipe-separated string of active flags. On Universal Robots the bits map to "POWER_ON", "PROGRAM_RUNNING", "TEACH_BUTTON_PRESSED", and "POWER_BUTTON_PRESSED" (e.g. "POWER_ON|PROGRAM_RUNNING"); returns "NONE" when no bits are set.

Raises

ExceptionCondition
RuntimeErrorThe robot is not connected. Call connect() before reading the status.
NotImplementedErrorCalled on a manipulator brand other than Universal Robots, where this getter is not yet implemented.

Where to Use the Skill

  • Health monitoring - Poll the status bitmask to detect power or program state changes
  • Diagnostics - Log the raw status field alongside other telemetry for post-hoc analysis

When Not to Use the Skill

Do not use Get Robot Status when: