## For instruction on writing tutorials ## http://www.ros.org/wiki/WritingTutorials #################################### ##FILL ME IN #################################### ## for a custom note with links: ## note = ## for the canned note of "This tutorial assumes that you have completed the previous tutorials:" just add the links ## note.0= ## descriptive title for the tutorial ## title = Create Odometry and Gyro Calibration ## multi-line description to be displayed in search ## description = /!\ This is only necessary if you have a Create base. The Kobuki comes with a factory calibrated gyro. This will show you how to calibrate or test the calibration of a !TurtleBot which is highly recommended when running any navigation based application. ## the next tutorial description (optional) ## next = ## links to next tutorial (optional) ## next.0.link= ## next.1.link= ## what level user is this tutorial for ## level= BeginnerCategory ## keywords = ## TurtleBotGettingStartedCategory #################################### <> <> <> == Setup == {{{#!wiki red/solid '''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 ([[http://store.iheartengineering.com/ihe-0200-0000-fa00.html|example]]). Some common ones are: || '''Chip''' || '''Setting''' || || ADXRS613 || 150 || || ADXRS652 || 250 || This link may help: [[http://www.alldatasheet.com/view.jsp?Searchword=ADXRS6|http://www.alldatasheet.com/view.jsp?Searchword=ADXRS6]] Set the gyro_measurement_range value '''before you run calibration''' by using rqt_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. . {{attachment:calibration1.JPG||width="45%"}} {{attachment:calibration2.JPG||width="45%"}} == Execution == This assumes you have already [[turtlebot_bringup/Tutorials/indigo/TurtleBot Bringup|started the robot]] Now ssh <> into the !TurtleBot and run the calibration routine: . {{{#!wiki seesaw sshhelp <><
> }}} {{{ roslaunch turtlebot_calibration calibrate.launch }}} Turtlebot will perform a number of calibration spins. According to [[http://answers.ros.org/question/30990/turtlebot_calibration-isnt-working-as-expected/?answer=31045#post-id-31045|this note from Tully Foote]], '''the calibration routine should turn 720° the first time then 360° the following times.''' Each "time" referred to here is one execution of the calibration routine, where each routine begins with "`Aligning base with wall`" and ends with IMU and odom error output. The full calibrate.launch task contains 4 such routines (to gain a better understanding of what exactly is supposed to happen during calibration, you can read the source code at `/lib/turtlebot_calibration/calibrate.py`). When it finishes, you'll see a print on the screen like this (and I'm not yet sure if you should expect similar numbers or not): . {{{ [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.''' * Alternatively, you can try adjusting the gyro parameter as suggested in [[http://answers.ros.org/question/12121/turtlebot-calibration-returns-absolute-parameters-not-multipliers/?answer=18651#post-id-18651|this post]]. Since there is no description here of exactly what the calibration routine is doing, I don't know what is the correct way to address these kinds of issues. == Results == 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 [[http://answers.ros.org/question/2647/gyro-and-odometry-calibration-not-effective?answer=4319#4319|this QA]] and [[http://answers.ros.org/question/3088/turtlebot-calibration-returns-absolute-parameters|this QA]]). After running the calibration set the parameters to the old value multiplied by the correction. The two parameters are: * turtlebot_node/gyro_scale_correction * turtlebot_node/odom_angular_scale_correction For a single run you can set the parameters using dynamic_reconfigure: {{{ rosrun rqt_reconfigure rqt_reconfigure }}} Then select the turtlebot_node and set the parameters. '''You must use Dynamic Reconfigure or else `turtlebot_node` will not pick up the changes. Using `rosparam set` is not enough.''' (You could also restart `turtlebot_node` after each calibration, but this requires changing the parameters in the bringup launch file.) Return to the calibration step and repeat the process until both multipliers are close to 1. If calibration is not working correctly, then the numbers may never converge. It is hard to say whether the process is diverging or not, because I've not seen anyone give any guidelines as to what are reasonable values to expect for these parameters. '''If the process starts driving your gyro correction to 0 you should probably suspect that something is wrong.''' Once both correction parameters have converged to stable values, '''add the following with the values you received to the turtlebot_bringup/minimal.launch file to use these parameters in the future'''(See http://answers.ros.org/question/217629/calibrating-turtlebotcreate-can-not-find-turtlebotlaunch/): {{{ value="some numerical value that you got"/> value="some numerical value that you got"/> }}} == What Next? == [[turtlebot/Tutorials/indigo/Visualisation|Visualisation]] or return to the [[Robots/TurtleBot?distro=indigo|TurtleBot main page]]. ## AUTOGENERATED DO NOT DELETE ## TutorialCategory ## FILL IN THE STACK TUTORIAL CATEGORY HERE