gtsam
Loading...
Searching...
No Matches
SO4.h
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2
3 * GTSAM Copyright 2010-2019, Georgia Tech Research Corporation,
4 * Atlanta, Georgia 30332-0415
5 * All Rights Reserved
6 * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7
8 * See LICENSE for the license information
9
10 * -------------------------------------------------------------------------- */
11
19
20#pragma once
21
22#include <gtsam/geometry/SOn.h>
23
24#include <gtsam/base/Group.h>
25#include <gtsam/base/Lie.h>
26#include <gtsam/base/Manifold.h>
27#include <gtsam/base/Matrix.h>
28#include <gtsam/dllexport.h>
29
30#include <string>
31
32namespace gtsam {
33
34using SO4 = SO<4>;
35
36// /// Random SO(4) element (no big claims about uniformity)
37// static SO4 Random(std::mt19937 &rng);
38
39// Below are all declarations of SO<4> specializations.
40// They are *defined* in SO4.cpp.
41
42template <>
43GTSAM_EXPORT
44Matrix4 SO4::Hat(const TangentVector &xi);
45
46template <>
47GTSAM_EXPORT
48Vector6 SO4::Vee(const Matrix4 &X);
49
50template <>
51GTSAM_EXPORT
52SO4 SO4::Expmap(const Vector6 &xi);
53
54template <>
55GTSAM_EXPORT
56SO4::VectorN2 SO4::vec(OptionalJacobian<16, 6> H) const;
57
58template <>
59GTSAM_EXPORT
60SO4 SO4::ChartAtOrigin::Retract(const Vector6 &omega);
61
62template <>
63GTSAM_EXPORT
64Vector6 SO4::ChartAtOrigin::Local(const SO4 &Q);
65
69GTSAM_EXPORT Matrix3 topLeft(const SO4 &Q, OptionalJacobian<9, 6> H = {});
70
75GTSAM_EXPORT Matrix43 stiefel(const SO4 &Q, OptionalJacobian<12, 6> H = {});
76
77#if GTSAM_ENABLE_BOOST_SERIALIZATION
78template <class Archive>
80void serialize(Archive &ar, SO4 &Q, const unsigned int /*version*/) {
81 Matrix4 &M = Q.matrix_;
82 ar &boost::serialization::make_nvp("Q11", M(0, 0));
83 ar &boost::serialization::make_nvp("Q12", M(0, 1));
84 ar &boost::serialization::make_nvp("Q13", M(0, 2));
85 ar &boost::serialization::make_nvp("Q14", M(0, 3));
86
87 ar &boost::serialization::make_nvp("Q21", M(1, 0));
88 ar &boost::serialization::make_nvp("Q22", M(1, 1));
89 ar &boost::serialization::make_nvp("Q23", M(1, 2));
90 ar &boost::serialization::make_nvp("Q24", M(1, 3));
91
92 ar &boost::serialization::make_nvp("Q31", M(2, 0));
93 ar &boost::serialization::make_nvp("Q32", M(2, 1));
94 ar &boost::serialization::make_nvp("Q33", M(2, 2));
95 ar &boost::serialization::make_nvp("Q34", M(2, 3));
96
97 ar &boost::serialization::make_nvp("Q41", M(3, 0));
98 ar &boost::serialization::make_nvp("Q42", M(3, 1));
99 ar &boost::serialization::make_nvp("Q43", M(3, 2));
100 ar &boost::serialization::make_nvp("Q44", M(3, 3));
101}
102#endif
103
104/*
105 * Define the traits. internal::MatrixLieGroup provides both Lie group and Testable
106 */
107
108template <>
109struct traits<SO4> : public internal::MatrixLieGroup<SO4, 4> {};
110
111template <>
112struct traits<const SO4> : public internal::MatrixLieGroup<SO4, 4> {};
113
114} // end namespace gtsam
typedef and functions to augment Eigen's MatrixXd
Concept check class for variable types with Group properties.
Base class and basic functions for Manifold types.
Base class and basic functions for Lie types.
N*N matrix representation of SO(N).
Global functions in a separate testing namespace.
Definition chartTesting.h:28
GTSAM_EXPORT Matrix43 stiefel(const SO4 &Q, OptionalJacobian< 12, 6 > H)
Project to Stiefel manifold of 4*3 orthonormal 3-frames in R^4, i.e., pi(Q) -> .
Definition SO4.cpp:198
GTSAM_EXPORT Matrix3 topLeft(const SO4 &Q, OptionalJacobian< 9, 6 > H)
Project to top-left 3*3 matrix.
Definition SO4.cpp:184
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition Group.h:37
static SO< N > Retract(const TangentVector &v)
Definition Lie.h:193
Both LieGroupTraits and Testable.
Definition MatrixLieGroup.h:350
OptionalJacobian is an Eigen::Ref like class that can take be constructed using either a fixed size o...
Definition OptionalJacobian.h:40
Manifold of special orthogonal rotation matrices SO<N>.
Definition SOn.h:55
static TangentVector Vee(const MatrixNN &X)
VectorN2 vec(OptionalJacobian< internal::NSquaredSO(N), dimension > H={}) const
Definition SOn.h:306
static SO Expmap(const TangentVector &omega)
static MatrixNN Hat(const TangentVector &xi)