Robot Odometer Calibration
From Waveshare Wiki
JetBot ROS AI Kit Basic Tutorial
- How to Assemble JetBot
- How to Install Jetson Nano Image
- Install Ubuntu Virtual Image
- How to Configure Multi-machine Communication
- Robot Movement Control
- View Node Topics with ROS
- How to Calibrate the Robot Odometer
- How to Enable the Camera Node
- How to Enable the Lidar Node
- JetBot ROS AI Kit Main Page
Introduction
- The robot can output odometer information for learning how far the robot has traveled and how much the robot has turned. However, there may be errors between the odometer and the actual information output by the default program. We can calibrate the odometer by adjusting the parameters so as to realize higher accuracy.
- This step can be skipped if the accuracy requirements are not high for the first time, and the following functions can be realized normally without calibration.
Step 1: Calibrate the Linear Velocity
- The linear velocity calibration startup program has already started the robot chassis node by default, please close the robot chassis node if you have started earlier, and keep the "robot master node" running, otherwise, an error will be prompted after running the command.
- Re-open a terminal in jetson nano and run the following command to start the linear velocity calibration program.
roslaunch jetbot_pro calibrate_linear.launch
- Do not close after opening, otherwise you will not see the calibration option in the virtual machine command box.
- Run the following command on the virtual machine side to start the dynamic parameter adjustment graphical interface. If the above linear velocity calibration program is running normally, you can see the calibrate_linear option.
rosrun rqt_reconfigure rqt_reconfigure
- Among which:
- Test_distance: the test distance, the default is 1m.
- Speed is the linear speed of the robot.
- Tolerance is the error to reach the goal. If the error is too small, it will shake at the target position, otherwise, the error of reaching the target point will be very large.
- odom_linear_scale_correction is the odometer scaling, and the final corrected value is the linear speed calibration parameter.
- Start_test starts robot calibration.
- Put the robot on the ground, mark the robot position, check start_test, the robot starts to move, wait for the robot to stop, and measure the robot movement distance. Record the ratio of the movement distance divided by the target distance, and multiply odom_linear_scale_correction by this ratio as a new parameter. Repeat the test until the actual movement distance is 1m.
- For example, if the movement is set to 1m and the actual operation is 1.2m, the ratio is 1.2, and the odom_linear_scale_correction is updated to 1x1.2, that is, 1.2 to start the test again. If the effect is satisfactory, the linear calibration parameter is 1.2. If the actual movement is 1.1m, then the odom_linear_scale_correction is updated to 1.2* 1.1 is 1.32. Repeat this until you are satisfied with the effect.
- Enter the following command in jetson nano, open the catkin_ws/src/jetbot_pro/launch/jetbot.launch file, and modify the value of linear_correction to the odom_linear_scale_correction calibration parameter obtained from the calibration just now. Start the calibration procedure again to actually walk a distance of 1m.
sudo nano ~/catkin_ws/src/jetbot_pro/launch/jetbot.launch #Modify calibration parameters
Step 2: Angular Velocity Calibration
- Please close the previous linear calibration program first and keep the "Robot Master Node" running, otherwise an error will be prompted when running the command.
- Enter the following command in jetson nano to start the angular velocity calibration program.
roslaunch jetbot_pro calibrate_angular.launch
- Run the following command on the virtual machine to start the dynamic parameter adjustment graphical interface rosrun rqt_reconfigure rqt_reconfigure.
rosrun rqt_reconfigure rqt_reconfigure
- Among which:
- test_angle is the test distance, the default is 360 degrees, that is, one circle.
- speed is the linear speed of the robot.
- tolerance is the error to reach the goal. If the error is too small, it will shake at the target position, otherwise, the error of reaching the target point will be very large.
- odom_linear_scale_correction is the odometer scaling, and the final corrected value is the linear speed calibration parameter.
- start_test starts robot calibration.
- Put the robot on the ground, mark the position of the robot, check start_test, the robot starts to move, wait for the robot to stop, modify the value of odom_angular_scale_correction according to the rotation angle of the robot, and repeat the test until the effect is satisfactory.
- You can open the compass software on your mobile phone and zoom in on the car, so that the actual rotation angle of the car can be accurately measured [pay attention to prevent radar rotation interference].
- Enter the following command in jetson nano to open the catkin_ws/src/jetbot_pro/launch/jetbot.launch file, which saves the calibration parameters. Modify the value of angular_correction to the calibration parameter of odom_angular_scale_correction obtained from the calibration just now.
sudo nano catkin_ws/src/jetbot_pro/launch/jetbot.launch #Modify angular velocity calibration parameters