testBearingRange.cpp
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2 
3  * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4  * Atlanta, Georgia 30332-0415
5  * All Rights Reserved
6  * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7 
8  * See LICENSE for the license information
9 
10  * -------------------------------------------------------------------------- */
11 
20 #include <gtsam/geometry/Pose2.h>
21 #include <gtsam/geometry/Pose3.h>
23 
25 
26 using namespace std;
27 using namespace gtsam;
28 using namespace serializationTestHelpers;
29 
31 BearingRange2D br2D(1, 2);
32 
34 BearingRange3D br3D(Pose3().bearing(Point3(1, 0, 0)), 1);
35 
36 //******************************************************************************
37 TEST(BearingRange2D, Concept) {
38  BOOST_CONCEPT_ASSERT((IsManifold<BearingRange2D>));
39 }
40 
41 /* ************************************************************************* */
45  EXPECT(assert_equal(expected, actual));
46 }
47 
48 /* ************************************************************************* */
49 TEST(BearingRange, Serialization2D) {
50  EXPECT(equalsObj<BearingRange2D>(br2D));
51  EXPECT(equalsXML<BearingRange2D>(br2D));
52  EXPECT(equalsBinary<BearingRange2D>(br2D));
53 }
54 
55 //******************************************************************************
56 TEST(BearingRange3D, Concept) {
57  BOOST_CONCEPT_ASSERT((IsManifold<BearingRange3D>));
58 }
59 
60 /* ************************************************************************* */
63  BearingRange3D actual = BearingRange3D::Measure(Pose3(), Point3(1, 0, 0));
64  EXPECT(assert_equal(expected, actual));
65 }
66 
67 /* ************************************************************************* */
68 TEST(BearingRange, Serialization3D) {
69  EXPECT(equalsObj<BearingRange3D>(br3D));
70  EXPECT(equalsXML<BearingRange3D>(br3D));
71  EXPECT(equalsBinary<BearingRange3D>(br3D));
72 }
73 
74 /* ************************************************************************* */
75 int main() {
76  TestResult tr;
77  return TestRegistry::runAllTests(tr);
78 }
79 /* ************************************************************************* */
BearingRange< Pose3, Point3 > BearingRange3D
static int runAllTests(TestResult &result)
Matrix expected
Definition: testMatrix.cpp:974
Vector2 Point2
Definition: Point2.h:27
BOOST_CONCEPT_ASSERT((boost::RandomAccessRangeConcept< ListOfOneContainer< int > >))
Definition: Half.h:150
Represents a 3D point on a unit sphere.
Definition: Unit3.h:42
BearingRange2D br2D(1, 2)
int main()
static BearingRange Measure(const A1 &a1, const A2 &a2, OptionalJacobian< dimension, traits< A1 >::dimension > H1=boost::none, OptionalJacobian< dimension, traits< A2 >::dimension > H2=boost::none)
Prediction function that stacks measurements.
Definition: BearingRange.h:77
#define EXPECT(condition)
Definition: Test.h:151
TEST(BearingRange2D, Concept)
BearingRange< Pose2, Point2 > BearingRange2D
BearingRange3D br3D(Pose3().bearing(Point3(1, 0, 0)), 1)
traits
Definition: chartTesting.h:28
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Definition: Matrix.cpp:42
Bearing-Range product.
Vector3 Point3
Definition: Point3.h:35
2D Pose
3D Pose


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:46:15