Welcome to MicroROS V2 Robot Car repository
5. Linear Speed Calibration
Linear Speed Calibration
Linear Speed Calibration1. Course Content2. Preparation3. Calibration Demo4. Write the Calibration Coefficient to the MicroRos Control Board5. Verification Test
1. Course Content
- Use a known-length reference object such as a tape measure to verify the accuracy of the chassis wheel odometry (computed from motor encoder data) and perform linear speed calibration
[!IMPORTANT]
The vehicle has been calibrated at the factory, so no recalibration is needed on first use. If you find that the odometry error is relatively large during subsequent use, refer to this tutorial to perform the calibration
2. Preparation
ros2 launch microros_v2_bringup car_base.launch.py use_camera:=false

3. Calibration Demo
Note: If the odometry data is incorrect, you can press the reset button to restart the vehicle
- Run in the terminal
xxxxxxxxxxros2 run common_demo calibrate_linear --ros-args -p test_distance:=1.5
- The test distance test_distance used here is 1.5 m. After the vehicle stops moving, measure the actual distance traveled

- Enter the measured actual distance into the terminal

- The terminal will automatically calculate the calibration coefficient

[!TIP]
test_distance:=1.5 is a demo example; you can adjust the test distance according to your actual situation
4. Write the Calibration Coefficient to the MicroRos Control Board
- Close the microros_v2_bringup and calibrate_linear terminals started earlier, and double-click the RobotManager application icon on the virtual machine desktop

- On the control board page, fill the calibration coefficient calculated in the previous step into the linear speed coefficient, and click Apply Configuration

5. Verification Test
- Repeat the test
ros2 run common_demo calibrate_linear --ros-args -p test_distance:=1.5again; this time the distance error after movement will be smaller than before calibration