|It is appreciated that problems/questions regarding this tutorial are asked on answers.ros.org. Don't forget to include in your question the link to this page, versions of your OS & ROS, and also add appropriate tags.|
TurtleBot Odometry and Gyro CalibrationDescription: This will show you how to calibrate or test the calibration of a TurtleBot which is highly recommended when running any navigation based application. This is only necessary if you have a Create base. The Kobuki comes with a factory calibrated gyro.
Tutorial Level: BEGINNER
Next Tutorial: SLAM Map Building with TurtleBot
Note: Determine which gyro your TurtleBot is using, TurtleBots made by different manufacturers have gyros with different measurement rates. You will need to look at the small chip on the right side of the turtlebot power/sensor board and find its part number (example). Some common ones are:
This link may help: http://www.alldatasheet.com/view.jsp?Searchword=ADXRS6
Set the gyro_measurement_range value before you run calibration by using dynamic_reconfigure or editing the configuration file as explained in the results section below.
First position TurtleBot at the center of a long straight wall (at least 2 meters long), facing towards the wall, at about 30 cm away from the wall.
This assumes you have already started the robot
Now ssh (ssh help) into the TurtleBot and run the calibration routine:
To ssh in to a TurtleBot from a workstation computer:
determine the IP_OF_TURTLEBOT by using ifconfig (Need more help)
To determine a computer's IP address and network interface in linux:
You will see something like:
lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:6658055 errors:0 dropped:0 overruns:0 frame:0 TX packets:6658055 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:587372914 (587.3 MB) TX bytes:587372914 (587.3 MB) wlan1 Link encap:Ethernet HWaddr 48:5d:60:75:58:90 inet addr:10.0.129.17 Bcast:10.0.129.255 Mask:255.255.254.0 inet6 addr: fe80::4a5d:60ff:fe75:5890/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:101983 errors:0 dropped:0 overruns:0 frame:0 TX packets:37244 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:49326141 (49.3 MB) TX bytes:7588044 (7.5 MB)
the network interface for the wireless card is wlan1
the IP address of the computer is 10.0.129.17
use ssh to connect to the TurtleBot
roslaunch turtlebot_calibration calibrate.launch
Turtlebot will perform a number of calibration spins. When it finishes, you'll see a print on the screen like this:
[INFO] [WallTime: 1299286750.821002] Multiply the 'turtlebot_node/gyro_scale_correction' parameter with 1.002262 [INFO] [WallTime: 1299286750.822427] Multiply the 'turtlebot_node/odom_angular_scale_correction' parameter with 1.000263
If the TurtleBot does not successfully return to facing the wall before executing the next rotation the data will be incorrect. This can be caused by too big of an error in the existing parameters. If it under rotates, increase the odom parameter and retry. If it over rotates, lower the odom_parameter and retry.
The calibration routine will output 2 numbers. The correction for the gyro and the correction for the odometry. The values are factors to multiply with the current parameters to get the best results (see also this QA and this QA).
After running the calibration set the parameters to the old value multiplied by the correction.
The two parameters are:
For a single run you can set the parameters using dynamic_reconfigure:
rosrun dynamic_reconfigure reconfigure_gui
Then select the turtlebot_node and set the parameters.
To persist these parameters between runs it is recommended to edit the turtlebot.launch file in /etc/ros/electric.
sudo emacs -nw turtlebot.launch
Once the .launch file is modified, you need to restart the turtlebot service in order to reflect the change.