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()
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
TEST(KarcherMean, FindRot3)
T FindKarcherMean(const std::vector< T > &rotations)
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
4*4 matrix representation of SO(4)
Pose2_ Expmap(const Vector3_ &xi)
NonlinearFactorGraph graph
Rot3 is a 3D rotation represented as a rotation matrix if the preprocessor symbol GTSAM_USE_QUATERNIO...
Rot3 inverse() const
inverse of a rotation
#define EXPECT(condition)
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