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

Revision history [back]

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