28 using namespace gtsam;
38 TEST(KarcherMean, FindRot3) {
39 std::vector<Rot3> rotations = {
R, R.
inverse()};
47 TEST(KarcherMean, FactorRot3) {
55 std::vector<Key>
keys{1, 2};
60 initial.insert<
Rot3>(2,
R);
65 FindKarcherMean<Rot3>({result.at<
Rot3>(1), result.at<
Rot3>(2)});
77 TEST(KarcherMean, FindSO4) {
78 std::vector<SO4, Eigen::aligned_allocator<SO4>> rotations = {
Q, Q.
inverse()};
85 TEST(KarcherMean, FactorSO4) {
88 std::vector<Key>
keys{1, 2};
93 initial.insert<
SO4>(2,
Q);
95 std::vector<SO4, Eigen::aligned_allocator<SO4> > rotations = {
Q, Q.
inverse()};
96 const auto expected = FindKarcherMean<SO4>(rotations);
100 FindKarcherMean<SO4>({result.at<
SO4>(1), result.at<
SO4>(2)});
virtual const Values & optimize()
static int runAllTests(TestResult &result)
Factor Graph consisting of non-linear factors.
TEST(KarcherMean, FindRot3)
4*4 matrix representation of SO(4)
Pose2_ Expmap(const Vector3_ &xi)
SO inverse() const
inverse of a rotation = transpose
NonlinearFactorGraph graph
Rot3 inverse() const
inverse of a rotation
T FindKarcherMean(const std::vector< T > &rotations)
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&...args)
Emplace a shared pointer to factor of given type.
#define EXPECT(condition)
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
The quaternion class used to represent 3D orientations and rotations.
Class between(const Class &g) const
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
3D rotation represented as a rotation matrix or quaternion