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

Function TEST

tests/testParallelPlaneRegularBasicFactor.cpp:46–70  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

Point3Class · 0.85
insertMethod · 0.80
optimizeMethod · 0.80
evaluateErrorMethod · 0.45

Tested by

no test coverage detected