MCPcopy Create free account
hub / github.com/MIT-SPARK/Kimera-VIO / TEST

Function TEST

tests/testGeneralParallelPlaneRegularBasicFactor.cpp:47–75  ·  view source on GitHub ↗

* Test that error does give the right result when it is zero. /* ************************************************************************* */

Source from the content-addressed store, hash-verified

45 * Test that error does give the right result when it is zero.
46/* ************************************************************************* */
47TEST(testGeneralParallelPlaneRegularBasicFactor, ErrorIsZero) {
48 /// Plane keys.
49 Key plane_key_1(1);
50 Key plane_key_2(2);
51
52 /// Noise model for cosntraint between the two planes.
53 noiseModel::Diagonal::shared_ptr parallel_plane_noise =
54 noiseModel::Diagonal::Sigmas(Vector3(0.1, 0.1, 0.1));
55
56 /// Measured distance between plane.
57 double measured_distance_from_plane2_to_plane1 = 0.8;
58
59 /// GeneralParallelism constraint between Plane 1 and Plane 2.
60 GeneralParallelPlaneRegularBasicFactor factor(
61 plane_key_1, plane_key_2, parallel_plane_noise,
62 measured_distance_from_plane2_to_plane1);
63
64 /// Planes.
65 OrientedPlane3 plane_1(0.1, 0.1, 0.9, 0.9);
66 OrientedPlane3 plane_2(0.1, 0.1, 0.9, 0.1);
67
68 /// Calculate error.
69 Vector error = factor.evaluateError(plane_1, plane_2);
70
71 /// Expected error.
72 Vector4 expected_error = Vector4::Constant(0.0);
73
74 EXPECT_TRUE(gtsam::assert_equal(expected_error, error, tol));
75}
76
77/**
78 * Test that error does give the right result when it is not zero.

Callers

nothing calls this directly

Calls 3

insertMethod · 0.80
optimizeMethod · 0.80
evaluateErrorMethod · 0.45

Tested by

no test coverage detected