Skip to content

Commit 1ac286f

Browse files
committed
Removed (passing) tests of deprecated
1 parent b531df7 commit 1ac286f

File tree

1 file changed

+2
-84
lines changed

1 file changed

+2
-84
lines changed

gtsam/navigation/tests/testPreintegratedRotation.cpp

+2-84
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static std::shared_ptr<PreintegratedRotationParams> paramsWithTransform() {
4444
}
4545

4646
//******************************************************************************
47-
TEST(PreintegratedRotation, integrateMeasurement) {
47+
TEST(PreintegratedRotation, integrateGyroMeasurement) {
4848
// Example where IMU is identical to body frame, then omega is roll
4949
using namespace biased_x_rotation;
5050
auto p = std::make_shared<PreintegratedRotationParams>();
@@ -74,48 +74,7 @@ TEST(PreintegratedRotation, integrateMeasurement) {
7474
}
7575

7676
//******************************************************************************
77-
TEST(PreintegratedRotation, Deprecated) {
78-
// Example where IMU is identical to body frame, then omega is roll
79-
using namespace biased_x_rotation;
80-
auto p = std::make_shared<PreintegratedRotationParams>();
81-
PreintegratedRotation pim(p);
82-
83-
// Check the value.
84-
Matrix3 H_bias;
85-
PreintegratedRotation::IncrementalRotation f{measuredOmega, deltaT,
86-
p->getBodyPSensor()};
87-
Rot3 expected = Rot3::Roll(omega * deltaT);
88-
EXPECT(assert_equal(expected, f(bias, H_bias), 1e-9));
89-
90-
// Ephemeral test for deprecated Jacobian:
91-
Matrix3 D_incrR_integratedOmega;
92-
(void)pim.incrementalRotation(measuredOmega, bias, deltaT,
93-
D_incrR_integratedOmega);
94-
auto g = [&](const Vector3& x, const Vector3& y) {
95-
return pim.incrementalRotation(x, y, deltaT, {});
96-
};
97-
const Matrix3 oldJacobian =
98-
numericalDerivative22<Rot3, Vector3, Vector3>(g, measuredOmega, bias);
99-
EXPECT(assert_equal<Matrix3>(oldJacobian, -deltaT * D_incrR_integratedOmega));
100-
101-
// Check deprecated version.
102-
Matrix3 D_incrR_integratedOmega2, F;
103-
pim.integrateMeasurement(measuredOmega, bias, deltaT,
104-
D_incrR_integratedOmega2, F);
105-
EXPECT(assert_equal(expected, pim.deltaRij(), 1e-9));
106-
107-
// Check that system matrix F is the first derivative of compose:
108-
EXPECT(assert_equal<Matrix3>(pim.deltaRij().inverse().AdjointMap(), F));
109-
110-
// Check that deprecated Jacobian is correct.
111-
EXPECT(assert_equal(D_incrR_integratedOmega, D_incrR_integratedOmega2, 1e-9));
112-
113-
// Make sure delRdelBiasOmega is H_bias after integration.
114-
EXPECT(assert_equal<Matrix3>(H_bias, pim.delRdelBiasOmega()));
115-
}
116-
117-
//******************************************************************************
118-
TEST(PreintegratedRotation, IncrementalRotationWithTransform) {
77+
TEST(PreintegratedRotation, integrateGyroMeasurementWithTransform) {
11978
// Example where IMU is rotated, so measured omega indicates pitch.
12079
using namespace biased_x_rotation;
12180
auto p = paramsWithTransform();
@@ -143,47 +102,6 @@ TEST(PreintegratedRotation, IncrementalRotationWithTransform) {
143102
EXPECT(assert_equal<Matrix3>(H_bias, pim.delRdelBiasOmega()));
144103
}
145104

146-
//******************************************************************************
147-
TEST(PreintegratedRotation, DeprecatedWithTransform) {
148-
// Example where IMU is rotated, so measured omega indicates pitch.
149-
using namespace biased_x_rotation;
150-
auto p = paramsWithTransform();
151-
PreintegratedRotation pim(p);
152-
153-
// Check the value.
154-
Matrix3 H_bias;
155-
PreintegratedRotation::IncrementalRotation f{measuredOmega, deltaT,
156-
p->getBodyPSensor()};
157-
Rot3 expected = Rot3::Pitch(omega * deltaT);
158-
EXPECT(assert_equal(expected, f(bias, H_bias), 1e-9));
159-
160-
// Ephemeral test for deprecated Jacobian:
161-
Matrix3 D_incrR_integratedOmega;
162-
(void)pim.incrementalRotation(measuredOmega, bias, deltaT,
163-
D_incrR_integratedOmega);
164-
auto g = [&](const Vector3& x, const Vector3& y) {
165-
return pim.incrementalRotation(x, y, deltaT, {});
166-
};
167-
const Matrix3 oldJacobian =
168-
numericalDerivative22<Rot3, Vector3, Vector3>(g, measuredOmega, bias);
169-
EXPECT(assert_equal<Matrix3>(oldJacobian, -deltaT * D_incrR_integratedOmega));
170-
171-
// Check deprecated version.
172-
Matrix3 D_incrR_integratedOmega2, F;
173-
pim.integrateMeasurement(measuredOmega, bias, deltaT,
174-
D_incrR_integratedOmega2, F);
175-
EXPECT(assert_equal(expected, pim.deltaRij(), 1e-9));
176-
177-
// Check that system matrix F is the first derivative of compose:
178-
EXPECT(assert_equal<Matrix3>(pim.deltaRij().inverse().AdjointMap(), F));
179-
180-
// Check that deprecated Jacobian is correct.
181-
EXPECT(assert_equal(D_incrR_integratedOmega, D_incrR_integratedOmega2, 1e-9));
182-
183-
// Make sure delRdelBiasOmega is H_bias after integration.
184-
EXPECT(assert_equal<Matrix3>(H_bias, pim.delRdelBiasOmega()));
185-
}
186-
187105
//******************************************************************************
188106
int main() {
189107
TestResult tr;

0 commit comments

Comments
 (0)