5. Robot calibration

5. Robot calibration5.1. Description of program functions5.2. Program Code Reference Path5.3. Program Startup5.4. Core Source Code Parsing

 

5.1. Description of program functions

After the program is run, the dynamic parameter adjuster is used here to adjust the parameters to calibrate the linear and angular speed of the car. The intuitive embodiment of the calibration line speed makes the car go straight forward 1 meter, to see how far it actually runs and whether it is within the error range; The visual representation of calibration angular velocity allows the car to rotate 360 degrees to see if the Angle of rotation of the car is within the error range.

5.2. Program Code Reference Path

After SSH connection car, the location of the function source code is located at,

5.3. Program Startup

After SSH connects to the car, terminal input,

Open the virtual machine terminal, input,

1684481464371

Take the calibration line speed as an example, click [start_test] car calibration x direction line speed, observe whether the car moved the test_distance distance, the default setting here is 1m, before calibration can customize the test distance, must be a decimal, set the click in the blank, the program will automatically write. If the car moves farther than the acceptable error range (the value of the tolerance variable), then the value of odom_linear_scale_correction is set. Here's what each parameter means,

ParametersMeanings
raterelease frequency(can need not modify)
test_distanceThe distance from which the line speed is tested
speedThe magnitude of the line speed
toleranceThe acceptable error
odom_linear_scale_correctionThe ratio factor
start_testTo start the test
directiondirection (linear velocity test X (1) Y direction (0))
base_framelistens for the parent coordinate of the TF transform
odom_framelistens for the sub-coordinate of the TF transformation

The variable Settings for testing angular velocity are roughly the same, but test_distance becomes test_angle and speed becomes angular velocity.

5.4. Core Source Code Parsing

This program mainly uses TF to monitor the transformation between coordinates to achieve, by monitoring the coordinate transformation between base_footprint and odom to let the robot know "how far I go now/how many degrees I turn now".

Take calibrate_linear.py as an example. The core code is as follows:

calibrate_angular.py core code is as follows:

The published TF transform is published in the base_node node, the code path is,

This node will receive /vel_raw data, release odom data through mathematical calculation, and release TF transformation. The core code is as follows: