Ask Your Question

Turtlebot unable to check laptop battery/BAT0/state

asked 2012-03-27 19:00:19 -0500

Red24Dog gravatar image

updated 2014-01-28 17:11:46 -0500

ngrennan gravatar image

My laptop (Thinkpad X120e) reports its battery status in proc/acpi/battery/BAT1/ folder (which does have the status file), but NOT in BAT0 that turtlebot expects. How do I either change the Ubuntu environment to use BAT0 or change the minimal.launch script to look in the BAT1?

edit retag flag offensive close merge delete

5 Answers

Sort by ยป oldest newest most voted

answered 2012-04-03 14:53:57 -0500

I had the same problem. Since the EeePC 1215N was discontinued, the Turtlebot now ships from I Heart Robotics with a Lenovo ThinkPad X130e. This laptop's battery shows up in /proc/acpi/battery/BAT1, not BAT0 as is hardcoded into ROS electric's Also, the battery's capacity and charge state is reported in mW instead of mA, so just swapping BAT0 to BAT1 in the script doesn't fix it.

I've uploaded an updated version of electric's that should fix both of these problems:

I use a shell glob to find BAT*, and recognize either mW or mA for battery capacity. This should work with both EeePC and ThinkPad based turtlebots, but I only have the ThinkPad to test with. To use the new script, from your turtlebot:

  1. wget
  2. sudo cp /opt/ros/electric/stacks/turtlebot/turtlebot_node/scripts/
  3. sudo rosmake turtlebot_node
  4. sudo service turtlebot restart
edit flag offensive delete link more


Thanks for the help! I have patchified things and made some adjustments. Please post feedback on the patch to the ticket.

I Heart Robotics gravatar image I Heart Robotics  ( 2012-04-07 10:41:45 -0500 )edit

answered 2012-05-07 13:55:10 -0500

Red24Dog gravatar image

Now upgrading to Fuerte and reading ticket#134 I would appreciate guidance. The file in fuerte /stack appeas to be the "bat0" version and the patch includes the "bat*" text which sucessfully enabled the "bat1" in my x120e. I presume the patch should be applied. How?

edit flag offensive delete link more

answered 2012-04-03 10:15:43 -0500

Red24Dog gravatar image

Tnx. Edited "" in .../scripts folder changing 2 instances of BAT0 to BAT1. It eliminated the error message occurring during the Netbook minimal.launch but the Workstation "turtlebot_dashboard" laptop battery icon is still greyed out (Turtlebot battery status is reported). Is there another instance of BAT0/BAT1 that needs to be edited somewhere?

edit flag offensive delete link more


There's possibly a rule in the battery diagnostic aggregation which might need to be changed.

tfoote gravatar image tfoote  ( 2012-04-03 13:14:13 -0500 )edit

answered 2012-03-29 21:02:41 -0500

tfoote gravatar image

To change the node reporting you will need to edit in turtlebot_node package. A patch to parameterize it would be greatly appreciated.

edit flag offensive delete link more

answered 2012-04-05 14:16:21 -0500

Red24Dog gravatar image

updated 2012-04-10 18:40:09 -0500

This edit did it and Dashboard Laptop battery icon works now with Green icons. One note: In step 3 sudo can't be used, just the "rosmake".

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: 2012-03-27 19:00:19 -0500

Seen: 3,794 times

Last updated: Jan 28 '14