Angular velocity calibration

Note: The virtual machine needs to be in the same LAN as the car, and the ROS_DOMAIN_ID needs to be consistent. You can check [Must read before use] to set the IP and ROS_DOMAIN_ID on the board.

1、Program function description

The car connects to the agent, runs the program, and adjusts the parameters here through the dynamic parameter adjuster to calibrate the car's angular velocity. The intuitive reflection of the calibrated angular speed is to give the car a command to rotate 360 degrees (one revolution) to see how many degrees it actually rotates and whether it is within the error range.

2、Start and connect to the agent

Taking the supporting virtual machine as an example, enter the following command to start the agent:

image-20240102115557215

Then, turn on the car switch and wait for the car to connect to the agent. The connection is successful, as shown in the figure below.

image-20231218111619630

3、starting program

First, start the car's underlying data processing program. This program will release the TF transformation of odom->base_footprint. With this TF change, you can calculate "how many degrees the car has turned" and and enter the following command in the terminal

image-20231218111726202

Then, start the car angular velocity calibration program and enter the following command in the terminal

image-20231218111858838

Finally, open the dynamic parameter adjuster and enter the following command in the terminal,

image-20231218112803267

Note: There may not be the above nodes when you first open it. You can see all nodes after clicking Refresh. The calibrate_angular node shown is the node for calibrating angular velocity.

4、Start calibration

In the rqt_reconfigure interface, select the calibrate_angular node. There is start_test below. Click the box to the right of it to start calibration. Other parameters in the rqt interface are described as follows.

Click start_test to start calibration. The car will monitor the TF transformation of base_footprint and odom, calculate the theoretical distance traveled by the car, wait until the error is less than the tolerance, and issue a parking instruction.

image-20231218120732453

The turn_angle here is in radians. If the actual angle of the car's rotation is not 360 degrees, then modify the odom_angular_scale_correction parameter in rqt. After modification, click on the blank space, click start_test again, reset start_test, and then click start_test again. Calibration. The same goes for modifying other parameters. You need to click on the blank space to write the modified parameters.

5、Code analysis

Source code reference path (taking the supporting virtual machine as an example):

calibrate_angular.py, the core code is as follows,