Skip to content

Commit e9daa64

Browse files
committed
Clean up and fix minor errors
1 parent c01a109 commit e9daa64

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

examples/EurocDataExample.cpp

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @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.
44
* @author Matt Kielo, Porter Zach
55
*/
66

@@ -36,10 +36,9 @@
3636
typedef Eigen::Matrix<double, 15, 15> Matrix15x15;
3737

3838
// --- 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.
4140
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" */ };
4342
const vector<double> deltaTij_values = {0.2, 0.5, 1.0};
4443
const double integration_noise_sigma = 1e-8;
4544
const Vector3 gravity_n(0, 0, -9.81);
@@ -168,21 +167,20 @@
168167

169168
// PreintegrationCombinedParams constructor takes gravity magnitude
170169
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);
171174

172175
double nominal_imu_dt = 1.0 / sensor_params.rate_hz;
173176
if (nominal_imu_dt <= 1e-9) nominal_imu_dt = 0.005;
174177

175-
p_combined->gyroscopeCovariance = pow(sensor_params.gyro_noise_density, 2) / nominal_imu_dt * I_3x3;
176178
p_combined->accelerometerCovariance = pow(sensor_params.accel_noise_density, 2) / nominal_imu_dt * I_3x3;
177179
p_combined->integrationCovariance = pow(integration_sigma, 2) * I_3x3;
178180
p_combined->biasAccCovariance = pow(sensor_params.accel_bias_rw_density, 2) * nominal_imu_dt * I_3x3;
179181
p_combined->biasOmegaCovariance = pow(sensor_params.gyro_bias_rw_density, 2) * nominal_imu_dt * I_3x3;
180182
p_combined->biasAccOmegaInt = I_6x6 * 1e-5; // Default
181183

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-
186184
return p_combined;
187185
}
188186

@@ -257,8 +255,7 @@
257255

258256
auto p_manifold = PreintegrationParams::MakeSharedU(gravity_n_vec.norm());
259257

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
262259
setupBasePreintegratedRotationParams(static_cast<PreintegratedRotationParams*>(p_manifold.get()),
263260
sensor_params, body_omega_coriolis);
264261

@@ -365,7 +362,7 @@
365362
Vector3 body_omega_Coriolis = Vector3::Zero(); // Set to non-zero if evaluating on rotating frame
366363

367364
// --- List of Preintegration Techniques to Evaluate ---
368-
// **TO ADD A NEW TECHNIQUE**:
365+
// TO ADD A NEW TECHNIQUE:
369366
// 1. Define YourNewTechniqueClass inheriting from ImuPreintegrationTechnique.
370367
// 2. Implement its virtual methods (name, createPreintegrationParams, evaluateInterval).
371368
// 3. Add to this list: techniques.push_back(shared_ptr<ImuPreintegrationTechnique>(new YourNewTechniqueClass()));
@@ -376,7 +373,7 @@
376373
map<string, map<string, map<double, AggregatedRunResults>>> all_results_by_technique;
377374

378375
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;
380377
map<string, map<double, AggregatedRunResults>> current_technique_run_results;
381378

382379
for (const string& dataset_name : dataset_sequences) {

0 commit comments

Comments
 (0)