On all my prior robots, I have a status script which I like to run that prints out:
- load (uptime)
- memory usage (free -h)
- Processor Temperature
- Clock Frequency
- Throttled Status (temperature or power)
- Battery Level
Everything but the battery info is available from the operating system.
On the Create3 / TurtleBot4 robots which run ROS2 Galactic, I can access the battery info with:
ros2 topic echo /battery_state
but in Galactic there is no “–once” option so the CLI command continues until control-c signaled, preventing simply adding the topic echo to my status script (which I can do in ROS2 Humble).
Do I have to write (and have running)
- a “My_Battery” node
- that subscribes to /battery_state and
- has a service “/state_once”
that I could call from the CLI?
Is there any other way to snatch a single topic on demand (in Galactic)?