Skip to content

latest_status

Runs in the client Sends nothing to the robot

Return the latest status the robot sent, without asking it. The robot checks its state 50 times a second and sends the whole status to every connected client whenever a field changes, and once when a client connects. This returns a copy of the newest one, so it never waits and sends nothing. It is empty until the first status arrives, and after a disconnect it keeps the last values it had. Use get_status() to ask the robot, and wait() to wait until a field changes.

Syntax

robot.latest_status()

Arguments

None.

Returns

dict

The status, a dict. The fields used most: mode (the robot mode, such as "IDLE" or "EXEC"), state ("ENABLED" or "DISABLED"), homed, err (1 while an error is latched), errors (the latched error keys) and error_details (as errors() returns them), control_holder, exec_paused and exec_stopping (1 while a program is paused or brakes for a stop), queue_depth (queued moves not started yet), active_command, motion_aborted (why new moves are refused, or None), recipe, payload (mass in kilograms, com in metres), joint_test, free_joint and hall_check. Every field, with its meaning and unit, is in the Status fields reference.

Examples

robot.latest_status()["mode"]
robot.latest_status()["errors"]

See also