31 using namespace gtsam;
52 Vector6
v1 = (
Vector(6) << 0, 0, 0, 0.1, 0, 0).finished();
54 Vector6
v2 = (
Vector(6) << 0.00, 0.00, 0.00, 0.01, 0.02, 0.03).finished();
56 Vector6
v3 = (
Vector(6) << 1, 2, 3, 4, 5, 6).finished();
62 auto Q = SO4::Random(rng);
76 for (
size_t i = 0;
i < 6;
i++) {
77 Vector6
xi = Vector6::Zero();
97 auto X1 = SOn::Hat(
v1),
X2 = SOn::Hat(v2),
X3 = SOn::Hat(v3);
113 auto v = Vector6::Zero();
126 auto v0 = Vector6::Zero();
133 EXPECT(check_group_invariants(
id,
id));
134 EXPECT(check_group_invariants(
id, Q1));
135 EXPECT(check_group_invariants(Q2,
id));
136 EXPECT(check_group_invariants(Q2, Q1));
137 EXPECT(check_group_invariants(Q1, Q2));
139 EXPECT(check_manifold_invariants(
id,
id));
140 EXPECT(check_manifold_invariants(
id, Q1));
141 EXPECT(check_manifold_invariants(Q2,
id));
142 EXPECT(check_manifold_invariants(Q2, Q1));
143 EXPECT(check_manifold_invariants(Q1, Q2));
149 Matrix actualH1, actualH2;
150 SO4 actual = Q1.
compose(Q2, actualH1, actualH2);
167 const Vector16 actual = Q2.
vec(actualH);
169 boost::function<Vector16(const SO4&)>
f = [](
const SO4&
Q) {
180 const Matrix3 actual =
topLeft(Q3, actualH);
182 boost::function<Matrix3(const SO4&)>
f = [](
const SO4&
Q3) {
193 const Matrix43 actual =
stiefel(Q3, actualH);
195 boost::function<Matrix43(const SO4&)>
f = [](
const SO4&
Q3) {
VectorN2 vec(OptionalJacobian< internal::NSquaredSO(N), dimension > H=boost::none) const
Concept check for values that can be used in unit tests.
Provides convenient mappings of common member functions for testing.
static int runAllTests(TestResult &result)
A matrix or vector expression mapping an existing array of data.
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rows() const
BOOST_CONCEPT_ASSERT((boost::RandomAccessRangeConcept< ListOfOneContainer< int > >))
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar * data() const
Rot2 R(Rot2::fromAngle(0.1))
4*4 matrix representation of SO(4)
Pose2_ Expmap(const Vector3_ &xi)
Some functions to compute numerical derivatives.
const MatrixNN & matrix() const
Return matrix.
internal::FixedSizeMatrix< Y, X1 >::type numericalDerivative21(const boost::function< Y(const X1 &, const X2 &)> &h, const X1 &x1, const X2 &x2, double delta=1e-5)
3*3 matrix representation of SO(3)
T compose(const T &t1, const T &t2)
EIGEN_DEVICE_FUNC const VectorBlock< const Coefficients, 3 > vec() const
EIGEN_DEVICE_FUNC RotationMatrixType matrix() const
Class compose(const Class &g) const
internal::FixedSizeMatrix< Y, X2 >::type numericalDerivative22(boost::function< Y(const X1 &, const X2 &)> h, const X1 &x1, const X2 &x2, double delta=1e-5)
Base class and basic functions for Manifold types.
GTSAM_EXPORT Matrix43 stiefel(const SO4 &Q, OptionalJacobian< 12, 6 > H)
#define EXPECT(condition)
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
GTSAM_EXPORT Matrix3 topLeft(const SO4 &Q, OptionalJacobian< 9, 6 > H)
Q R1(Eigen::AngleAxisd(1, Q_z_axis))
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
#define EXPECT_LONGS_EQUAL(expected, actual)
The quaternion class used to represent 3D orientations and rotations.
internal::FixedSizeMatrix< Y, X >::type numericalDerivative11(boost::function< Y(const X &)> h, const X &x, double delta=1e-5)
New-style numerical derivatives using manifold_traits.
The matrix class, also used for vectors and row-vectors.
EIGEN_DEVICE_FUNC bool isApprox(const Scalar &x, const Scalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
Q R2(Eigen::AngleAxisd(2, Vector3(0, 1, 0)))