Go to the documentation of this file.
31 using namespace gtsam;
53 auto Q = SO4::Random(
rng);
60 Vector6
v1 = (
Vector(6) << 0, 0, 0, 0.1, 0, 0).finished();
62 Vector6
v2 = (
Vector(6) << 0.00, 0.00, 0.00, 0.01, 0.02, 0.03).finished();
64 Vector6
v3 = (
Vector(6) << 1, 2, 3, 4, 5, 6).finished();
72 EXPECT((
Q1.matrix().topLeftCorner<3, 3>().isApprox(
R1)));
76 EXPECT((
Q2.matrix().topLeftCorner<3, 3>().isApprox(
R2)));
79 for (
size_t i = 0;
i < 6;
i++) {
80 Vector6
xi = Vector6::Zero();
100 auto X1 = SOn::Hat(
v1),
X2 = SOn::Hat(
v2),
X3 = SOn::Hat(
v3);
116 auto v = Vector6::Zero();
129 auto v0 = Vector6::Zero();
136 EXPECT(check_group_invariants(
id,
id));
137 EXPECT(check_group_invariants(
id,
Q1));
138 EXPECT(check_group_invariants(
Q2,
id));
142 EXPECT(check_manifold_invariants(
id,
id));
143 EXPECT(check_manifold_invariants(
id,
Q1));
144 EXPECT(check_manifold_invariants(
Q2,
id));
152 Matrix actualH1, actualH2;
153 SO4 actual =
Q1.compose(
Q2, actualH1, actualH2);
170 const Vector16 actual =
Q2.vec(actualH);
172 std::function<Vector16(
const SO4&)>
f = [](
const SO4&
Q) {
return Q.vec(); };
179 const Matrix3
expected = Q3.matrix().topLeftCorner<3, 3>();
181 const Matrix3 actual =
topLeft(Q3, actualH);
183 std::function<Matrix3(
const SO4&)>
f = [](
const SO4& Q3) {
192 const Matrix43
expected = Q3.matrix().leftCols<3>();
194 const Matrix43 actual =
stiefel(Q3, actualH);
196 std::function<Matrix43(
const SO4&)>
f = [](
const SO4& Q3) {
static int runAllTests(TestResult &result)
GTSAM_EXPORT Matrix3 topLeft(const SO4 &Q, OptionalJacobian< 9, 6 > H)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
GTSAM_EXPORT Matrix43 stiefel(const SO4 &Q, OptionalJacobian< 12, 6 > H)
#define EXPECT_LONGS_EQUAL(expected, actual)
Concept check for values that can be used in unit tests.
#define EXPECT(condition)
internal::FixedSizeMatrix< Y, X >::type numericalDerivative11(std::function< Y(const X &)> h, const X &x, double delta=1e-5)
New-style numerical derivatives using manifold_traits.
internal::FixedSizeMatrix< Y, X2 >::type numericalDerivative22(std::function< Y(const X1 &, const X2 &)> h, const X1 &x1, const X2 &x2, double delta=1e-5)
def retract(a, np.ndarray xi)
4*4 matrix representation of SO(4)
3*3 matrix representation of SO(3)
Pose2_ Expmap(const Vector3_ &xi)
static const Similarity3 id
Some functions to compute numerical derivatives.
Base class and basic functions for Manifold types.
A matrix or vector expression mapping an existing array of data.
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
The quaternion class used to represent 3D orientations and rotations.
T compose(const T &t1, const T &t2)
internal::FixedSizeMatrix< Y, X1 >::type numericalDerivative21(const std::function< Y(const X1 &, const X2 &)> &h, const X1 &x1, const X2 &x2, double delta=1e-5)
Array< int, Dynamic, 1 > v
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
The matrix class, also used for vectors and row-vectors.
Provides convenient mappings of common member functions for testing.
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
#define GTSAM_CONCEPT_ASSERT(concept)
Rot2 R(Rot2::fromAngle(0.1))
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:08:43