Ask Your Question

ROS Battery Status

asked 2017-02-16 17:08:11 -0600

minshikk gravatar image


Last December, my team and I participated in the first Maritime RobotX Challenge is an international team competition uniquely designed to evolve into a multi-platform competition to include maritime, aerial and submersible tasks to broaden students’ exposure to robotics applications and technologies. Our team utilized the ROS for some tasks, such as Simultaneous Localization and Mapping (SLAM), Path Planning, and Color Recognition. I am a power system lead of the team, and I have been trying to program in ROS to check the status of our lead acid (standard car) batteries as well as some Lithium Ion battery packs. Unfortunately, none of the team members knows how to approach to this problem. Please help!

edit retag flag offensive close merge delete


Duplicate of #254900

How about using the diagnostics packages? You publish a diagnostic message with the current battery value.

Humpelstilzchen gravatar image Humpelstilzchen  ( 2017-02-17 02:45:12 -0600 )edit
Tav_PG gravatar image Tav_PG  ( 2019-09-11 21:23:28 -0600 )edit

1 Answer

Sort by » oldest newest most voted

answered 2017-02-17 15:40:59 -0600

ahendrix gravatar image

There's a pretty substantial gap between writing software and checking the state of your batteries, and you'll need support from your hardware to cross that gap.

At the most basic level, battery monitoring is generally done by measuring the battery voltage, measuring and integrating the current through the battery, or both. This is an entire field of study with chemistry and is a bit too broad to cover here, but it's important to remember that the relationship between battery capacity and voltage can be highly non-linear depending on your battery chemistry.

I'd suggest that you buy (or possibly build) hardware that can measure the SOC (state of charge) of your batteries, and then connect that hardware to your computer and write a ROS node that translates that data into a sensor_msgs/BatteryState message. I believe there are dashboard widgets that can consume and display this message in a reasonable way.

P.S. - your question makes reference to a demo, but doesn't link to it. ROS is a very broad community, and most of us aren't familiar with all of the demos, so a link would be helpful.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2017-02-16 17:08:11 -0600

Seen: 1,195 times

Last updated: Feb 17 '17