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

Turtlebot unable to check laptop battery/BAT0/state

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

RobotRoss 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
4

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 laptop_battery.py. 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 laptop_battery.py that should fix both of these problems: http://www.cs.uaf.edu/~olawlor/2012/laptop_battery.py

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 http://www.cs.uaf.edu/~olawlor/2012/laptop_battery.py
  2. sudo cp laptop_battery.py /opt/ros/electric/stacks/turtlebot/turtlebot_node/scripts/laptop_battery.py
  3. sudo rosmake turtlebot_node
  4. sudo service turtlebot restart
edit flag offensive delete link more

Comments

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
0

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

RobotRoss gravatar image

Now upgrading to Fuerte and reading ticket#134 I would appreciate guidance. The laptop_batterry.py 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
0

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

RobotRoss gravatar image

Tnx. Edited "laptop_battery.py" 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

Comments

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
0

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

tfoote gravatar image

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

edit flag offensive delete link more
0

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

RobotRoss 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

Question Tools

1 follower

Stats

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

Seen: 4,117 times

Last updated: Jan 28 '14