Robobot sensor calibration
Back to Robobot B.
Back to Robobot software description
Odometry
For odometry, there are primarily two values:
- Driving wheel diameter.
- Distance between driving wheels (wheelbase).
Both values can be measured, but the accuracy can be increased by a test. The tires flatten a bit under the weight of the robot, and the width of the tires makes the distance between the driving wheels a bit uncertain.
See Robobot level 1 for a description of odometry.
Wheel diameter
- Make a mission to drive 1m and then stop. Plan20 is (pt) just that.
- Make the plan active by changing "run" to "true" in the configuration file:
$ cd ~/svn/robobot/raubase/build $ nano robot.ini
- Ensure [plan20] has "run" = "true", and
- Ensure [pose] hase "log" = "true", something like:
[pose] gear = 19.0 wheeldiameter = 0.16 enctickperrev = 64 wheelbase = 0.25 log = true print = false [plan20] run = true log = true print = true
Measure the driven distance and compare with the distance in the pose log log_pose.txt in the log directory
$ ./raubase # UService:: created directory log_20240101_160442.747/ # STeensy::setup: took 0.010084 sec to open to Teensy # SState::decode: asked for new name (idi -> name) # UService::setup - waited 0.060424 sec for initial Teensy setup # SpyVision:: disabled in robot.ini # UService::setup - waited 0.078501 sec for full setup # UService:: setup of all modules finished OK. 1704121030.8130 10 % Plan20 started 1704121030.8131 10 % forward at 0.3m/s 1704121030.8132 11 % state start 1704121034.2158 11 % Plan20 finished # --------- terminating ----------- # UService:: configuration saved to robot.ini
Note that the created log-directory is printed on the console, here log_20240101_160442.747
Look in the log_pose.txt at the end, to see what the robot thinks.:
$ cd log_20240101_160442.747 $ nano log_pose.txt
% Pose and velocity (log_20240101_160442.747/log_pose.txt) % 1 Time (sec) % 2,3 Velocity left, right (m/s) % 4 Robot velocity (m/s) % 5 Turnrate (rad/s) % 6 Turn radius (m) % 7,8 Position x,y (m) % 9 heading (rad) % 10 Driven distance (m) - signed % 11 Turned angle (rad) - signed 1704121482.8235 0.1402 0.1403 0.0000 0.00000 0.000 0.000 0.000 0.0000 0.000 0.0000 1704121482.8316 0.0348 0.0348 0.0000 0.00000 0.000 0.000 0.000 0.0000 0.000 0.0000 1704121482.8397 -0.0200 0.0000 -0.0100 0.08214 -0.122 -0.000 -0.000 0.0016 -0.000 0.0016 1704121482.8477 0.0469 0.0000 0.0235 -0.19302 -0.122 0.000 0.000 0.0000 0.000 0.0000 1704121482.8552 0.0000 0.1514 0.0757 0.62315 0.122 0.001 0.000 0.0047 0.001 0.0047 ... 1704121487.1912 0.0005 0.0005 0.0000 0.00000 0.000 1.016 -0.000 0.0016 1.016 0.0016 1704121487.2001 0.0005 0.0005 0.0000 0.00000 0.000 1.016 -0.000 0.0016 1.016 0.0016 1704121487.2075 0.0005 0.0005 0.0000 0.00000 0.000 1.016 -0.000 0.0016 1.016 0.0016 1704121487.2155 0.0004 0.0005 0.0000 0.00000 0.000 1.016 -0.000 0.0016 1.016 0.0016 1704121487.2241 0.0004 0.0004 0.0000 0.00000 0.000 1.016 -0.000 0.0016 1.016 0.0016 1704121487.2318 0.0004 0.0004 0.0000 0.00000 0.000 1.016 -0.000 0.0016 1.016 0.0016
Column 10 (driven distance) shows 1.016 m, i.e. the actual driven distance should be 101.6 cm.
If this is not the case, then adjust the driving wheel diameter "wheeldiameter" in the robot.ini file.
Wheel base
Make a mission that turns or makes a square.
Plan 21 drives for 1m and then repeats turning 90deg CCV and drive for another meter. The last leg of the mission should be parallel with the first meter.
If this is not the case, then adjust the wheel base, the "wheelbase" in the robot.ini file.
Line sensor
See Line sensor for details.
Distance sensor
The distance sensor (or sensors) can be calibrated using