6、Data calibration

Note: The parameters have been calibrated before the product leaves the factory, and generally do not need to be calibrated.

If you feel that there are large deviation when control car, you need to calibrate [imu], [linear velocity], [angular velocity]; before calibration, please place the robot on a flat ground and do not move the robot.

 

6.1、imu calibration

The error of IMU mainly comes from three parts, including noise (Bias and Noise), scale factor (Scale errors) and axis deviation (Axis misalignments).

Calculate the accelerometer calibration parameters. Because it requires keyboard input, it should be run directly in the terminal, not from the startup file. After receiving the first IMU message, the node will prompt you to keep the IMU in a specific direction, and then press Enter to record the measured value. After completing all 6 directions, the node will calculate the calibration parameters and write them into the specified YAML file. The basic algorithm is based on and similar to the least squares calibration method described in the STMicroelectronics application note. Due to the nature of the algorithm, obtaining a good calibration requires the IMU to perform fairly precise positioning along each of its axes.

6.1.1、Calibration steps

Note: When calibrating, we need ensure that the robot is still.

On the robot system (jetson nano as an example). Open the terminal, enter the start command.

image-20210907103420586

Start calibrate, we need calibrate the 6 axes of imu [X+, X-, Y+, Y-, Z+, Z-] in sequence. Then, click【Enter】key repeatedly until it appears the interface as shown below.

image-20210907103911991

After the calibration is successful, the calibration information is stored in the YAML file. After the calibration is completed, it will exit automatically, as shown below.

image-20210917104450855

View node graph

image-20210906220131737

6.1.2、Related nodes

transbot_node

TopicTypeParsing
/transbot/imusensor_msgs/ImuThe most primitive imu data of the car

do_calib node

/TypeDefaults valueParsing
Subscribedsensor_msgs/Imu/raw_imuOriginal, uncalibrated IMU measurement
~calib_filestring"imu_calib.yaml"The file where the calibration parameters will be written
~measurementsint500Number of measurements collected for each direction
~reference_accelerationdouble9.80665Acceleration of gravity

6.2、Linear speed calibration

Preparation:

Start the robot drive (robot side)

Linear speed calibration (robot side or virtual machine side)

As shown below.

image-20210907110338488

Enable dynamic parameter adjustment (robot side or virtual machine side)

image-20210907110923855

Click the square on the right side of [start_test] to start moving [test_distance]. At this time, observe whether the car really moves [test_distance]. If it is not the adjustment parameter [odom_linear_scale_correction], put the car back to the starting point to continue the test.

After the test, remember the value of [odom_linear_scale_correction] and modify it to the value of the parameter [linear_scale] in bringup.launch.

6.3、Angular velocity calibration

Preparation:

Start the robot drive (robot side)

Angular velocity calibration (robot side or virtual machine side)

As shown below.

image-20210907112259595

Enable dynamic parameter adjustment (robot side or virtual machine side)

image-20210907112806090

Click the square on the right side of [start_test] to start moving the [test_angle] distance. At this time, observe whether the car really moves [test_angle]. If it is not the adjustment parameter [odom_angule_scale_correction], return the car to the starting point to continue the test.

After the test, remember the value of [odom_angule_scale_correction] and modify it to the value of the parameter [angular_scale] in bringup.launch.