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 /* ************************************************************************* */
TestRegistry::runAllTests
static int runAllTests(TestResult &result)
Definition: TestRegistry.cpp:27
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Testable.h
Concept check for values that can be used in unit tests.
EXPECT
#define EXPECT(condition)
Definition: Test.h:150
simulated2D
Definition: simulated2D.h:28
TestHarness.h
x
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
Definition: gnuplot_common_settings.hh:12
gtsam::numericalDerivative11
internal::FixedSizeMatrix< Y, X >::type numericalDerivative11(std::function< Y(const X &)> h, const X &x, double delta=1e-5)
New-style numerical derivatives using manifold_traits.
Definition: numericalDerivative.h:110
gtsam::numericalDerivative22
internal::FixedSizeMatrix< Y, X2 >::type numericalDerivative22(std::function< Y(const X1 &, const X2 &)> h, const X1 &x1, const X2 &x2, double delta=1e-5)
Definition: numericalDerivative.h:195
gtsam::Matrix
Eigen::MatrixXd Matrix
Definition: base/Matrix.h:39
numericalDerivative.h
Some functions to compute numerical derivatives.
x1
Pose3 x1
Definition: testPose3.cpp:663
A2
static const double A2[]
Definition: expn.h:7
gtsam::Point2
Vector2 Point2
Definition: Point2.h:32
TestResult
Definition: TestResult.h:26
simulated2D.h
measurement functions and derivatives for simulated 2D robot
TEST
TEST(simulated2D, Simulated2DValues)
Definition: testSimulated2D.cpp:31
simulated2D::prior
Point2 prior(const Point2 &x)
Prior on a single pose.
Definition: simulated2D.h:88
gtsam
traits
Definition: chartTesting.h:28
gtsam::Values
Definition: Values.h:65
gtsam::numericalDerivative21
internal::FixedSizeMatrix< Y, X1 >::type numericalDerivative21(const std::function< Y(const X1 &, const X2 &)> &h, const X1 &x1, const X2 &x2, double delta=1e-5)
Definition: numericalDerivative.h:166
std
Definition: BFloat16.h:88
simulated2D::odo
Point2 odo(const Point2 &x1, const Point2 &x2)
odometry between two poses
Definition: simulated2D.h:99
A1
static const double A1[]
Definition: expn.h:6
gtsam::Values::insert
void insert(Key j, const Value &val)
Definition: Values.cpp:155
gtsam::assert_equal
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Definition: Matrix.cpp:40
x2
Pose3 x2(Rot3::Ypr(0.0, 0.0, 0.0), l2)
main
int main()
Definition: testSimulated2D.cpp:62


gtsam
Author(s):
autogenerated on Thu Jun 13 2024 03:10:25