Status Node
The Status Node is responsible for monitoring the robot status and delivering telemetry for the robot:
statusnode.py
loading...
During startup this node starts a background thread for monitoring the robot's status. The node also subscribes to the ups-battery-percent event which is used to inform the status node of the battery level of the UPS device.
Battery status is handled by the update_battery method:
Update Battery
loading...
This method simply keeps a track of the batter level percentage.
Monitoring Status
Status is monitored in the background task monitor_status:
Update Battery
loading...
Every 10 seconds, this node builds up SystemStatus which includes:
- Disk Usage
- Memory Usage
- Under Voltage Indicator
- Network Details
- Battery Usage
- CPU Usage
If under voltage is detected, this node raises an alarm event under-voltage-detected. This allows the robot to execute a graceful shutdown.