gtsam
Loading...
Searching...
No Matches
SL4.h
Go to the documentation of this file.
1
6
7#pragma once
8
9#include <gtsam/base/Matrix.h>
12#include <gtsam/base/Vector.h>
13#include <gtsam/config.h>
14#include <gtsam/dllexport.h>
15
16#if GTSAM_ENABLE_BOOST_SERIALIZATION
18#endif
19
20#include <string>
21
22using SL4Jacobian = gtsam::OptionalJacobian<15, 15>;
23
24using Matrix15x15 = Eigen::Matrix<double, 15, 15>;
25using Matrix16x16 = Eigen::Matrix<double, 16, 16>;
26
27namespace gtsam {
28// NOTE(hlim): Strictly speaking, it should be expressed as SL(4, ℝ),
29// but for simplicity, we omit ℝ, assuming our target is over the real numbers.
30// And the variable `sl4` represents SL(4, ℝ).
31class GTSAM_EXPORT SL4 : public MatrixLieGroup<SL4, 15, 4> {
32 public:
33 static const size_t dimension = 15;
34
35 protected:
36 Matrix44 T_;
37
38 public:
41
43 SL4() : T_(Matrix44::Identity()) {}
44
46 SL4(const Matrix44& pose);
47
48 SL4(const SL4& pose) = default;
49
50 SL4& operator=(const SL4& pose) = default;
51
53 void print(const std::string& s = "") const;
54
56 bool equals(const SL4& sl4, double tol = 1e-9) const;
57
59 inline const Matrix44& matrix() const { return T_; }
60
64
66 static SL4 Identity() { return SL4(); }
67
69 SL4 inverse() const { return SL4(T_.inverse()); }
70
72 SL4 operator*(const SL4& other) const { return SL4(T_ * other.T_); }
73
77
78 // compose and between provided by LieGroup
79
81 Matrix15x15 AdjointMap() const;
82
84 using LieGroup<SL4, 15>::inverse;
85
87 static SL4 Expmap(const Vector& xi);
88
90 static Vector Logmap(const SL4& p);
91
92 // Chart at origin
93 struct GTSAM_EXPORT ChartAtOrigin {
94 static SL4 Retract(const Vector15& xi);
95 static Vector15 Local(const SL4& pose);
96 };
97
98 // retract and localCoordinates provided by LieGroup
99
103
104 using LieAlgebra = Matrix44;
124 static Matrix44 Hat(const Vector& xi);
125 static Vector Vee(const Matrix44& X);
126
128
129 private:
130#if GTSAM_ENABLE_BOOST_SERIALIZATION
132 friend class boost::serialization::access;
133 template <class Archive>
134 void serialize(Archive& ar, const unsigned int /*version*/) {
135 ar& BOOST_SERIALIZATION_NVP(T_);
136 }
137#endif
138}; // \class SL4
139
140template <>
141struct traits<SL4> : public internal::MatrixLieGroup<SL4, 4> {};
142
143template <>
144struct traits<const SL4> : public internal::MatrixLieGroup<SL4, 4> {};
145
146} // namespace gtsam
Base class and basic functions for Matrix Lie groups.
typedef and functions to augment Eigen's MatrixXd
Serialization for matrices.
Special class for optional Jacobian arguments.
typedef and functions to augment Eigen's VectorXd
Global functions in a separate testing namespace.
Definition chartTesting.h:28
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition Matrix.cpp:143
@ Logmap
Use the SE_2(3) NavState Logmap for every backend.
Definition PreintegrationParams.h:32
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition Group.h:37
A CRTP helper class that implements Lie group methods Prerequisites: methods operator*,...
Definition Lie.h:114
A CRTP helper class that implements matrix Lie group methods.
Definition MatrixLieGroup.h:51
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
Template to create a binary predicate.
Definition Testable.h:112
Definition SL4.h:31
static Matrix44 Hat(const Vector &xi)
Lie algebra coordinates for sl(4) using an orthonormal basis.
Definition SL4.cpp:211
SL4 operator*(const SL4 &other) const
Group operation.
Definition SL4.h:72
const Matrix44 & matrix() const
convert to 4*4 matrix
Definition SL4.h:59
static SL4 Identity()
identity for group operation
Definition SL4.h:66
SL4()
Default constructor initializes at origin.
Definition SL4.h:43
SL4 inverse() const
inverse transformation
Definition SL4.h:69
Definition SL4.h:93