Kindr
Kinematics and Dynamics for Robotics
kindr::RotationBase< Derived_ > Class Template Reference

Representation of a generic rotationThis class defines the generic interface for a rotation. More...

#include <RotationBase.hpp>

Public Member Functions

 RotationBase ()=default
 Standard constructor. Creates an empty generic rotation object. More...
 
 RotationBase (const Derived_ &)=delete
 Constructor from derived rotation. This constructor has been deleted because the abstract class does not contain any data. More...
 
RotationBase inverted () const
 Returns the inverse of the rotation. More...
 
RotationBaseinvert ()
 Inverts the rotation. More...
 
 operator Derived_ & ()
 Gets the derived rotation. (only for advanced users) More...
 
 operator const Derived_ & () const
 Gets the derived rotation. (only for advanced users) More...
 
Derived_ & derived ()
 Gets the derived rotation. (only for advanced users) More...
 
const Derived_ & derived () const
 Gets the derived rotation. (only for advanced users) More...
 
Derived_ & setIdentity ()
 Sets the rotation to the identity rotation. More...
 
Derived_ & setRandom ()
 Sets the rotation to a random one. More...
 
Derived_ getRandom () const
 Returns a random rotation. More...
 
Derived_ getUnique () const
 Returns the rotation in a unique form This function is used to compare different rotations. More...
 
Derived_ & setUnique ()
 Modifies the rotation such that it is in its unique form. More...
 
template<typename OtherDerived_ >
Derived_ operator* (const RotationBase< OtherDerived_ > &other) const
 Concatenates two rotations. More...
 
template<typename OtherDerived_ >
bool operator== (const RotationBase< OtherDerived_ > &other) const
 Compares two rotations. More...
 
template<typename OtherDerived_ >
internal::get_scalar< Derived_ >::Scalar getDisparityAngle (const RotationBase< OtherDerived_ > &other) const
 Gets the disparity angle between two rotations for comparison. More...
 
template<typename OtherDerived_ >
bool isNear (const RotationBase< OtherDerived_ > &other, typename internal::get_scalar< Derived_ >::Scalar tol) const
 Compares two rotations with a tolerance. More...
 
template<typename internal::get_matrix3X< Derived_ >::IndexType Cols>
internal::get_matrix3X< Derived_ >::template Matrix3X< Cols > rotate (const typename internal::get_matrix3X< Derived_ >::template Matrix3X< Cols > &matrix) const
 Rotates a vector or a matrix column-wise. More...
 
template<typename internal::get_matrix3X< Derived_ >::IndexType Cols>
internal::get_matrix3X< Derived_ >::template Matrix3X< Cols > inverseRotate (const typename internal::get_matrix3X< Derived_ >::template Matrix3X< Cols > &matrix) const
 Rotates a vector or matrix in reverse. More...
 
template<typename Vector_ >
Vector_ rotate (const Vector_ &vector) const
 Rotates a vector. More...
 
template<typename Vector_ >
Vector_ inverseRotate (const Vector_ &vector) const
 Rotates a vector in reverse. More...
 
Derived_ exponentialMap (const typename internal::get_matrix3X< Derived_ >::template Matrix3X< 1 > &vector)
 Sets the rotation using an exponential map. More...
 
internal::get_matrix3X< Derived_ >::template Matrix3X< 1 > logarithmicMap () const
 Gets the logarithmic map from the rotation. More...
 
template<typename OtherDerived_ >
internal::get_matrix3X< Derived_ >::template Matrix3X< 1 > boxMinus (const RotationBase< OtherDerived_ > &other) const
 Applies the box minus operation. More...
 
Derived_ boxPlus (const typename internal::get_matrix3X< Derived_ >::template Matrix3X< 1 > &vector) const
 Applies the box plus operation. More...
 
template<typename Vector_ >
Derived_ & setFromVectors (const Vector_ &B_v, const Vector_ &I_v)
 Sets the rotation C_IB from two vectors such that I_v = C_IB*B_v i.e. I_v = this->rotate(B_v). More...
 
void fix ()
 Fixes the rotation to get rid of numerical errors (e.g. normalize quaternion). More...
 

Detailed Description

template<typename Derived_>
class kindr::RotationBase< Derived_ >

Representation of a generic rotation

This class defines the generic interface for a rotation.

Template Parameters
Derived_the derived class that should implement the rotation

Definition at line 157 of file RotationBase.hpp.

Constructor & Destructor Documentation

template<typename Derived_>
kindr::RotationBase< Derived_ >::RotationBase ( )
default

Standard constructor. Creates an empty generic rotation object.

template<typename Derived_>
kindr::RotationBase< Derived_ >::RotationBase ( const Derived_ &  )
delete

Constructor from derived rotation. This constructor has been deleted because the abstract class does not contain any data.

Member Function Documentation

template<typename Derived_>
template<typename OtherDerived_ >
internal::get_matrix3X<Derived_>::template Matrix3X<1> kindr::RotationBase< Derived_ >::boxMinus ( const RotationBase< OtherDerived_ > &  other) const
inline

Applies the box minus operation.

Returns
vector Eigen::Matrix<Scalar 3, 1>

Definition at line 336 of file RotationBase.hpp.

template<typename Derived_>
Derived_ kindr::RotationBase< Derived_ >::boxPlus ( const typename internal::get_matrix3X< Derived_ >::template Matrix3X< 1 > &  vector) const
inline

Applies the box plus operation.

Returns
rotation

Definition at line 342 of file RotationBase.hpp.

template<typename Derived_>
Derived_& kindr::RotationBase< Derived_ >::derived ( )
inline

Gets the derived rotation. (only for advanced users)

Returns
the derived rotation

Definition at line 200 of file RotationBase.hpp.

template<typename Derived_>
const Derived_& kindr::RotationBase< Derived_ >::derived ( ) const
inline

Gets the derived rotation. (only for advanced users)

Returns
the derived rotation

Definition at line 208 of file RotationBase.hpp.

template<typename Derived_>
Derived_ kindr::RotationBase< Derived_ >::exponentialMap ( const typename internal::get_matrix3X< Derived_ >::template Matrix3X< 1 > &  vector)
inline

Sets the rotation using an exponential map.

Todo:
avoid altering the rotation
Parameters
vectorEigen::Matrix<Scalar 3, 1>
Returns
reference to modified rotation

Definition at line 321 of file RotationBase.hpp.

template<typename Derived_>
void kindr::RotationBase< Derived_ >::fix ( )
inline

Fixes the rotation to get rid of numerical errors (e.g. normalize quaternion).

Definition at line 358 of file RotationBase.hpp.

template<typename Derived_>
template<typename OtherDerived_ >
internal::get_scalar<Derived_>::Scalar kindr::RotationBase< Derived_ >::getDisparityAngle ( const RotationBase< OtherDerived_ > &  other) const
inline

Gets the disparity angle between two rotations for comparison.

The disparity angle is defined as the angle of the angle-axis representation of the concatenation of the first rotation and the inverse of the second rotation. If the disparity angle is zero, the rotations are equal.

Returns
disparity angle

Definition at line 271 of file RotationBase.hpp.

template<typename Derived_>
Derived_ kindr::RotationBase< Derived_ >::getRandom ( ) const
inline

Returns a random rotation.

Returns
reference to modified rotation

Definition at line 228 of file RotationBase.hpp.

template<typename Derived_>
Derived_ kindr::RotationBase< Derived_ >::getUnique ( ) const

Returns the rotation in a unique form This function is used to compare different rotations.

Returns
copy of the rotation which is unique
template<typename Derived_>
template<typename internal::get_matrix3X< Derived_ >::IndexType Cols>
internal::get_matrix3X<Derived_>::template Matrix3X<Cols> kindr::RotationBase< Derived_ >::inverseRotate ( const typename internal::get_matrix3X< Derived_ >::template Matrix3X< Cols > &  matrix) const
inline

Rotates a vector or matrix in reverse.

Returns
the reverse rotated vector or matrix

Definition at line 297 of file RotationBase.hpp.

template<typename Derived_>
template<typename Vector_ >
Vector_ kindr::RotationBase< Derived_ >::inverseRotate ( const Vector_ &  vector) const
inline

Rotates a vector in reverse.

Returns
the reverse rotated vector or matrix

Definition at line 313 of file RotationBase.hpp.

template<typename Derived_>
RotationBase& kindr::RotationBase< Derived_ >::invert ( )

Inverts the rotation.

Returns
reference
template<typename Derived_>
RotationBase kindr::RotationBase< Derived_ >::inverted ( ) const

Returns the inverse of the rotation.

Returns
inverse of the rotation
template<typename Derived_>
template<typename OtherDerived_ >
bool kindr::RotationBase< Derived_ >::isNear ( const RotationBase< OtherDerived_ > &  other,
typename internal::get_scalar< Derived_ >::Scalar  tol 
) const
inline

Compares two rotations with a tolerance.

Returns
true if the rotations are equal within the tolerance

Definition at line 279 of file RotationBase.hpp.

template<typename Derived_>
internal::get_matrix3X<Derived_>::template Matrix3X<1> kindr::RotationBase< Derived_ >::logarithmicMap ( ) const
inline

Gets the logarithmic map from the rotation.

Returns
vector Eigen::Matrix<Scalar 3, 1>

Definition at line 328 of file RotationBase.hpp.

template<typename Derived_>
kindr::RotationBase< Derived_ >::operator const Derived_ & ( ) const
inline

Gets the derived rotation. (only for advanced users)

Returns
the derived rotation

Definition at line 192 of file RotationBase.hpp.

template<typename Derived_>
kindr::RotationBase< Derived_ >::operator Derived_ & ( )
inline

Gets the derived rotation. (only for advanced users)

Returns
the derived rotation

Definition at line 184 of file RotationBase.hpp.

template<typename Derived_>
template<typename OtherDerived_ >
Derived_ kindr::RotationBase< Derived_ >::operator* ( const RotationBase< OtherDerived_ > &  other) const
inline

Concatenates two rotations.

Returns
the concatenation of two rotations

Definition at line 250 of file RotationBase.hpp.

template<typename Derived_>
template<typename OtherDerived_ >
bool kindr::RotationBase< Derived_ >::operator== ( const RotationBase< OtherDerived_ > &  other) const
inline

Compares two rotations.

Returns
true if the rotations are exactly equal

Definition at line 258 of file RotationBase.hpp.

template<typename Derived_>
template<typename internal::get_matrix3X< Derived_ >::IndexType Cols>
internal::get_matrix3X<Derived_>::template Matrix3X<Cols> kindr::RotationBase< Derived_ >::rotate ( const typename internal::get_matrix3X< Derived_ >::template Matrix3X< Cols > &  matrix) const
inline

Rotates a vector or a matrix column-wise.

Returns
the rotated vector or matrix

Definition at line 288 of file RotationBase.hpp.

template<typename Derived_>
template<typename Vector_ >
Vector_ kindr::RotationBase< Derived_ >::rotate ( const Vector_ &  vector) const
inline

Rotates a vector.

Returns
the rotated vector or matrix

Definition at line 305 of file RotationBase.hpp.

template<typename Derived_>
template<typename Vector_ >
Derived_& kindr::RotationBase< Derived_ >::setFromVectors ( const Vector_ &  B_v,
const Vector_ &  I_v 
)
inline

Sets the rotation C_IB from two vectors such that I_v = C_IB*B_v i.e. I_v = this->rotate(B_v).

Definition at line 351 of file RotationBase.hpp.

template<typename Derived_>
Derived_& kindr::RotationBase< Derived_ >::setIdentity ( )

Sets the rotation to the identity rotation.

Returns
reference
template<typename Derived_>
Derived_& kindr::RotationBase< Derived_ >::setRandom ( )
inline

Sets the rotation to a random one.

Returns
reference to modified rotation

Definition at line 220 of file RotationBase.hpp.

template<typename Derived_>
Derived_& kindr::RotationBase< Derived_ >::setUnique ( )

Modifies the rotation such that it is in its unique form.

Returns
reference

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