ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

how can I use sensor_msgs/BatteryState

asked 2017-07-10 08:04:45 -0500

emna gravatar image

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-07-10 08:50:26 -0500

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 .

edit flag offensive delete link more

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?

emna gravatar image emna  ( 2017-07-10 09:03:28 -0500 )edit

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.

jeanpolochon gravatar image jeanpolochon  ( 2017-07-10 09:22:36 -0500 )edit

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

jeanpolochon gravatar image jeanpolochon  ( 2017-07-11 04:29:48 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2017-07-10 08:04:45 -0500

Seen: 1,837 times

Last updated: Jul 10 '17