template class sophus::RxSo2¶
Overview¶
RxSo2 using storage; derived from RxSo2Base. More…
#include <rxso2.h> template <class TScalar, int kOptions> class RxSo2 { public: // typedefs using Base = RxSo2Base<RxSo2<TScalar, kOptions>> ; using Scalar = TScalar ; using Transformation = typename Base::Transformation ; using Point = typename Base::Point ; using HomogeneousPoint = typename Base::HomogeneousPoint ; using Tangent = typename Base::Tangent ; using Adjoint = typename Base::Adjoint ; using ComplexMember = Eigen::Matrix<Scalar, 2, 1, kOptions> ; // fields static constexpr int kDoF = Base::kDoF; static constexpr int kNumParameters = Base::kNumParameters; // construction RxSo2(); RxSo2(RxSo2 const& other); template <class TOtherDerived> RxSo2(RxSo2Base<TOtherDerived> const& other); RxSo2(Transformation const& mat_r); RxSo2(Scalar const& scale, Transformation const& mat_r); RxSo2(Scalar const& scale, So2<Scalar> const& so2); RxSo2(Eigen::Vector2<Scalar> const& z); RxSo2(Scalar const& real, Scalar const& imag); // methods SOPHUS_FUNC RxSo2& operator=(RxSo2 const& other); SOPHUS_FUNC ComplexMember const& complex() const; template <class TOtherDerived> SOPHUS_FUNC RxSo2Base<TDerived>& operator=(RxSo2Base<TOtherDerived> const& other); static SOPHUS_FUNC Eigen::Matrix<Scalar, kNumParameters, kDoF> dxExpX(Tangent const& a); static SOPHUS_FUNC Eigen::Matrix<Scalar, kNumParameters, kDoF> dxExpXAt0(); static SOPHUS_FUNC Eigen::Matrix<Scalar, 2, kDoF> dxExpXTimesPointAt0(Point const& point); static SOPHUS_FUNC Transformation dxiExpmatXAt0(int i); static SOPHUS_FUNC RxSo2<Scalar> exp(Tangent const& vec_a); static SOPHUS_FUNC Transformation generator(int i); static SOPHUS_FUNC Transformation hat(Tangent const& vec_a); static SOPHUS_FUNC Tangent lieBracket(Tangent const&, Tangent const&); template <class TUniformRandomBitGenerator> static RxSo2 sampleUniform(TUniformRandomBitGenerator& generator); static SOPHUS_FUNC Tangent vee(Transformation const& omega); protected: // fields ComplexMember complex_; // methods SOPHUS_FUNC ComplexMember& mutComplex(); };
Detailed Documentation¶
RxSo2 using storage; derived from RxSo2Base.
Construction¶
RxSo2()
Default constructor initializes complex number to identity rotation and scale to 1.
RxSo2(RxSo2 const& other)
Copy constructor.
template <class TOtherDerived> RxSo2(RxSo2Base<TOtherDerived> const& other)
Copy-like constructor from OtherDerived.
RxSo2(Transformation const& mat_r)
Constructor from scaled rotation matrix s*R.
Precondition: rotation matrix need to be scaled orthogonal with determinant of s^2
.
RxSo2(Scalar const& scale, Transformation const& mat_r)
Constructor from scale factor and rotation matrix R
.
Precondition: Rotation matrix R
must to be orthogonal with determinant of 1 and scale
must not to be close to either zero or infinity.
RxSo2(Scalar const& scale, So2<Scalar> const& so2)
Constructor from scale factor and So2.
Precondition: scale
must not be close to either zero or infinity.
RxSo2(Eigen::Vector2<Scalar> const& z)
Constructor from complex number.
Precondition: complex number must not be close to either zero or infinity
RxSo2(Scalar const& real, Scalar const& imag)
Constructor from complex number.
Precondition: complex number must not be close to either zero or inifnity.
Methods¶
SOPHUS_FUNC RxSo2& operator=(RxSo2 const& other)
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).
SOPHUS_FUNC ComplexMember const& complex() const
Accessor of complex.
template <class TOtherDerived> SOPHUS_FUNC RxSo2Base<TDerived>& operator=(RxSo2Base<TOtherDerived> const& other)
Assignment-like operator from OtherDerived.
static SOPHUS_FUNC Eigen::Matrix<Scalar, kNumParameters, kDoF> dxExpX(Tangent const& a)
Returns derivative of exp(x) wrt. x
static SOPHUS_FUNC Eigen::Matrix<Scalar, kNumParameters, kDoF> dxExpXAt0()
Returns derivative of exp(x) wrt. x_i at x=0.
static SOPHUS_FUNC Eigen::Matrix<Scalar, 2, kDoF> dxExpXTimesPointAt0(Point const& point)
Returns derivative of exp(x) * p wrt. x_i at x=0.
static SOPHUS_FUNC Transformation dxiExpmatXAt0(int i)
Returns derivative of expmat(x)
wrt. x_i at x=0
, with expmat(.)
being the matrix exponential.
static SOPHUS_FUNC RxSo2<Scalar> exp(Tangent const& vec_a)
Group exponential.
This functions takes in an element of tangent space (= rotation angle plus logarithm of scale) and returns the corresponding element of the group RxSo2.
To be more specific, this function computes expmat(hat(theta))
with expmat(.)
being the matrix exponential and hat(.)
being the hat() -operator of RSO2.
static SOPHUS_FUNC Transformation generator(int i)
Returns the ith infinitesimal generators of R+ x SO(2)
.
The infinitesimal generators of RxSo2 are:
| 0 -1 | G_0 = | 1 0 | | 1 0 | G_1 = | 0 1 |
Precondition: i
must be 0, or 1.
static SOPHUS_FUNC Transformation hat(Tangent const& vec_a)
hat-operator
It takes in the 2-vector representation a
(= rotation angle plus logarithm of scale) and returns the corresponding matrix representation of Lie algebra element.
Formally, the hat() -operator of RxSo2 is defined as
hat(.): R^2 -> R^{2x2}, hat(a) = sum_i a_i * G_i
(for i=0,1,2)
with G_i
being the ith infinitesimal generator of RxSo2.
The corresponding inverse is the vee() -operator, see below.
static SOPHUS_FUNC Tangent lieBracket(Tangent const&, Tangent const&)
Lie bracket.
It computes the Lie bracket of RxSO(2). To be more specific, it computes
[omega_1, omega_2]_rxso2 := vee([hat(omega_1), hat(omega_2)])
with [A,B] := AB-BA
being the matrix commutator, hat(.)
the hat() -operator and vee(.)
the vee() -operator of RxSo2.
template <class TUniformRandomBitGenerator> static RxSo2 sampleUniform(TUniformRandomBitGenerator& generator)
Draw uniform sample from RxSO(2) manifold.
The scale factor is drawn uniformly in log2-space from [-1, 1], hence the scale is in [0.5, 2)].
static SOPHUS_FUNC Tangent vee(Transformation const& omega)
vee-operator
It takes the 2x2-matrix representation Omega
and maps it to the corresponding vector representation of Lie algebra.
This is the inverse of the hat() -operator, see above.
Precondition: Omega
must have the following structure:
| d -x |
| x d |