|
1 | 1 | /** |
2 | 2 | * @file EurocDataExample.cpp |
3 | | - * @brief Example evaluating IMU Preintegration consistency (15-DOF) on EuRoC dataset. |
| 3 | + * @brief Example evaluating IMU preintegration techniques on EuRoC dataset. |
4 | 4 | * @author Matt Kielo, Porter Zach |
5 | 5 | */ |
6 | 6 |
|
|
36 | 36 | typedef Eigen::Matrix<double, 15, 15> Matrix15x15; |
37 | 37 |
|
38 | 38 | // --- Configuration --- |
39 | | - // Update this path with the location of your EuRoC data, which should contain |
40 | | - // folders like "MH_01", "V2_02", etc. |
| 39 | + // Update this path with the location of your EuRoC data, which should contain folders like "MH_01", "V2_02", etc. |
41 | 40 | const string base_euroc_data_path = "C:/gtsam/euroc/data"; |
42 | | - const vector<string> dataset_sequences = { "MH_01", "V2_02" }; |
| 41 | + const vector<string> dataset_sequences = { "MH_01", /* "MH_02", "MH_03", "MH_04", "MH_05", "V1_01", "V1_02", "V1_03", "V2_01", */ "V2_02" /*, "V2_03" */ }; |
43 | 42 | const vector<double> deltaTij_values = {0.2, 0.5, 1.0}; |
44 | 43 | const double integration_noise_sigma = 1e-8; |
45 | 44 | const Vector3 gravity_n(0, 0, -9.81); |
|
168 | 167 |
|
169 | 168 | // PreintegrationCombinedParams constructor takes gravity magnitude |
170 | 169 | auto p_combined = PreintegrationCombinedParams::MakeSharedU(gravity_n_vec.norm()); |
| 170 | + |
| 171 | + // Set gyroscopeCovariance, omegaCoriolis, body_P_sensor |
| 172 | + setupBasePreintegratedRotationParams(static_cast<PreintegratedRotationParams*>(p_combined.get()), |
| 173 | + sensor_params, body_omega_coriolis); |
171 | 174 |
|
172 | 175 | double nominal_imu_dt = 1.0 / sensor_params.rate_hz; |
173 | 176 | if (nominal_imu_dt <= 1e-9) nominal_imu_dt = 0.005; |
174 | 177 |
|
175 | | - p_combined->gyroscopeCovariance = pow(sensor_params.gyro_noise_density, 2) / nominal_imu_dt * I_3x3; |
176 | 178 | p_combined->accelerometerCovariance = pow(sensor_params.accel_noise_density, 2) / nominal_imu_dt * I_3x3; |
177 | 179 | p_combined->integrationCovariance = pow(integration_sigma, 2) * I_3x3; |
178 | 180 | p_combined->biasAccCovariance = pow(sensor_params.accel_bias_rw_density, 2) * nominal_imu_dt * I_3x3; |
179 | 181 | p_combined->biasOmegaCovariance = pow(sensor_params.gyro_bias_rw_density, 2) * nominal_imu_dt * I_3x3; |
180 | 182 | p_combined->biasAccOmegaInt = I_6x6 * 1e-5; // Default |
181 | 183 |
|
182 | | - // body_P_sensor and omegaCoriolis will be std::nullopt by default from |
183 | | - // PreintegrationCombinedParams::MakeSharedU. This is consistent with the original |
184 | | - // script not explicitly setting these on its PreintegrationCombinedParams object. |
185 | | - |
186 | 184 | return p_combined; |
187 | 185 | } |
188 | 186 |
|
|
257 | 255 |
|
258 | 256 | auto p_manifold = PreintegrationParams::MakeSharedU(gravity_n_vec.norm()); |
259 | 257 |
|
260 | | - // For ManifoldIMU, using setupBasePreintegratedRotationParams is standard |
261 | | - // as it sets body_P_sensor and omegaCoriolis if needed. |
| 258 | + // Set gyroscopeCovariance, omegaCoriolis, body_P_sensor |
262 | 259 | setupBasePreintegratedRotationParams(static_cast<PreintegratedRotationParams*>(p_manifold.get()), |
263 | 260 | sensor_params, body_omega_coriolis); |
264 | 261 |
|
|
365 | 362 | Vector3 body_omega_Coriolis = Vector3::Zero(); // Set to non-zero if evaluating on rotating frame |
366 | 363 |
|
367 | 364 | // --- List of Preintegration Techniques to Evaluate --- |
368 | | - // **TO ADD A NEW TECHNIQUE**: |
| 365 | + // TO ADD A NEW TECHNIQUE: |
369 | 366 | // 1. Define YourNewTechniqueClass inheriting from ImuPreintegrationTechnique. |
370 | 367 | // 2. Implement its virtual methods (name, createPreintegrationParams, evaluateInterval). |
371 | 368 | // 3. Add to this list: techniques.push_back(shared_ptr<ImuPreintegrationTechnique>(new YourNewTechniqueClass())); |
|
376 | 373 | map<string, map<string, map<double, AggregatedRunResults>>> all_results_by_technique; |
377 | 374 |
|
378 | 375 | for (const auto& tech_ptr : techniques) { |
379 | | - cout << "\n\n<<<<< Evaluating Technique: " << tech_ptr->name() << " >>>>>" << endl; |
| 376 | + cout << "\n<<<<< Evaluating Technique: " << tech_ptr->name() << " >>>>>" << endl; |
380 | 377 | map<string, map<double, AggregatedRunResults>> current_technique_run_results; |
381 | 378 |
|
382 | 379 | for (const string& dataset_name : dataset_sequences) { |
|
0 commit comments