14 using namespace gtsam;
32 TEST( testRelativeElevationFactor, level_zero_error ) {
38 Matrix expH1 = numericalDerivative21<Vector,Pose3,Point3>(
40 Matrix expH2 = numericalDerivative22<Vector,Pose3,Point3>(
47 TEST( testRelativeElevationFactor, level_positive ) {
53 Matrix expH1 = numericalDerivative21<Vector,Pose3,Point3>(
55 Matrix expH2 = numericalDerivative22<Vector,Pose3,Point3>(
62 TEST( testRelativeElevationFactor, level_negative ) {
68 Matrix expH1 = numericalDerivative21<Vector,Pose3,Point3>(
70 Matrix expH2 = numericalDerivative22<Vector,Pose3,Point3>(
77 TEST( testRelativeElevationFactor, rotated_zero_error ) {
83 Matrix expH1 = numericalDerivative21<Vector,Pose3,Point3>(
85 Matrix expH2 = numericalDerivative22<Vector,Pose3,Point3>(
92 TEST( testRelativeElevationFactor, rotated_positive ) {
98 Matrix expH1 = numericalDerivative21<Vector,Pose3,Point3>(
100 Matrix expH2 = numericalDerivative22<Vector,Pose3,Point3>(
107 TEST( testRelativeElevationFactor, rotated_negative1 ) {
113 Matrix expH1 = numericalDerivative21<Vector,Pose3,Point3>(
115 Matrix expH2 = numericalDerivative22<Vector,Pose3,Point3>(
122 TEST( testRelativeElevationFactor, rotated_negative2 ) {
128 Matrix expH1 = numericalDerivative21<Vector,Pose3,Point3>(
130 Matrix expH2 = numericalDerivative22<Vector,Pose3,Point3>(
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))
static Rot3 Pitch(double t)
Positive pitch is up (increasing aircraft altitude).See ypr.
const Pose3 pose1(Rot3(), Point3(2.0, 3.0, 4.0))
Some functions to compute numerical derivatives.
static Rot3 RzRyRx(double x, double y, double z, OptionalJacobian< 3, 1 > Hx=boost::none, OptionalJacobian< 3, 1 > Hy=boost::none, OptionalJacobian< 3, 1 > Hz=boost::none)
Rotations around Z, Y, then X axes as in http://en.wikipedia.org/wiki/Rotation_matrix, counterclockwise when looking from unchanging axis.
const gtsam::Key pointKey
static shared_ptr Create(size_t dim)
Vector evaluateError(const Pose3 &pose, const Point3 &point, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none) const override
#define EXPECT(condition)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Factor representing a known relative altitude in global frame.
TEST(LPInitSolver, InfiniteLoopSingleVar)
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
std::uint64_t Key
Integer nonlinear key type.
Vector evalFactorError(const RelativeElevationFactor &factor, const Pose3 &x, const Point3 &p)
noiseModel::Base::shared_ptr SharedNoiseModel