29 using namespace gtsam;
92 Pose3 body_P_sensor2(Rot3::RzRyRx(-M_PI_2, 0.0, -M_PI_2),
Point3(0.30, -0.10, 1.0));
108 #if defined(GTSAM_ROT3_EXPMAP) || defined(GTSAM_USE_QUATERNIONS) 109 expectedError << -0.0298135267953815,
112 #if defined(GTSAM_POSE3_EXPMAP) 122 expectedError << -0.029839512616488,
152 #if defined(GTSAM_ROT3_EXPMAP) || defined(GTSAM_USE_QUATERNIONS) 153 expectedError << 0.0173358202010741,
156 #if defined(GTSAM_POSE3_EXPMAP) 159 0.000175859555693563;
166 expectedError << 0.017337193670445,
197 Pose3 pose2(Rot3::RzRyRx(0.179693265735950, 0.002945368776519, 0.102274823253840),
198 Point3(-3.37493895, 6.14660244, -8.93650986));
201 Matrix expectedH1 = numericalDerivative11<Vector, Pose3>(
202 [&factor, &
pose2](
const Pose3&
p) {
return factor.evaluateError(
p, pose2); },
pose1);
203 Matrix expectedH2 = numericalDerivative11<Vector, Pose3>(
204 [&factor, &
pose1](
const Pose3&
p) {
return factor.evaluateError(pose1,
p); },
pose2);
209 factor.evaluateError(pose1, pose2, actualH1, actualH2);
228 Pose3 pose2(Rot3::RzRyRx(0.162672458989103, 0.013665177349534, 0.224649482928184),
229 Point3(-3.5257579, 6.02637531, -8.98382384));
232 Matrix expectedH1 = numericalDerivative11<Vector, Pose3>(
233 [&factor, &
pose2](
const Pose3&
p) {
return factor.evaluateError(
p, pose2); },
pose1);
234 Matrix expectedH2 = numericalDerivative11<Vector, Pose3>(
235 [&factor, &
pose1](
const Pose3&
p) {
return factor.evaluateError(pose1,
p); },
pose2);
240 Vector error = factor.evaluateError(pose1, pose2, actualH1, actualH2);
Provides additional testing facilities for common data structures.
static int runAllTests(TestResult &result)
noiseModel::Diagonal::shared_ptr model
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
static Pose3 body_P_sensor(Rot3::RzRyRx(-M_PI_2, 0.0, -M_PI_2), Point3(0.25, -0.10, 1.0))
Some functions to compute numerical derivatives.
Vector evaluateError(const POSE &p1, const POSE &p2, OptionalMatrixType H1, OptionalMatrixType H2) const override
static Point2 measurement2(200.0, 220.0)
static Point2 measurement(323.0, 240.0)
bool assert_inequal(const Matrix &A, const Matrix &B, double tol)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static const Pose3 pose1(Rot3(), Point3(0, 1, 0.5))
static Key poseKey1(X(1))
PoseBetweenFactor< Pose3 > TestPoseBetweenFactor
static Key poseKey2(X(2))
std::uint64_t Key
Integer nonlinear key type.
noiseModel::Base::shared_ptr SharedNoiseModel
TEST(PoseBetweenFactor, Constructor)