1 # Copyright (c) 2019-2020 NVIDIA CORPORATION. All rights reserved.
3 @page calibration_usecase_imu IMU Self-Calibration
5 ## IMU Calibration - Operating Principle
7 IMU calibration involves the estimation of the three angles aligning the IMU coordinate frame to the vehicle coordinate frame: roll, pitch, and yaw. All three angles are crucial to correctly estimate and predict the vehicle's pose when egomotion is used in `::DW_EGOMOTION_IMU_ODOMETRY` mode (for more details, see @ref egomotion_mainsection). The three angles are computed by processing the data sensed by the linear accelerometer and the gyroscope sensors embedded in the IMU device. Common driving maneuvers must be performed in order to excite the accelerometer and the gyroscope sensors along their three axes in order to make all three angles to be estimated observable.
11 In order to calibrate the IMU roll, the vehicle must perform several turns. Turns are automatically detected by the magnitude of the gyroscope excitation. In order to mitigate the influence of sensor noise, the gyroscope data is smoothed prior to processing. Roll corresponding to the gyroscope rotation is sampled into a histogram, mode of which, defines the estimated roll angle.
15 The pitch and yaw of the IMU are computed by using the linear accelerometer. In order to identify a forward acceleration, episodes of starts from static conditions, e.g, restarting at a traffic light or in a traffic jam, are automatically detected. In order to mitigate the influence of sensor noise, the accelerometer data is smoothed prior to processing. Employing the same histogram voting scheme as before, the pitch and yaw calibration angles are estimated in a robust way (see histograms below).
17 
21 ### Initialization Requirements
23 - Nominal values on IMU calibration
24 - Orientation(roll/pitch/yaw): roll less than 10 degree error, pitch and yaw less than 5 degree error
25 - Position(x/y/z): not used
27 ### Runtime Calibration Dependencies
31 ### Input Requirements
33 - Assumption: Vehicle performs the aforementioned maneuvers until calibration convergence.
34 - Speed measurements: Must be provided as part of dwVehicleIOState, see @ref vehicleio_mainsection for details
36 ### Output Requirements
38 - Corrected roll/pitch/yaw value: less than 0.4 degrees accuracy
39 - Time to correction: 11 minutes
41 ## Cross-validation KPI
43 Several hours of data are used to produce a reference calibration value for cross-validation.
44 Then, short periods of data are evaluated for whether they can recover the same values.
45 For example, the graph below shows precision/recall curves of IMU self-calibration.
46 Precision indicates that an accepted calibration is within a fixed precision threshold
47 from the reference calibration, and recall indicates the ratio of accepted calibrations
48 in the given amount of time.
50 
54 The following code snippet shows the general structure of a program that performs IMU self-calibration
57 dwCalibrationEngine_initialize(...); // depends on sensor from rig configuration module
58 dwCalibrationEngine_initializeIMU(...); // depends on nominal calibration from rig configuration
59 dwCalibrationEngine_startCalibration(...); // runtime calibration dependencies need to be met
61 while(true) // main loop
63 // get current IMU frame
64 dwSensorIMU_readFrame(&imuFrame, ...); // requires IMU module
66 // feed IMU frame into self-calibration
67 dwCalibrationEngine_addIMUFrame(&imuFrame, ...);
69 // Update vehicle state from CAN
70 dwSensorCAN_readMessage(&canMsg, ...);
71 dwVehicleIO_consumeCANFrame(&canMsg, ...);
73 // get current vehicle state
74 dwVehicleIO_getVehicleState(&vehicleState, ...);
76 // pass on vehicle state to self-calibration
77 dwCalibrationEngine_addVehicleIOState(&vehicleState, ...);
79 // retrieve calibration status
80 dwCalibrationEngine_getCalibrationStatus(...);
82 // retrieve self-calibration results
83 dwCalibrationEngine_getSensorToRigTransformation(...);
86 dwCalibrationEngine_stopCalibration(...);
89 This workflow is demonstrated in the following sample: @ref dwx_imu_calibration_sample