Template Class Sim3
Defined in File sim3.hpp
Inheritance Relationships
Base Type
public Sophus::Sim3Base< Sim3< Scalar_, Options > >(Template Class Sim3Base)
Class Documentation
-
template<class Scalar_, int Options>
class Sim3 : public Sophus::Sim3Base<Sim3<Scalar_, Options>> Sim3 using default storage; derived from Sim3Base.
Public Types
Public Functions
- SOPHUS_FUNC Sim3 & operator= (Sim3 const &other)=default
Define copy-assignment operator explicitly. The definition of implicit copy assignment operator is deprecated in presence of a user-declared copy constructor (-Wdeprecated-copy in clang >= 13).
- EIGEN_MAKE_ALIGNED_OPERATOR_NEW SOPHUS_FUNC Sim3 ()
Default constructor initializes similarity transform to the identity.
-
template<class OtherDerived>
inline SOPHUS_FUNC Sim3(Sim3Base<OtherDerived> const &other) Copy-like constructor from OtherDerived.
-
template<class OtherDerived, class D>
inline explicit SOPHUS_FUNC Sim3(RxSO3Base<OtherDerived> const &rxso3, Eigen::MatrixBase<D> const &translation) Constructor from RxSO3 and translation vector
-
template<class D1, class D2>
inline explicit SOPHUS_FUNC Sim3(Eigen::QuaternionBase<D1> const &quaternion, Eigen::MatrixBase<D2> const &translation) Constructor from quaternion and translation vector.
Precondition: quaternion must not be close to zero.
-
template<class D1, class D2>
inline explicit SOPHUS_FUNC Sim3(Scalar const &scale, Eigen::QuaternionBase<D1> const &unit_quaternion, Eigen::MatrixBase<D2> const &translation) Constructor from scale factor, unit quaternion, and translation vector.
Precondition: quaternion must not be close to zero.
-
inline explicit SOPHUS_FUNC Sim3(Matrix<Scalar, 4, 4> const &T)
Constructor from 4x4 matrix
Precondition: Top-left 3x3 matrix needs to be “scaled-orthogonal” with positive determinant. The last row must be
(0, 0, 0, 1).
- inline SOPHUS_FUNC Scalar * data ()
This provides unsafe read/write access to internal data. Sim(3) is represented by an Eigen::Quaternion (four parameters) and a 3-vector. When using direct write access, the user needs to take care of that the quaternion is not set close to zero.
- inline SOPHUS_FUNC Scalar const * data () const
Const version of data() above.
- inline SOPHUS_FUNC RxSo3Member & rxso3 ()
Accessor of RxSO3
- inline SOPHUS_FUNC RxSo3Member const & rxso3 () const
Mutator of RxSO3
- inline SOPHUS_FUNC TranslationMember & translation ()
Mutator of translation vector
- inline SOPHUS_FUNC TranslationMember const & translation () const
Accessor of translation vector
Public Static Functions
- static inline SOPHUS_FUNC Sophus::Matrix< Scalar, num_parameters, DoF > Dx_exp_x_at_0 ()
Returns derivative of exp(x) wrt. x_i at x=0.
- static inline SOPHUS_FUNC Sophus::Matrix< Scalar, num_parameters, DoF > Dx_exp_x (const Tangent &a)
Returns derivative of exp(x) wrt. x.
- static inline SOPHUS_FUNC Sophus::Matrix< Scalar, 3, DoF > Dx_exp_x_times_point_at_0 (Point const &point)
Returns derivative of exp(x) * p wrt. x_i at x=0.
- static inline SOPHUS_FUNC Transformation Dxi_exp_x_matrix_at_0 (int i)
Returns derivative of exp(x).matrix() wrt.
x_i at x=0.
- static inline SOPHUS_FUNC Sim3< Scalar > exp (Tangent const &a)
Group exponential
This functions takes in an element of tangent space and returns the corresponding element of the group Sim(3).
The first three components of
arepresent the translational partupsilonin the tangent space of Sim(3), the following three components ofarepresents the rotation vectoromegaand the final component represents the logarithm of the scaling factorsigma. To be more specific, this function computesexpmat(hat(a))withexpmat(.)being the matrix exponential andhat(.)the hat-operator of Sim(3), see below.
- static inline SOPHUS_FUNC Transformation generator (int i)
Returns the ith infinitesimal generators of Sim(3).
The infinitesimal generators of Sim(3) are:
| 0 0 0 1 | G_0 = | 0 0 0 0 | | 0 0 0 0 | | 0 0 0 0 | | 0 0 0 0 | G_1 = | 0 0 0 1 | | 0 0 0 0 | | 0 0 0 0 | | 0 0 0 0 | G_2 = | 0 0 0 0 | | 0 0 0 1 | | 0 0 0 0 | | 0 0 0 0 | G_3 = | 0 0 -1 0 | | 0 1 0 0 | | 0 0 0 0 | | 0 0 1 0 | G_4 = | 0 0 0 0 | | -1 0 0 0 | | 0 0 0 0 | | 0 -1 0 0 | G_5 = | 1 0 0 0 | | 0 0 0 0 | | 0 0 0 0 | | 1 0 0 0 | G_6 = | 0 1 0 0 | | 0 0 1 0 | | 0 0 0 0 |
Precondition:
imust be in [0, 6].
- static inline SOPHUS_FUNC Transformation hat (Tangent const &a)
hat-operator
It takes in the 7-vector representation and returns the corresponding matrix representation of Lie algebra element.
Formally, the hat()-operator of Sim(3) is defined as
hat(.): R^7 -> R^{4x4}, hat(a) = sum_i a_i * G_i(for i=0,…,6)with
G_ibeing the ith infinitesimal generator of Sim(3).The corresponding inverse is the vee()-operator, see below.
- static inline SOPHUS_FUNC Tangent lieBracket (Tangent const &a, Tangent const &b)
Lie bracket
It computes the Lie bracket of Sim(3). To be more specific, it computes
[omega_1, omega_2]_sim3 := vee([hat(omega_1), hat(omega_2)])with
[A,B] := AB-BAbeing the matrix commutator,hat(.)the hat()-operator andvee(.)the vee()-operator of Sim(3).
-
template<class UniformRandomBitGenerator>
static inline Sim3 sampleUniform(UniformRandomBitGenerator &generator) Draw uniform sample from Sim(3) manifold.
Translations are drawn component-wise from the range [-1, 1]. The scale factor is drawn uniformly in log2-space from [-1, 1], hence the scale is in [0.5, 2].
- static inline SOPHUS_FUNC Tangent vee (Transformation const &Omega)
vee-operator
It takes the 4x4-matrix representation
Omegaand maps it to the corresponding 7-vector representation of Lie algebra.This is the inverse of the hat()-operator, see above.
Precondition:
Omegamust have the following structure:| g -f e a | | f g -d b | | -e d g c | | 0 0 0 0 |
Public Static Attributes