From ee6569db2947e8314ccfae7fbe837f5ea9c1cc44 Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Sat, 27 Aug 2011 00:59:18 +0000 Subject: [PATCH] Added missing "Lie group" unit tests to Point2 --- gtsam/geometry/tests/testPoint2.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gtsam/geometry/tests/testPoint2.cpp b/gtsam/geometry/tests/testPoint2.cpp index e8fbb2201..ab3201495 100644 --- a/gtsam/geometry/tests/testPoint2.cpp +++ b/gtsam/geometry/tests/testPoint2.cpp @@ -21,6 +21,24 @@ using namespace std; using namespace gtsam; +/* ************************************************************************* */ +TEST(Point2, Lie) { + Point2 p1(1,2); + Point2 p2(4,5); + Matrix H1, H2; + + EXPECT(assert_equal(Point2(5,7), p1.compose(p2, H1, H2))); + EXPECT(assert_equal(eye(2), H1)); + EXPECT(assert_equal(eye(2), H2)); + + EXPECT(assert_equal(Point2(3,3), p1.between(p2, H1, H2))); + EXPECT(assert_equal(-eye(2), H1)); + EXPECT(assert_equal(eye(2), H2)); + + EXPECT(assert_equal(Point2(5,7), p1.expmap(Vector_(2, 4.,5.)))); + EXPECT(assert_equal(Vector_(2, 3.,3.), p1.logmap(p2))); +} + /* ************************************************************************* */ TEST( Point2, expmap) {