MIRA
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Friends | List of all members
RigidTransform< T, 2 > Class Template Reference

Specialization of RigidTransform for 2 dimensions. More...

#include <transform/RigidTransform.h>

Inheritance diagram for RigidTransform< T, 2 >:
Inheritance graph
[legend]

Public Types

enum  
 
typedef T Type
 The used floating point type (float, double, long double) More...
 
typedef Eigen::Matrix< T, D, 1 > TranslationType
 Vector type used to represent the translational part (dimension depends on dimensionality of transform). More...
 
typedef Eigen::Rotation2D< T > RotationType
 Type used to represent the rotational part (Eigen::Rotation2D for 2D transforms, Eigen::Quaternion for 3D transforms) More...
 
typedef Eigen::Matrix< T, HDim, HDimMatrixType
 Type of the matrix that can describe the full affine transform in homogeneous space. More...
 

Public Member Functions

 RigidTransform ()
 
 RigidTransform (const Eigen::Matrix< T, 2, 1 > &translation, const Eigen::Rotation2D< T > &rotation)
 Creates a new 2D transform with the specified translation and the specified Rotation2D. More...
 
 RigidTransform (const Eigen::Matrix< T, 2, 1 > &translation, T angle)
 Creates a new 2D transform with the specified translation and a rotation that is specified in rad. More...
 
 RigidTransform (T x, T y, T angle)
 Creates a new 2D transform with the specified translation and a rotation that is specified in rad. More...
 
template<typename UnitTag , typename Derived >
 RigidTransform (T x, T y, const AngleBase< T, UnitTag, Derived > &angle)
 Creates a new 2D transform with the specified translation and a rotation that is specified as Angle (this may be in rad or degree, depending on the actual Angle class that is used) More...
 
template<typename U >
RigidTransform< U, 2 > cast () const
 Returns *this casted to U. More...
 
T & x ()
 Returns the x-coordinate of the translational part of the transform. More...
 
x () const
 Returns the x-coordinate of the translational part of the transform. More...
 
T & y ()
 Returns the y-coordinate of the translational part of the transform. More...
 
y () const
 Returns the y-coordinate of the translational part of the transform. More...
 
T & phi ()
 Returns the rotation angle represented by this transform in radian. More...
 
phi () const
 Returns the rotation angle represented by this transform in radian. More...
 
template<typename Reflector >
void reflect (Reflector &m)
 
RigidTransform< T, 2 > inverse () const
 Computes and returns the inverse transform of this. More...
 
bool isApprox (const RigidTransformBase &other, T prec=std::numeric_limits< T >::epsilon()) const
 Returns true if this is approximately equal to other, within the precision determined by prec. More...
 
RigidTransform< T, 2 > & operator*= (const RigidTransformBase &other)
 Concatenates this transform with an other transform. More...
 
ei_rigidtransform_product_impl< D, RigidTransform< T, 2 >, OtherDerived >::TResult operator* (const Eigen::MatrixBase< OtherDerived > &other) const
 Apply the transformation to an Eigen matrix. More...
 
 operator Eigen::Transform< T, D, Eigen::Isometry > ()
 Cast operator that casts the rigid transform into a generic Eigen::Transform object. More...
 
MatrixType getMatrix () const
 Computes and returns the matrix that describes the affine transformation in homogeneous space. More...
 

Public Attributes

TranslationType t
 Vector that describes the translational part of the transform. More...
 
RotationType r
 The rotational part of the transform. More...
 

Protected Member Functions

RigidTransform< T, 2 > * This ()
 casts this to the actual derived type (see Curiously recurring template pattern) More...
 
const RigidTransform< T, 2 > * This () const
 casts this to the actual derived type (see Curiously recurring template pattern) More...
 

Static Protected Member Functions

static RigidTransform< T, 2 > mul (const RigidTransformBase &a, const RigidTransformBase &b)
 

Friends

std::ostream & operator<< (std::ostream &os, const RigidTransform &tf)
 

Detailed Description

template<typename T>
class mira::RigidTransform< T, 2 >

Specialization of RigidTransform for 2 dimensions.

This class represents an affine transformation that supports a translation followed by a rotation (a so called rigid transform). A rigid transformation is one in which the pre-image and the image both has the exact same size and shape.

These limitations are sufficient for our purposes (rigid body transform, transformation of coordinate frames, etc) and allows efficient computation of the operations. Moreover, the limitation to rigid transforms allows efficient interpolation between two different transformations.

Member Typedef Documentation

◆ Type

typedef T Type
inherited

The used floating point type (float, double, long double)

◆ TranslationType

typedef Eigen::Matrix<T,D,1> TranslationType
inherited

Vector type used to represent the translational part (dimension depends on dimensionality of transform).

◆ RotationType

typedef Eigen::Rotation2D< T > RotationType
inherited

Type used to represent the rotational part (Eigen::Rotation2D for 2D transforms, Eigen::Quaternion for 3D transforms)

◆ MatrixType

typedef Eigen::Matrix<T,HDim,HDim> MatrixType
inherited

Type of the matrix that can describe the full affine transform in homogeneous space.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited

Constructor & Destructor Documentation

◆ RigidTransform() [1/5]

RigidTransform ( )
inline

◆ RigidTransform() [2/5]

RigidTransform ( const Eigen::Matrix< T, 2, 1 > &  translation,
const Eigen::Rotation2D< T > &  rotation 
)
inline

Creates a new 2D transform with the specified translation and the specified Rotation2D.

◆ RigidTransform() [3/5]

RigidTransform ( const Eigen::Matrix< T, 2, 1 > &  translation,
angle 
)
inline

Creates a new 2D transform with the specified translation and a rotation that is specified in rad.

◆ RigidTransform() [4/5]

RigidTransform ( x,
y,
angle 
)
inline

Creates a new 2D transform with the specified translation and a rotation that is specified in rad.

◆ RigidTransform() [5/5]

RigidTransform ( x,
y,
const AngleBase< T, UnitTag, Derived > &  angle 
)
inline

Creates a new 2D transform with the specified translation and a rotation that is specified as Angle (this may be in rad or degree, depending on the actual Angle class that is used)

Member Function Documentation

◆ cast()

RigidTransform<U,2> cast ( ) const
inline

Returns *this casted to U.

◆ x() [1/2]

T& x ( )
inline

Returns the x-coordinate of the translational part of the transform.

◆ x() [2/2]

T x ( ) const
inline

Returns the x-coordinate of the translational part of the transform.

◆ y() [1/2]

T& y ( )
inline

Returns the y-coordinate of the translational part of the transform.

◆ y() [2/2]

T y ( ) const
inline

Returns the y-coordinate of the translational part of the transform.

◆ phi() [1/2]

T& phi ( )
inline

Returns the rotation angle represented by this transform in radian.

◆ phi() [2/2]

T phi ( ) const
inline

Returns the rotation angle represented by this transform in radian.

◆ reflect()

void reflect ( Reflector &  m)
inline

◆ inverse()

RigidTransform< T, 2 > inverse ( void  ) const
inlineinherited

Computes and returns the inverse transform of this.

◆ isApprox()

bool isApprox ( const RigidTransformBase< T, 2, Eigen::Rotation2D< T >, RigidTransform< T, 2 > > &  other,
prec = std::numeric_limits<T>::epsilon() 
) const
inlineinherited

Returns true if this is approximately equal to other, within the precision determined by prec.

Returns
true if approximately equal, false otherwise

◆ operator*=()

RigidTransform< T, 2 > & operator*= ( const RigidTransformBase< T, 2, Eigen::Rotation2D< T >, RigidTransform< T, 2 > > &  other)
inlineinherited

Concatenates this transform with an other transform.

◆ operator*()

ei_rigidtransform_product_impl<D, RigidTransform< T, 2 > , OtherDerived>::TResult operator* ( const Eigen::MatrixBase< OtherDerived > &  other) const
inlineinherited

Apply the transformation to an Eigen matrix.

The matrix must be a fixed matrix of the size Dx1 or a dynamic matrix of the same size.

◆ operator Eigen::Transform< T, D, Eigen::Isometry >()

operator Eigen::Transform< T, D, Eigen::Isometry > ( )
inlineinherited

Cast operator that casts the rigid transform into a generic Eigen::Transform object.

◆ getMatrix()

MatrixType getMatrix ( ) const
inlineinherited

Computes and returns the matrix that describes the affine transformation in homogeneous space.

The dimensions of the matrix is 3x3 for 2D transformations and 4x4 for 3D transformations.

◆ This() [1/2]

RigidTransform< T, 2 > * This ( )
inlineprotectedinherited

casts this to the actual derived type (see Curiously recurring template pattern)

◆ This() [2/2]

const RigidTransform< T, 2 > * This ( ) const
inlineprotectedinherited

casts this to the actual derived type (see Curiously recurring template pattern)

◆ mul()

static RigidTransform< T, 2 > mul ( const RigidTransformBase< T, 2, Eigen::Rotation2D< T >, RigidTransform< T, 2 > > &  a,
const RigidTransformBase< T, 2, Eigen::Rotation2D< T >, RigidTransform< T, 2 > > &  b 
)
inlinestaticprotectedinherited

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const RigidTransform< T, 2 > &  tf 
)
friend

Member Data Documentation

◆ t

TranslationType t
inherited

Vector that describes the translational part of the transform.

◆ r

RotationType r
inherited

The rotational part of the transform.


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