36 #include <type_traits>
39 using namespace gtsam;
44 const auto R =
SOn(0);
55 const auto R =
SOn(5);
94 const auto R =
SOn(5);
102 const auto R =
SOn(5);
113 static std::mt19937
rng(42);
122 v << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
125 expected2 << 0, -1, 1, 0;
126 const auto actual2 = SOn::Hat(
v.head<1>());
131 expected3 << 0, -3, 2,
134 const auto actual3 = SOn::Hat(
v.head<3>());
140 expected4 << 0, -6, 5, 3,
144 const auto actual4 = SOn::Hat(
v.head<6>());
149 expected5 << 0, -10, 9, 7, -4,
154 const auto actual5 = SOn::Hat(
v);
161 Vector6
v1 = (
Vector(6) << 0, 0, 0, 1, 0, 0).finished() / 10000;
162 Vector6
v2 = (
Vector(6) << 0, 0, 0, 1, 2, 3).finished() / 10000;
163 Vector6
v3 = (
Vector(6) << 3, 2, 1, 1, 2, 3).finished() / 10000;
193 return SOn::ChartAtOrigin::Retract(
v).matrix();
197 const Matrix expectedH = numericalDerivative11<Matrix, Vector, 3>(
h,
v, 1
e-5);
204 v << 0, 0, 0, 0, 1, 2, 3, 4, 5, 6;
205 SOn Q = SOn::ChartAtOrigin::Retract(
v);
207 const Vector actual =
Q.vec(actualH);
208 std::function<
Vector(
const SOn &)>
h = [](
const SOn &
Q) {
return Q.vec(); };
209 const Matrix H = numericalDerivative11<Vector, SOn, 10>(
h,
Q, 1
e-5);
217 CHECK(actual2.rows()==4 && actual2.cols()==1)
221 CHECK(actual3.rows()==9 && actual3.cols()==3)
223 CHECK(actual4.rows()==16 && actual4.cols()==6)
226 auto actual5 = SOn::VectorizedGenerators(5);
227 CHECK(actual5.rows()==25 && actual5.cols()==10)