actually test the covariances and fix bug
parent
3132cfbc86
commit
53712149f9
|
@ -141,11 +141,11 @@ void PreintegratedCombinedMeasurements::integrateMeasurement(
|
|||
D_t_t(&G_measCov_Gt) = (pos_H_biasAcc
|
||||
* (aCov / dt) // aCov_updated / dt
|
||||
* pos_H_biasAcc.transpose()) + (dt * iCov);
|
||||
D_v_v(&G_measCov_Gt) = (1 / dt) * vel_H_biasAcc
|
||||
D_v_v(&G_measCov_Gt) = vel_H_biasAcc
|
||||
* (aCov / dt) // aCov_updated / dt
|
||||
* (vel_H_biasAcc.transpose());
|
||||
|
||||
D_R_R(&G_measCov_Gt) = (1 / dt) * theta_H_biasOmega
|
||||
D_R_R(&G_measCov_Gt) = theta_H_biasOmega
|
||||
* (wCov / dt) // wCov_updated / dt
|
||||
* (theta_H_biasOmega.transpose());
|
||||
|
||||
|
|
|
@ -269,27 +269,14 @@ static boost::shared_ptr<PreintegratedCombinedMeasurements::Params> Params() {
|
|||
// EXPECT(assert_equal(expected, actual.preintMeasCov()));
|
||||
// }
|
||||
|
||||
TEST(CombinedImuFactor, SameCovarianceCombined) {
|
||||
auto params = PreintegrationCombinedParams::MakeSharedU();
|
||||
|
||||
params->setAccelerometerCovariance(pow(0.01, 2) * I_3x3);
|
||||
params->setGyroscopeCovariance(pow(1.75e-4, 2) * I_3x3);
|
||||
params->setIntegrationCovariance(pow(0, 2) * I_3x3);
|
||||
params->setOmegaCoriolis(Vector3::Zero());
|
||||
|
||||
imuBias::ConstantBias currentBias;
|
||||
|
||||
PreintegratedCombinedMeasurements pim(params, currentBias);
|
||||
TEST(CombinedImuFactor, SameCovariance) {
|
||||
|
||||
Vector3 accMeas(0.1577, -0.8251, 9.6111);
|
||||
Vector3 omegaMeas(-0.0210, 0.0311, 0.0145);
|
||||
double deltaT = 0.01;
|
||||
pim.integrateMeasurement(accMeas, omegaMeas, deltaT);
|
||||
|
||||
std::cout << pim.preintMeasCov() << std::endl << std::endl;
|
||||
}
|
||||
imuBias::ConstantBias currentBias;
|
||||
|
||||
TEST(CombinedImuFactor, SameCovariance) {
|
||||
auto params = PreintegrationParams::MakeSharedU();
|
||||
|
||||
params->setAccelerometerCovariance(pow(0.01, 2) * I_3x3);
|
||||
|
@ -297,16 +284,23 @@ TEST(CombinedImuFactor, SameCovariance) {
|
|||
params->setIntegrationCovariance(pow(0, 2) * I_3x3);
|
||||
params->setOmegaCoriolis(Vector3::Zero());
|
||||
|
||||
imuBias::ConstantBias currentBias;
|
||||
|
||||
PreintegratedImuMeasurements pim(params, currentBias);
|
||||
|
||||
Vector3 accMeas(0.1577, -0.8251, 9.6111);
|
||||
Vector3 omegaMeas(-0.0210, 0.0311, 0.0145);
|
||||
double deltaT = 0.01;
|
||||
pim.integrateMeasurement(accMeas, omegaMeas, deltaT);
|
||||
|
||||
std::cout << pim.preintMeasCov() << std::endl << std::endl;
|
||||
// std::cout << pim.preintMeasCov() << std::endl << std::endl;
|
||||
|
||||
auto combined_params = PreintegrationCombinedParams::MakeSharedU();
|
||||
|
||||
combined_params->setAccelerometerCovariance(pow(0.01, 2) * I_3x3);
|
||||
combined_params->setGyroscopeCovariance(pow(1.75e-4, 2) * I_3x3);
|
||||
combined_params->setIntegrationCovariance(pow(0, 2) * I_3x3);
|
||||
combined_params->setOmegaCoriolis(Vector3::Zero());
|
||||
|
||||
PreintegratedCombinedMeasurements cpim(combined_params, currentBias);
|
||||
cpim.integrateMeasurement(accMeas, omegaMeas, deltaT);
|
||||
|
||||
// std::cout << cpim.preintMeasCov() << std::endl << std::endl;
|
||||
EXPECT(assert_equal(pim.preintMeasCov(), cpim.preintMeasCov().block(0, 0, 9, 9)));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue