testSimulated2D.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 
19 #include <iostream>
21 
22 #include <gtsam/base/Testable.h>
24 #include <tests/simulated2D.h>
25 
26 using namespace std;
27 using namespace gtsam;
28 using namespace simulated2D;
29 
30 /* ************************************************************************* */
31 TEST( simulated2D, Simulated2DValues )
32 {
33  simulated2D::Values actual;
34  actual.insert(1,Point2(1,1));
35  actual.insert(2,Point2(2,2));
36  EXPECT(assert_equal(actual,actual,1e-9));
37 }
38 
39 /* ************************************************************************* */
40 TEST( simulated2D, Dprior )
41 {
42  Point2 x(1,-9);
44  Matrix computed;
45  simulated2D::prior(x,computed);
46  EXPECT(assert_equal(numerical,computed,1e-9));
47 }
48 
49 /* ************************************************************************* */
50  TEST( simulated2D, DOdo )
51 {
52  Point2 x1(1,-9),x2(-5,6);
53  Matrix H1,H2;
54  simulated2D::odo(x1,x2,H1,H2);
56  EXPECT(assert_equal(A1,H1,1e-9));
58  EXPECT(assert_equal(A2,H2,1e-9));
59 }
60 
61 /* ************************************************************************* */
62 int main() { TestResult tr; return TestRegistry::runAllTests(tr);}
63 /* ************************************************************************* */
Concept check for values that can be used in unit tests.
static int runAllTests(TestResult &result)
Point2 prior(const Point2 &x)
Prior on a single pose.
Definition: simulated2D.h:87
void insert(Key j, const Value &val)
Definition: Values.cpp:140
Point2 odo(const Point2 &x1, const Point2 &x2)
odometry between two poses
Definition: simulated2D.h:98
Vector2 Point2
Definition: Point2.h:27
Eigen::MatrixXd Matrix
Definition: base/Matrix.h:43
Definition: Half.h:150
Some functions to compute numerical derivatives.
Pose3 x2(Rot3::Ypr(0.0, 0.0, 0.0), l2)
internal::FixedSizeMatrix< Y, X1 >::type numericalDerivative21(const boost::function< Y(const X1 &, const X2 &)> &h, const X1 &x1, const X2 &x2, double delta=1e-5)
int main()
internal::FixedSizeMatrix< Y, X2 >::type numericalDerivative22(boost::function< Y(const X1 &, const X2 &)> h, const X1 &x1, const X2 &x2, double delta=1e-5)
#define EXPECT(condition)
Definition: Test.h:151
Array< double, 1, 3 > e(1./3., 0.5, 2.)
traits
Definition: chartTesting.h:28
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Definition: Matrix.cpp:42
measurement functions and derivatives for simulated 2D robot
Pose3 x1
Definition: testPose3.cpp:588
internal::FixedSizeMatrix< Y, X >::type numericalDerivative11(boost::function< Y(const X &)> h, const X &x, double delta=1e-5)
New-style numerical derivatives using manifold_traits.
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
TEST(simulated2D, Simulated2DValues)


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:49:32