Robotics StackExchange | Archived questions

how can I use sensor_msgs/BatteryState

I have to Display values of : voltage current charge and capacity of my turtlebot (kobuki) in real time. Can you help me please

Asked by emna on 2017-07-10 08:04:45 UTC

Comments

Answers

You can write a simple suscriber ( you can follow this tutorial ) that will suscribe to your battery state topic.

In the callback function you can access and display the voltage (for example) using msg->voltage . All the parameters you can access to are available here .

Asked by jeanpolochon on 2017-07-10 08:50:26 UTC

Comments

thank you for your reply..Can you send me the Corresponding code with python, please...And how can I modify the code to subscribe to the topic using kobuki_msgs..what is the name of the topic?

Asked by emna on 2017-07-10 09:03:28 UTC

You will find how to write a simple suscriber in python here. I don't know the name of your topic but I am pretty sure you can find it using the rostopic list command when your robot is awake.

Asked by jeanpolochon on 2017-07-10 09:22:36 UTC

Does it solve your problem ? If yes please accept the answer so others can also benefit

Asked by jeanpolochon on 2017-07-11 04:29:48 UTC