Imu_tk algorithm flow
Because of the VIO, the lower precision is commonly used imu, so it needs a more accurate estimation of internal parameters and noise. Noise everyone usually uses Allan variance to estimate to get more credible results, so I won’t go into details here. A more convenient tool for internal parameter calibration is imu_tk. So this article mainly introduces the algorithm flow of imu_tk and the precautions when using it. The content of the next article The plan is to calibrate the external parameters of imu-camera.
First introduce the algorithm flow step by step:
1. Read in the data and convert the time unit into seconds
2. Set the initial parameters and control the calibration algorithm Parameters
3. Start calibration
3.1 Calibrate the accelerometer
First call the initiInterval function to return the index of the data in the first 50s (30s by default)
Calculate the variance of the initial init_static_interval and define it as norm_th
For loop: th_mult=2:10
{Use a sliding window of 101 to search for the static interval: if this If the variance of the accelerometer readings in the sliding window is less than th_mult*norm_th, it is considered to be the static zone
The accelerometer readings in the static zone are extracted. If the size of an interval is smaller than the initial setting interval_n_samples_ (default is 100), the static interval is removed; note that if acc_use_means_ is true in the initial parameter, only the average value of all readings in the static interval is taken as static_sample, and its The timestamp is the median value of the timestamp of the static interval. Otherwise, save all samples in the static interval. If the number of extracted static intervals is less than the initial set min_num_intervals_ (default is 12), it is considered that the collected data is not enough to calibrate imu, and the program exits.
Construct the objective function: g-unbiasnorm(acc_samples), where the former is the initial set acceleration of gravity, and the latter is the norm of the accelerometer reading after bias is removed. Because if imu is stationary, the modulus of its accelerometer reading should be equal to the value of gravitational acceleration.
Using ceres to minimize the objective function to obtain the nine parameters of the accelerometer. And use the calibrated parameters to correct the raw_data of the accelerometer.
}
The parameter corresponding to the smallest estimated error of th_mult at 2~10 is the most accurate accelerometer calibration parameter, and the static_interval corresponding to this parameter is saved.
3.2 Calibrating the gyroscope
According to the calibration result of the accelerometer, extract static_sample.
According to the initial 50s gyroscope reading, estimate the bias of the gyroscope.
Use the bias obtained in the previous step to correct the gyroscope reading.
Find the start_index and end_index of the motion interval according to the extracted static_interval.
Construct the objective function: integrate_R’*g_start-g_end. Among them, g_start and g_end are both normalized vectors. Because in the imu movement interval, the reading of the accelerometer in the two frames should be the rotation of the imu between the two frames, which is the result obtained after the integration of the imu’s gyroscope.
Using ceres to minimize the objective function to obtain the twelve parameters of the gyroscope. Note that if the initial optimize_gyro_bias_ is true, the bias parameter still needs to be calibrated after correcting the gyroscope reading, otherwise the bias estimated from the initial reading will be returned. If gyro_dt_ is -1, use the timestamp of the two frames of gyroscopes for integration, otherwise use the time interval given by gryo_dt for integration.
Notes:
1. When calibrating, the imu needs to be static for a period of time. According to the program, it needs to be static for at least 50s.
2. Since the size of the sliding window for detecting the static zone in the program is 101, each static time needs more than 100 frames of data
3. Because the static zone is detected in the program, you need At least the variance in the sliding window starting from end_index is greater than 2 times the static variance, so the motion time between two static intervals should not be too short, and it is better to have obvious acceleration or deceleration. It is best to exercise more than 100 frames.
4. Because the number of static intervals that need to be detected in the program is greater than 12, and the paper mentions that the static interval is 30+-40+ times, the accuracy is better. So there needs to be more than 30 static zones.
5. Try to ensure that imu is still in the static zone. Especially keep imu still for the first minute to get a better estimate of norm_th and gyro_bias.
References:
Tedaldi D, Pretto A, Menegatti E. A robust and easy to implement method for IMU calibration without external equipments[C]//2014 IEEE International Conference on Robotics and Automation (ICRA). IEEE, 2014: 3042-3049.
test_imu_calib.cpp
You need to modify the offset and scale in the code, set the offset to 0, and set the scale to 1
init_acc_calib.setBias( Vector3d(0, 0, 0) );
init_gyro_calib.setScale( Vector3d(1.0, 1.0, 1.0) );
Imu_tk algorithm flow
Because VIO generally uses imu with lower precision, it needs a more accurate internal parameter and noise Estimate. Noise everyone usually uses Allan variance to estimate to get more credible results, so I won’t go into details here. A more convenient tool for internal parameter calibration is imu_tk. So this article mainly introduces the algorithm flow of imu_tk and the precautions when using it. The content of the next article The plan is to calibrate the external parameters of imu-camera.
First introduce the algorithm flow step by step:
1. Read in the data and convert the time unit into seconds
2. Set the initial parameters and control the calibration algorithm Parameters
3. Start calibration
3.1 Calibrate the accelerometer
First call the initiInterval function to return the index of the data in the first 50s (30s by default)
Calculate the variance of the initial init_static_interval and define it as norm_th
For loop: th_mult=2:10
{Use a sliding window of 101 to search for the static interval: if this If the variance of the accelerometer readings in the sliding window is less than th_mult*norm_th, it is considered to be the static zone
The accelerometer readings in the static zone are extracted. If the size of an interval is smaller than the initial setting interval_n_samples_ (default is 100), the static interval is removed; note that if acc_use_means_ is true in the initial parameter, only the average value of all readings in the static interval is taken as static_sample, and its The timestamp is the median value of the timestamp of the static interval. Otherwise, save all samples in the static interval. If the number of extracted static intervals is less than the initial set min_num_intervals_ (default is 12), it is considered that the collected data is not enough to calibrate imu, and the program exits.
Construct the objective function: g-unbiasnorm(acc_samples), where the former is the initial set acceleration of gravity, and the latter is the norm of the accelerometer reading after bias is removed. Because if imu is stationary, the modulus of its accelerometer reading should be equal to the value of gravitational acceleration.
Using ceres to minimize the objective function to obtain the nine parameters of the accelerometer. And use the calibrated parameters to correct the raw_data of the accelerometer.
}
The parameter corresponding to the smallest estimated error of th_mult at 2~10 is the most accurate accelerometer calibration parameter, and the static_interval corresponding to this parameter is saved.
3.2 Calibrating the gyroscope
According to the calibration result of the accelerometer, extract static_sample.
According to the initial 50s gyroscope reading, estimate the bias of the gyroscope.
Use the bias obtained in the previous step to correct the gyroscope reading.
Find the start_index and end_index of the motion interval according to the extracted static_interval.
Construct the objective function: integrate_R’*g_start-g_end. Among them, g_start and g_end are both normalized vectors. Because in the imu movement interval, the reading of the accelerometer in the two frames should be the rotation of the imu between the two frames, which is the result obtained after the integration of the imu’s gyroscope.
Using ceres to minimize the objective function to obtain the twelve parameters of the gyroscope. Note that if the initial optimize_gyro_bias_ is true, the bias parameter still needs to be calibrated after correcting the gyroscope reading, otherwise the bias estimated from the initial reading will be returned. If gyro_dt_ is -1, use the timestamp of the two frames of gyroscopes for integration, otherwise use the time interval given by gryo_dt for integration.
Notes:
1. When calibrating, the imu needs to be static for a period of time. According to the program, it needs to be static for at least 50s.
2. Since the size of the sliding window for detecting the static zone in the program is 101, each static time needs more than 100 frames of data
3. Because the static zone is detected in the program, you need At least the variance in the sliding window starting from end_index is greater than 2 times the static variance, so the motion time between two static intervals should not be too short, and it is better to have obvious acceleration or deceleration. It is best to exercise more than 100 frames.
4. Because the number of static intervals that need to be detected in the program is greater than 12, and the paper mentions that the static interval is 30+-40+ times, the accuracy is better. So there needs to be more than 30 static zones.
5. Try to ensure that imu is still in the static zone. Especially keep imu still for the first minute to get a better estimate of norm_th and gyro_bias.
References:
Tedaldi D, Pretto A, Menegatti E. A robust and easy to implement method for IMU calibration without external equipments[C]//2014 IEEE International Conference on Robotics and Automation (ICRA). IEEE, 2014: 3042-3049.
test_imu_calib.cpp
You need to modify the offset and scale in the code, set the offset to 0, and set the scale to 1
init_acc_calib.setBias( Vector3d(0, 0, 0) );
init_gyro_calib.setScale( Vector3d(1.0, 1.0, 1.0) );
Imu_tk algorithm flow strong>
Because VIO generally uses imu with lower accuracy, it needs a more accurate estimation of internal parameters and noise. Noise everyone usually uses Allan variance to estimate to get more credible results, so I won’t go into details here. A more convenient tool for internal parameter calibration is imu_tk. So this article mainly introduces the algorithm flow of imu_tk and the precautions when using it. The content of the next article The plan is to calibrate the external parameters of imu-camera.
First introduce the algorithm flow step by step:
1. Read in the data and convert the time unit into seconds
2. Set the initial parameters and control the calibration algorithm Parameters
3. Start calibration
3.1 Calibrate the accelerometer
First call the initiInterval function to return the index of the data in the first 50s (30s by default)
Calculate the variance of the initial init_static_interval and define it as norm_th
For loop: th_mult=2:10
{Use a sliding window of 101 to search for the static interval: if this If the variance of the accelerometer readings in the sliding window is less than th_mult*norm_th, it is considered to be the static zone
The accelerometer readings in the static zone are extracted. If the size of an interval is smaller than the initial setting interval_n_samples_ (default is 100), the static interval is removed; note that if acc_use_means_ is true in the initial parameter, only the average value of all readings in the static interval is taken as static_sample, and its The timestamp is the median value of the timestamp of the static interval. Otherwise, save all samples in the static interval. If the number of extracted static intervals is less than the initial set min_num_intervals_ (default is 12), it is considered that the collected data is not enough to calibrate imu, and the program exits.
Construct the objective function: g-unbiasnorm(acc_samples), where the former is the initial set acceleration of gravity, and the latter is the norm of the accelerometer reading after bias is removed. Because if imu is stationary, the modulus of its accelerometer reading should be equal to the value of gravitational acceleration.
Using ceres to minimize the objective function to obtain the nine parameters of the accelerometer. And use the calibrated parameters to correct the raw_data of the accelerometer.
}
The parameter corresponding to the smallest estimated error of th_mult at 2~10 is the most accurate accelerometer calibration parameter, and the static_interval corresponding to this parameter is saved.
3.2 Calibrating the gyroscope
According to the calibration result of the accelerometer, extract static_sample.
According to the initial 50s gyroscope reading, estimate the bias of the gyroscope.
Use the bias obtained in the previous step to correct the gyroscope reading.
Find the start_index and end_index of the motion interval according to the extracted static_interval.
Construct the objective function: integrate_R’*g_start-g_end. Among them, g_start and g_end are both normalized vectors. Because in the imu movement interval, the reading of the accelerometer in the two frames should be the rotation of the imu between the two frames, which is the result obtained after the integration of the imu’s gyroscope.
Using ceres to minimize the objective function to obtain the twelve parameters of the gyroscope. Note that if the initial optimize_gyro_bias_ is true, the bias parameter still needs to be calibrated after correcting the gyroscope reading, otherwise the bias estimated from the initial reading will be returned. If gyro_dt_ is -1, use the timestamp of the two frames of gyroscopes for integration, otherwise use the time interval given by gryo_dt for integration.
Notes:
1. When calibrating, the imu needs to be static for a period of time. According to the program, it needs to be static for at least 50s.
2. Since the size of the sliding window for detecting the static zone in the program is 101, each static time needs more than 100 frames of data
3. Because the static zone is detected in the program, you need At least the variance in the sliding window starting from end_index is greater than 2 times the static variance, so the motion time between two static intervals should not be too short, and it is better to have obvious acceleration or deceleration. It is best to exercise more than 100 frames.
4. Because the number of static intervals that need to be detected in the program is greater than 12, and the paper mentions that the static interval is 30+-40+ times, the accuracy is better. So there needs to be more than 30 static zones.
5. Try to ensure that imu is still in the static zone. Especially keep imu still for the first minute to get a better estimate of norm_th and gyro_bias.
References:
Tedaldi D, Pretto A, Menegatti E. A robust and easy to implement method for IMU calibration without external equipments[C]//2014 IEEE International Conference on Robotics and Automation (ICRA). IEEE, 2014: 3042-3049.
test_imu_calib.cpp
You need to modify the offset and scale in the code, set the offset to 0, and set the scale to 1
init_acc_calib.setBias( Vector3d(0, 0, 0) );
init_gyro_calib.setScale( Vector3d(1.0, 1.0, 1.0) );
init_acc_calib.setBias( Vector3d(0, 0, 0) );
init_gyro_calib.setScale( Vector3d(1.0, 1.0, 1.0) );