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()
VectorN2 vec(OptionalJacobian< internal::NSquaredSO(N), dimension > H=boost::none) const
Vector evaluateError(const Rot &R, boost::optional< Matrix & > H=boost::none) const override
Error is just Frobenius norm between Rot element and vectorized matrix M.
Provides convenient mappings of common member functions for testing.
static int runAllTests(TestResult &result)
Factor Graph consisting of non-linear factors.
void insert(Key j, const Value &val)
4*4 matrix representation of SO(4)
Pose2_ Expmap(const Vector3_ &xi)
Vector evaluateError(const Rot &R1, const Rot &R2, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none) const override
Error is just Frobenius norm between rotation matrices.
const MatrixNN & matrix() const
Return matrix.
Evaluate derivatives of a nonlinear factor numerically.
SO inverse() const
inverse of a rotation = transpose
3*3 matrix representation of SO(3)
NonlinearFactorGraph graph
#define EXPECT_DOUBLES_EQUAL(expected, actual, threshold)
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&...args)
Emplace a shared pointer to factor of given type.
const ValueType at(Key j) const
#define EXPECT(condition)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Q R1(Eigen::AngleAxisd(1, Q_z_axis))
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.
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
double error(const Values &values) 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
Q R2(Eigen::AngleAxisd(2, Vector3(0, 1, 0)))
3D rotation represented as a rotation matrix or quaternion