35 using namespace gtsam;
50 Vector6 v1 = (
Vector(6) << 0, 0, 0, 0.1, 0, 0).finished();
53 Vector6 v2 = (
Vector(6) << 0, 0, 0, 0.01, 0.02, 0.03).finished();
61 auto model = noiseModel::Isotropic::Sigma(3, 1.2);
62 for (
const size_t p : {5, 4, 3}) {
70 factor.evaluateError(Q1, Q2, H1, H2);
84 auto model = noiseModel::Isotropic::Sigma(6, 1.2);
87 const Matrix3 E3(
factor3.evaluateError(R1, R2).data());
96 auto model = noiseModel::Isotropic::Sigma(1, 1.2);
98 for (
const size_t p : {5, 4, 3, 2}) {
100 M.topLeftCorner(2, 2) = R1.
matrix();
102 M.topLeftCorner(2, 2) = R2.
matrix();
106 factor.evaluateError(Q1, Q2, H1, H2);
Matrix< RealScalar, Dynamic, Dynamic > M
Main factor type in Shonan averaging, on SO(n) pairs.
Provides convenient mappings of common member functions for testing.
static int runAllTests(TestResult &result)
Factor Graph consisting of non-linear factors.
noiseModel::Diagonal::shared_ptr model
void insert(Key j, const Value &val)
4*4 matrix representation of SO(4)
Pose2_ Expmap(const Vector3_ &xi)
const MatrixNN & matrix() const
Return matrix.
Evaluate derivatives of a nonlinear factor numerically.
3*3 matrix representation of SO(3)
JacobianFactor factor3(keyY, A32, keyZ, A33, b3, noiseModel::Isotropic::Sigma(2, sigma3))
ShonanFactor< 3 > ShonanFactor3
#define EXPECT(condition)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Various factors that minimize some Frobenius norm.
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Vector evaluateError(const Rot &R1, const Rot &R2, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none) const override
Error is Frobenius norm between R1*R12 and R2.
Class retract(const TangentVector &v) const
retract as required by manifold concept: applies v at *this
TEST(ShonanFactor3, evaluateError)
#define EXPECT_CORRECT_FACTOR_JACOBIANS(factor, values, numerical_derivative_step, tolerance)
Check the Jacobians produced by a factor against finite differences.
Class between(const Class &g) const
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
3D rotation represented as a rotation matrix or quaternion
ShonanFactor< 2 > ShonanFactor2