Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | List of all members
Sophus::SO2Base< Derived > Class Template Reference

#include <so2.hpp>

Public Types

using Adjoint = Scalar
 
using ComplexT = typename Eigen::internal::traits< Derived >::ComplexType
 
using HomogeneousPoint = Vector3< Scalar >
 
template<typename HPointDerived >
using HomogeneousPointProduct = Vector3< ReturnScalar< HPointDerived > >
 
using Line = ParametrizedLine2< Scalar >
 
using Point = Vector2< Scalar >
 
template<typename PointDerived >
using PointProduct = Vector2< ReturnScalar< PointDerived > >
 
template<typename OtherDerived >
using ReturnScalar = typename Eigen::ScalarBinaryOpTraits< Scalar, typename OtherDerived::Scalar >::ReturnType
 
using Scalar = typename Eigen::internal::traits< Derived >::Scalar
 
template<typename OtherDerived >
using SO2Product = SO2< ReturnScalar< OtherDerived > >
 
using Tangent = Scalar
 
using Transformation = Matrix< Scalar, N, N >
 

Public Member Functions

SOPHUS_FUNC Adjoint Adj () const
 
template<class NewScalarType >
SOPHUS_FUNC SO2< NewScalarType > cast () const
 
SOPHUS_FUNC Scalardata ()
 
SOPHUS_FUNC Scalar const * data () const
 
SOPHUS_FUNC Matrix< Scalar, num_parameters, DoFDx_this_mul_exp_x_at_0 () const
 
SOPHUS_FUNC SO2< Scalarinverse () const
 
SOPHUS_FUNC Scalar log () const
 
SOPHUS_FUNC Transformation matrix () const
 
SOPHUS_FUNC void normalize ()
 
template<typename HPointDerived , typename = typename std::enable_if< IsFixedSizeVector<HPointDerived, 3>::value>::type>
SOPHUS_FUNC HomogeneousPointProduct< HPointDerived > operator* (Eigen::MatrixBase< HPointDerived > const &p) const
 
template<typename PointDerived , typename = typename std::enable_if< IsFixedSizeVector<PointDerived, 2>::value>::type>
SOPHUS_FUNC PointProduct< PointDerived > operator* (Eigen::MatrixBase< PointDerived > const &p) const
 
SOPHUS_FUNC Line operator* (Line const &l) const
 
template<typename OtherDerived >
SOPHUS_FUNC SO2Product< OtherDerived > operator* (SO2Base< OtherDerived > const &other) const
 
template<typename OtherDerived , typename = typename std::enable_if< std::is_same<Scalar, ReturnScalar<OtherDerived>>::value>::type>
SOPHUS_FUNC SO2Base< Derived > operator*= (SO2Base< OtherDerived > const &other)
 
SOPHUS_FUNC SO2Baseoperator= (SO2Base const &other)=default
 
template<class OtherDerived >
SOPHUS_FUNC SO2Base< Derived > & operator= (SO2Base< OtherDerived > const &other)
 
SOPHUS_FUNC Sophus::Vector< Scalar, num_parametersparams () const
 
SOPHUS_FUNC void setComplex (Point const &complex)
 
SOPHUS_FUNC ComplexT const & unit_complex () const
 

Static Public Attributes

static constexpr int DoF = 1
 
static constexpr int N = 2
 Group transformations are 2x2 matrices. More...
 
static constexpr int num_parameters = 2
 Number of internal parameters used (complex numbers are a tuples). More...
 

Private Member Functions

SOPHUS_FUNC ComplexTunit_complex_nonconst ()
 

Detailed Description

template<class Derived>
class Sophus::SO2Base< Derived >

SO2 base type - implements SO2 class but is storage agnostic.

SO(2) is the group of rotations in 2d. As a matrix group, it is the set of matrices which are orthogonal such that R * R' = I (with R' being the transpose of R) and have a positive determinant. In particular, the determinant is 1. Let theta be the rotation angle, the rotation matrix can be written in close form:

 | cos(theta) -sin(theta) |
 | sin(theta)  cos(theta) |

As a matter of fact, the first column of those matrices is isomorph to the set of unit complex numbers U(1). Thus, internally, SO2 is represented as complex number with length 1.

SO(2) is a compact and commutative group. First it is compact since the set of rotation matrices is a closed and bounded set. Second it is commutative since R(alpha) * R(beta) = R(beta) * R(alpha), simply because alpha + beta = beta + alpha with alpha and beta being rotation angles (about the same axis).

Class invariant: The 2-norm of unit_complex must be close to 1. Technically speaking, it must hold that:

|unit_complex().squaredNorm() - 1| <= Constants::epsilon().

Definition at line 77 of file so2.hpp.

Member Typedef Documentation

◆ Adjoint

template<class Derived >
using Sophus::SO2Base< Derived >::Adjoint = Scalar

Definition at line 94 of file so2.hpp.

◆ ComplexT

template<class Derived >
using Sophus::SO2Base< Derived >::ComplexT = typename Eigen::internal::traits<Derived>::ComplexType

Definition at line 80 of file so2.hpp.

◆ HomogeneousPoint

template<class Derived >
using Sophus::SO2Base< Derived >::HomogeneousPoint = Vector3<Scalar>

Definition at line 91 of file so2.hpp.

◆ HomogeneousPointProduct

template<class Derived >
template<typename HPointDerived >
using Sophus::SO2Base< Derived >::HomogeneousPointProduct = Vector3<ReturnScalar<HPointDerived> >

Definition at line 111 of file so2.hpp.

◆ Line

template<class Derived >
using Sophus::SO2Base< Derived >::Line = ParametrizedLine2<Scalar>

Definition at line 92 of file so2.hpp.

◆ Point

template<class Derived >
using Sophus::SO2Base< Derived >::Point = Vector2<Scalar>

Definition at line 90 of file so2.hpp.

◆ PointProduct

template<class Derived >
template<typename PointDerived >
using Sophus::SO2Base< Derived >::PointProduct = Vector2<ReturnScalar<PointDerived> >

Definition at line 108 of file so2.hpp.

◆ ReturnScalar

template<class Derived >
template<typename OtherDerived >
using Sophus::SO2Base< Derived >::ReturnScalar = typename Eigen::ScalarBinaryOpTraits< Scalar, typename OtherDerived::Scalar>::ReturnType

For binary operations the return type is determined with the ScalarBinaryOpTraits feature of Eigen. This allows mixing concrete and Map types, as well as other compatible scalar types such as Ceres::Jet and double scalars with SO2 operations.

Definition at line 102 of file so2.hpp.

◆ Scalar

template<class Derived >
using Sophus::SO2Base< Derived >::Scalar = typename Eigen::internal::traits<Derived>::Scalar

Definition at line 79 of file so2.hpp.

◆ SO2Product

template<class Derived >
template<typename OtherDerived >
using Sophus::SO2Base< Derived >::SO2Product = SO2<ReturnScalar<OtherDerived> >

Definition at line 105 of file so2.hpp.

◆ Tangent

template<class Derived >
using Sophus::SO2Base< Derived >::Tangent = Scalar

Definition at line 93 of file so2.hpp.

◆ Transformation

template<class Derived >
using Sophus::SO2Base< Derived >::Transformation = Matrix<Scalar, N, N>

Definition at line 89 of file so2.hpp.

Member Function Documentation

◆ Adj()

template<class Derived >
SOPHUS_FUNC Adjoint Sophus::SO2Base< Derived >::Adj ( ) const
inline

Adjoint transformation

This function return the adjoint transformation Ad of the group element A such that for all x it holds that hat(Ad_A * x) = A * hat(x) A^{-1}. See hat-operator below.

It simply 1, since SO(2) is a commutative group.

Definition at line 121 of file so2.hpp.

◆ cast()

template<class Derived >
template<class NewScalarType >
SOPHUS_FUNC SO2<NewScalarType> Sophus::SO2Base< Derived >::cast ( ) const
inline

Returns copy of instance casted to NewScalarType.

Definition at line 126 of file so2.hpp.

◆ data() [1/2]

template<class Derived >
SOPHUS_FUNC Scalar* Sophus::SO2Base< Derived >::data ( )
inline

This provides unsafe read/write access to internal data. SO(2) is represented by a unit complex number (two parameters). When using direct write access, the user needs to take care of that the complex number stays normalized.

Definition at line 135 of file so2.hpp.

◆ data() [2/2]

template<class Derived >
SOPHUS_FUNC Scalar const* Sophus::SO2Base< Derived >::data ( ) const
inline

Const version of data() above.

Definition at line 139 of file so2.hpp.

◆ Dx_this_mul_exp_x_at_0()

template<class Derived >
SOPHUS_FUNC Matrix<Scalar, num_parameters, DoF> Sophus::SO2Base< Derived >::Dx_this_mul_exp_x_at_0 ( ) const
inline

Returns derivative of this * SO2::exp(x) wrt. x at x=0.

Definition at line 292 of file so2.hpp.

◆ inverse()

template<class Derived >
SOPHUS_FUNC SO2<Scalar> Sophus::SO2Base< Derived >::inverse ( ) const
inline

Returns group inverse.

Definition at line 143 of file so2.hpp.

◆ log()

template<class Derived >
SOPHUS_FUNC Scalar Sophus::SO2Base< Derived >::log ( ) const
inline

Logarithmic map

Computes the logarithm, the inverse of the group exponential which maps element of the group (rotation matrices) to elements of the tangent space (rotation angles).

To be specific, this function computes vee(logmat(.)) with logmat(.) being the matrix logarithm and vee(.) the vee-operator of SO(2).

Definition at line 157 of file so2.hpp.

◆ matrix()

template<class Derived >
SOPHUS_FUNC Transformation Sophus::SO2Base< Derived >::matrix ( ) const
inline

Returns 2x2 matrix representation of the instance.

For SO(2), the matrix representation is an orthogonal matrix R with det(R)=1, thus the so-called "rotation matrix".

Definition at line 182 of file so2.hpp.

◆ normalize()

template<class Derived >
SOPHUS_FUNC void Sophus::SO2Base< Derived >::normalize ( )
inline

It re-normalizes unit_complex to unit length.

Note: Because of the class invariant, there is typically no need to call this function directly.

Definition at line 167 of file so2.hpp.

◆ operator*() [1/4]

template<class Derived >
template<typename HPointDerived , typename = typename std::enable_if< IsFixedSizeVector<HPointDerived, 3>::value>::type>
SOPHUS_FUNC HomogeneousPointProduct<HPointDerived> Sophus::SO2Base< Derived >::operator* ( Eigen::MatrixBase< HPointDerived > const &  p) const
inline

Group action on homogeneous 2-points.

This function rotates a homogeneous 2 dimensional point p by the SO2 element bar_R_foo (= rotation matrix): p_bar = bar_R_foo * p_foo.

Definition at line 260 of file so2.hpp.

◆ operator*() [2/4]

template<class Derived >
template<typename PointDerived , typename = typename std::enable_if< IsFixedSizeVector<PointDerived, 2>::value>::type>
SOPHUS_FUNC PointProduct<PointDerived> Sophus::SO2Base< Derived >::operator* ( Eigen::MatrixBase< PointDerived > const &  p) const
inline

Group action on 2-points.

This function rotates a 2 dimensional point p by the SO2 element bar_R_foo (= rotation matrix): p_bar = bar_R_foo * p_foo.

Definition at line 244 of file so2.hpp.

◆ operator*() [3/4]

template<class Derived >
SOPHUS_FUNC Line Sophus::SO2Base< Derived >::operator* ( Line const &  l) const
inline

Group action on lines.

This function rotates a parametrized line l(t) = o + t * d by the SO2 element:

Both direction d and origin o are rotated as a 2 dimensional point

Definition at line 275 of file so2.hpp.

◆ operator*() [4/4]

template<class Derived >
template<typename OtherDerived >
SOPHUS_FUNC SO2Product<OtherDerived> Sophus::SO2Base< Derived >::operator* ( SO2Base< OtherDerived > const &  other) const
inline

Group multiplication, which is rotation concatenation.

Definition at line 209 of file so2.hpp.

◆ operator*=()

template<class Derived >
template<typename OtherDerived , typename = typename std::enable_if< std::is_same<Scalar, ReturnScalar<OtherDerived>>::value>::type>
SOPHUS_FUNC SO2Base<Derived> Sophus::SO2Base< Derived >::operator*= ( SO2Base< OtherDerived > const &  other)
inline

In-place group multiplication. This method is only valid if the return type of the multiplication is compatible with this SO2's Scalar type.

Definition at line 285 of file so2.hpp.

◆ operator=() [1/2]

template<class Derived >
SOPHUS_FUNC SO2Base& Sophus::SO2Base< Derived >::operator= ( SO2Base< Derived > const &  other)
default

Assignment operator

◆ operator=() [2/2]

template<class Derived >
template<class OtherDerived >
SOPHUS_FUNC SO2Base<Derived>& Sophus::SO2Base< Derived >::operator= ( SO2Base< OtherDerived > const &  other)
inline

Assignment-like operator from OtherDerived.

Definition at line 201 of file so2.hpp.

◆ params()

template<class Derived >
SOPHUS_FUNC Sophus::Vector<Scalar, num_parameters> Sophus::SO2Base< Derived >::params ( ) const
inline

Returns internal parameters of SO(2).

It returns (c[0], c[1]), with c being the unit complex number.

Definition at line 302 of file so2.hpp.

◆ setComplex()

template<class Derived >
SOPHUS_FUNC void Sophus::SO2Base< Derived >::setComplex ( Point const &  complex)
inline

Takes in complex number / tuple and normalizes it.

Precondition: The complex number must not be close to zero.

Definition at line 310 of file so2.hpp.

◆ unit_complex()

template<class Derived >
SOPHUS_FUNC ComplexT const& Sophus::SO2Base< Derived >::unit_complex ( ) const
inline

Accessor of unit quaternion.

Definition at line 318 of file so2.hpp.

◆ unit_complex_nonconst()

template<class Derived >
SOPHUS_FUNC ComplexT& Sophus::SO2Base< Derived >::unit_complex_nonconst ( )
inlineprivate

Mutator of unit_complex is private to ensure class invariant. That is the complex number must stay close to unit length.

Definition at line 327 of file so2.hpp.

Member Data Documentation

◆ DoF

template<class Derived >
constexpr int Sophus::SO2Base< Derived >::DoF = 1
staticconstexpr

Degrees of freedom of manifold, number of dimensions in tangent space (one since we only have in-plane rotations).

Definition at line 84 of file so2.hpp.

◆ N

template<class Derived >
constexpr int Sophus::SO2Base< Derived >::N = 2
staticconstexpr

Group transformations are 2x2 matrices.

Definition at line 88 of file so2.hpp.

◆ num_parameters

template<class Derived >
constexpr int Sophus::SO2Base< Derived >::num_parameters = 2
staticconstexpr

Number of internal parameters used (complex numbers are a tuples).

Definition at line 86 of file so2.hpp.


The documentation for this class was generated from the following file:


sophus
Author(s): Hauke Strasdat
autogenerated on Wed Mar 2 2022 01:01:48