24 using namespace gtsam;
46 Matrix H1Expected, H2Expected;
47 H1Expected = numericalDerivative11<Vector2, Pose2>(
48 boost::bind(&DeltaFactor::evaluateError, &factor, _1, point, boost::none,
50 H2Expected = numericalDerivative11<Vector2, Point2>(
51 boost::bind(&DeltaFactor::evaluateError, &factor, pose, _1, boost::none,
68 Pose2 base1, base2(1, 0, 0);
74 Matrix H1Actual, H2Actual, H3Actual, H4Actual;
76 H2Actual, H3Actual, H4Actual);
80 Matrix H1Expected, H2Expected, H3Expected, H4Expected;
81 H1Expected = numericalDerivative11<Vector2, Pose2>(
82 boost::bind(&DeltaFactorBase::evaluateError, &factor, _1, pose, base2,
83 point, boost::none, boost::none, boost::none, boost::none), base1);
84 H2Expected = numericalDerivative11<Vector2, Pose2>(
85 boost::bind(&DeltaFactorBase::evaluateError, &factor, base1, _1, base2,
86 point, boost::none, boost::none, boost::none, boost::none),
pose);
87 H3Expected = numericalDerivative11<Vector2, Pose2>(
88 boost::bind(&DeltaFactorBase::evaluateError, &factor, base1, pose, _1,
89 point, boost::none, boost::none, boost::none, boost::none), base2);
90 H4Expected = numericalDerivative11<Vector2, Point2>(
91 boost::bind(&DeltaFactorBase::evaluateError, &factor, base1, pose, base2,
92 _1, boost::none, boost::none, boost::none, boost::none),
point);
110 Pose2 base1, base2(1, 0, 0);
115 Matrix H1Actual, H2Actual, H3Actual, H4Actual;
117 H2Actual, H3Actual, H4Actual);
121 Matrix H1Expected, H2Expected, H3Expected, H4Expected;
122 H1Expected = numericalDerivative11<Vector3, Pose2>(
123 boost::bind(&OdometryFactorBase::evaluateError, &factor, _1,
pose1, base2,
124 pose2, boost::none, boost::none, boost::none, boost::none), base1);
125 H2Expected = numericalDerivative11<Vector3, Pose2>(
126 boost::bind(&OdometryFactorBase::evaluateError, &factor, base1, _1, base2,
127 pose2, boost::none, boost::none, boost::none, boost::none),
pose1);
128 H3Expected = numericalDerivative11<Vector3, Pose2>(
129 boost::bind(&OdometryFactorBase::evaluateError, &factor, base1,
pose1, _1,
130 pose2, boost::none, boost::none, boost::none, boost::none), base2);
131 H4Expected = numericalDerivative11<Vector3, Pose2>(
132 boost::bind(&OdometryFactorBase::evaluateError, &factor, base1,
pose1,
133 base2, _1, boost::none, boost::none, boost::none, boost::none),
Vector evaluateError(const Pose2 &base1, const Pose2 &pose, const Pose2 &base2, const Point2 &point, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none, boost::optional< Matrix & > H3=boost::none, boost::optional< Matrix & > H4=boost::none) const override
Evaluate measurement error h(x)-z.
static int runAllTests(TestResult &result)
noiseModel::Diagonal::shared_ptr model
Some functions to compute numerical derivatives.
TSAM 1 Factors, simpler than the hierarchical TSAM 2.
static const Pose3 pose(Rot3(Vector3(1,-1,-1).asDiagonal()), Point3(0, 0, 0.5))
Vector evaluateError(const Pose2 &pose, const Point2 &point, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none) const override
Evaluate measurement error h(x)-z.
#define EXPECT(condition)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Vector evaluateError(const Pose2 &base1, const Pose2 &pose1, const Pose2 &base2, const Pose2 &pose2, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none, boost::optional< Matrix & > H3=boost::none, boost::optional< Matrix & > H4=boost::none) const override
Evaluate measurement error h(x)-z.
static const Pose3 pose1(Rot3(), Point3(0, 1, 0.5))
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
std::uint64_t Key
Integer nonlinear key type.
noiseModel::Base::shared_ptr SharedNoiseModel