15 using namespace gtsam;
33 TEST( testRelativeElevationFactor, level_zero_error ) {
39 Matrix expH1 = numericalDerivative21<Vector, Pose3, Point3>(
41 std::placeholders::_2),
43 Matrix expH2 = numericalDerivative22<Vector, Pose3, Point3>(
45 std::placeholders::_2),
52 TEST( testRelativeElevationFactor, level_positive ) {
58 Matrix expH1 = numericalDerivative21<Vector, Pose3, Point3>(
60 std::placeholders::_2),
62 Matrix expH2 = numericalDerivative22<Vector, Pose3, Point3>(
64 std::placeholders::_2),
71 TEST( testRelativeElevationFactor, level_negative ) {
77 Matrix expH1 = numericalDerivative21<Vector, Pose3, Point3>(
79 std::placeholders::_2),
81 Matrix expH2 = numericalDerivative22<Vector, Pose3, Point3>(
83 std::placeholders::_2),
90 TEST( testRelativeElevationFactor, rotated_zero_error ) {
96 Matrix expH1 = numericalDerivative21<Vector, Pose3, Point3>(
98 std::placeholders::_2),
100 Matrix expH2 = numericalDerivative22<Vector, Pose3, Point3>(
102 std::placeholders::_2),
109 TEST( testRelativeElevationFactor, rotated_positive ) {
115 Matrix expH1 = numericalDerivative21<Vector, Pose3, Point3>(
117 std::placeholders::_2),
119 Matrix expH2 = numericalDerivative22<Vector, Pose3, Point3>(
121 std::placeholders::_2),
128 TEST( testRelativeElevationFactor, rotated_negative1 ) {
134 Matrix expH1 = numericalDerivative21<Vector, Pose3, Point3>(
136 std::placeholders::_2),
138 Matrix expH2 = numericalDerivative22<Vector, Pose3, Point3>(
140 std::placeholders::_2),
147 TEST( testRelativeElevationFactor, rotated_negative2 ) {
153 Matrix expH1 = numericalDerivative21<Vector, Pose3, Point3>(
155 std::placeholders::_2),
157 Matrix expH2 = numericalDerivative22<Vector, Pose3, Point3>(
159 std::placeholders::_2),
const Pose3 pose2(Rot3::Pitch(-M_PI_2), Point3(2.0, 3.0, 4.0))
static int runAllTests(TestResult &result)
const Pose3 pose3(Rot3::RzRyRx(0.1, 0.2, 0.3), Point3(2.0, 3.0, 4.0))
TEST(testRelativeElevationFactor, level_zero_error)
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
const Pose3 pose1(Rot3(), Point3(2.0, 3.0, 4.0))
Some functions to compute numerical derivatives.
Rot3 is a 3D rotation represented as a rotation matrix if the preprocessor symbol GTSAM_USE_QUATERNIO...
const gtsam::Key pointKey
#define EXPECT(condition)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Factor representing a known relative altitude in global frame.
const Point3 point1(3.0, 4.0, 2.0)
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
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
Vector evaluateError(const Pose3 &pose, const Point3 &point, OptionalMatrixType H1, OptionalMatrixType H2) const override
std::uint64_t Key
Integer nonlinear key type.
Vector evalFactorError(const RelativeElevationFactor &factor, const Pose3 &x, const Point3 &p)
noiseModel::Base::shared_ptr SharedNoiseModel