docs/11_Hardware Integration and Calibration/传感器标定/apollo_lidar_imu_calibration_guide.md
Note:
This guide cannot be used for version Apollo 3.5
Welcome to the Apollo sensor calibration service. This document describes the process of the extrinsic calibration service between 64-beam Light Detection And Ranging (LiDAR) and Inertial Navigation System (INS).
The Apollo vehicle sensor calibration function provides the extrinsic calibration between Velodyne HDL-64ES3 and IMU. The calibration results can be used to transfer the obstacle location detected by LiDAR to the IMU coordinate system, and then to the world coordinate system. The results are provided in .yaml format files.
In order to calibrate the sensors, it is important to prepare them first, using the following steps:
Install 64-beams LiDAR and INS supported by Apollo, and then deploy the Docker environment.
Start up the 64-beams LiDAR and INS. The INS must be aligned when it is powered on. At this point, the car should be driven straight, then turned left and turned right in an open area, until the initialization is completed.
Confirm that all sensor topics required by this service have the following output : How to Check the Sensor Output?
The topics required by the calibration service are shown in the following Table 1:
Table 1. Sensor topics.
| Sensor | Topic Name | Topic Feq. (Hz) |
|---|---|---|
| HDL-64ES3 | /apollo/sensor/velodyne64/VelodyneScanUnified | 10 |
| INS | /apollo/sensor/gnss/odometry | 100 |
| INS | /apollo/sensor/gnss/ins_stat | 2 |
Confirm that the INS status is 56 when recording data. To learn how please go to : How to Check INS Status?
Choose an appropriate calibration field.
After the preparation steps are completed, drive the vehicle to the calibration field to record the calibration data.
The recording script is apollo/script/lidar_calibration.sh.
Run the following command to record data:
bash lidar_calibration.sh start_record
The recorded bag is under the directory apollo/data/bag.
Drive the car following a ∞ symbol path, using a controlled speed of 20-40km/h, and make the turning radius as small as possible. The total time length should within 3 minutes, but please make sure that your calibration drive contains at least one full ∞ symbol path.
After recording, run the following command to stop the data recording:
bash lidar_calibration.sh stop_record
lidar_calib_data.tar.gz, including the recorded rosbag and the corresponding MD5 checksum file.After recording the calibration data, please login to the calibration service page to complete the calibration.
Enter the calibration service page and click the New Task button under the Task Management list to create a new calibration task.
After entering the New Task page, you need to fill in a simple description of this task. Then click the Upload and create a task button and select the upload calibration file to start uploading the calibration data.
After you start uploading the data, the page will display the Task Process View. The process figure is the upload progress page. The task will start to calibrate when the upload progress reaches 100%. Please keep the network unblocked during uploading.
When the data is uploaded, the Data Verification Process will begin, as shown in Figure 3. The validation process ensures data integrity and suitability. The validation list include:
If validation fails, the corresponding error message is prompted as seen in the third Result of the Data Validation screen below in Figure 3.
<p align="center">Figure 3. Calibration data verification.</p>For additional information, see: How to Check Point Cloud Quality?
Before obtaining the calibration results, the service requires that you confirm the quality of the calibration results based on visualized point cloud.
After confirming the quality of the calibration result, you can click on the Confirm button to store the calibration result. After that, you can download the result on the Task page. The Download button will NOT appear on the task page if the result failed to pass quality verification.
Extrinsic file format instruction — The extrinsic is returned to you in a .yaml format file. We can look an at example of the format of the extrinsic file below:
The field meanings shown in this example are defined in Table 2.
header:
seq: 0
stamp:
secs: 1504765807
nsecs: 0
frame_id: novatel
child_frame_id: velodyne64
transform:
rotation:
x: 0.02883904659307384
y: -0.03212457531272153
z: 0.697030811535172
w: 0.7157404339725393
translation:
x: 0.000908140840832566
y: 1.596564931858745
z: 1
Table 2. Definition of the keys in the yaml file
| Field | Meaning |
|---|---|
header | Header information, including timestamps. |
child_frame_id | Source sensor ID in calibration. Will be HDL-64ES3 here. |
frame_id | Target sensor ID in calibration. Will be Novatel here. |
rotation | Rotation part of the extrinsic parameters. Represented by a quaternion. |
translation | Translation part of the extrinsic parameters. |
Enter the following command to create the calibration file directory in the apollo directory:
mkdir -p modules/calibration/data/[CAR_ID]/
Here, CAR_ID is the vehicle ID for calibrating vehicles. Then, copy the downloaded extrinsic yaml file to the corresponding CAR_ID folder. Finally, after you start HMI, select the correct CAR_ID to load the corresponding calibration yaml file.
tar.gz file