ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
First, have you read the diagnostics wiki ? It states :
The diagnostics toolchain is built around the /diagnostics topic. On this topic, hardware drivers and devices publish diagnostic_msgs/DiagnosticArray messages with the device names, status and specific data points.
If you are able to visualize the battery state with rqt_robot_monitor
then you can access to the battery state from the /diagnostics
topic. This topic receives diagnostic_msgs/DiagnosticArray
which is a header and a list of diagnostic_msgs/DiagnosticStatus
messages (message definition here).
If you want to monitor the battery state you can susbscribe to the /diagnostics
topic, then in the list of the components in the status
attribute of the message search for the one which name is Battery
(or if it's different write the same name as in rqt_robot_monitor
). Once you have found it you can monitor the battery state as desired.
2 | No.2 Revision |
First, have you read the diagnostics wiki ? It states :
The diagnostics toolchain is built around the /diagnostics topic. On this topic, hardware drivers and devices publish diagnostic_msgs/DiagnosticArray messages with the device names, status and specific data points.
If you are able to visualize the battery state with rqt_robot_monitor
then you can access to the battery state from the /diagnostics
topic. This topic receives diagnostic_msgs/DiagnosticArray
which is a header and a list of diagnostic_msgs/DiagnosticStatus
messages (message definition here).
If you want to monitor the battery state you can susbscribe to the /diagnostics
topic, then in the list of the components in the status
attribute of the message search for the one which name is Battery
(or if it's different write the same name as in rqt_robot_monitor
). Once you have found it you can monitor the battery state as desired.
I think the diagnostic aggregator can be useful for you.