34 using namespace gtsam;
47 TEST(FrobeniusPriorSO3, evaluateError) {
48 using namespace ::
so3;
60 TEST(FrobeniusPriorSO3, ClosestTo) {
63 M << 0.79067393, 0.6051136, -0.0930814,
64 0.4155925, -0.64214347, -0.64324489,
65 -0.44948549, 0.47046326, -0.75917576;
74 initial.insert(1,
SO3(I_3x3));
81 TEST(FrobeniusPriorSO3, ChordalL2mean) {
88 using namespace ::
so3;
107 TEST(FrobeniusFactorSO3, evaluateError) {
108 using namespace ::
so3;
138 TEST(FrobeniusBetweenFactorSO3, evaluateError) {
139 using namespace ::
so3;
154 Vector6 v1 = (
Vector(6) << 0.1, 0, 0, 0, 0, 0).finished();
156 Vector6 v2 = (
Vector(6) << 0.01, 0.02, 0.03, 0.04, 0.05, 0.06).finished();
161 TEST(FrobeniusFactorSO4, evaluateError) {
162 using namespace ::
so4;
175 TEST(FrobeniusBetweenFactorSO4, evaluateError) {
176 using namespace ::
so4;
Matrix< RealScalar, Dynamic, Dynamic > M
virtual const Values & optimize()
Provides convenient mappings of common member functions for testing.
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&... args)
Emplace a shared pointer to factor of given type.
static int runAllTests(TestResult &result)
Factor Graph consisting of non-linear factors.
SO inverse() const
inverse of a rotation = transpose
Vector evaluateError(const Rot &R1, const Rot &R2, OptionalMatrixType H1, OptionalMatrixType H2) const override
Error is just Frobenius norm between rotation matrices.
const ValueType at(Key j) const
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
4*4 matrix representation of SO(4)
Pose2_ Expmap(const Vector3_ &xi)
Evaluate derivatives of a nonlinear factor numerically.
3*3 matrix representation of SO(3)
NonlinearFactorGraph graph
#define EXPECT_DOUBLES_EQUAL(expected, actual, threshold)
static const Similarity3 id
const MatrixNN & matrix() const
Return matrix.
#define EXPECT(condition)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Vector evaluateError(const Rot &R, OptionalMatrixType H) const override
Error is just Frobenius norm between Rot element and vectorized matrix M.
double error(const Values &values) const
Various factors that minimize some Frobenius norm.
TEST(FrobeniusPriorSO3, 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
Vector evaluateError(const Rot &R1, const Rot &R2, OptionalMatrixType H1, OptionalMatrixType H2) const override
Error is Frobenius norm between R1*R12 and R2.
void insert(Key j, const Value &val)
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
VectorN2 vec(OptionalJacobian< internal::NSquaredSO(N), dimension > H={}) const