get_health¶
Runs at once Any mode Open to every client
Return the robot's health summary, one level per part. The robot judges each of its parts from its counters and readings, as the dashboard's Health card shows them, and returns one line per part. It first watches its counters advance for 50 ms, so the call takes a little longer than other reads. It moves nothing.
A part's level is "OK", "WARN", "ERROR", or "STALE" when the part's heartbeat has stopped and its data is old.
Syntax¶
Arguments¶
None.
Returns¶
dict
A dict: level (the most serious part's level; "STALE" counts above "ERROR"), time (when it was judged, in seconds since 1970, UTC) and components, one dict per part: name, level, summary (one line saying why) and values (the numbers it was judged on; each part's are in the Status fields reference). The parts, in this order: "control loop", "memory lock", "CAN", "drives", "gripper" (with a CAN gripper only), "errors", "homing", "executor", "self-collision worker", "recorder", "processes", "disk", "memory", "CPU temperature" and "clock".
Examples¶
health = robot.get_health()
health["level"]
[c["summary"] for c in health["components"] if c["level"] != "OK"]
Usage restrictions never refused
This command runs at once; it is not queued. The robot accepts it in any mode and state, from every client.
It never answers with an error code.
In Python, the call raises:
RobotTimeout: The robot did not answer within 5 s.RobotConnectionError: The client is not connected.
If the connection drops while the call waits for the robot's answer, it raises CommandRejected with the code CONNECTION_LOST (DISCONNECTED after disconnect()); while it waits for the robot's status, RobotConnectionError.
Like every immediate command, it also answers BAD_ARGS when a raw client sends a value the robot cannot read at all, and INTERNAL when it fails inside the robot.
Protocol¶
A client that does not use robotclient sends this over the TCP command protocol (port 29000) for the example above: