* Test that error does give the right result when it is zero. */
| 44 | * Test that error does give the right result when it is zero. |
| 45 | */ |
| 46 | TEST(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. |
nothing calls this directly
no test coverage detected