Fawkes API  Fawkes Development Version
fawkes::HomTransform Class Reference

This class describes a homogeneous transformation. More...

#include <geometry/hom_transform.h>

Public Member Functions

 HomTransform ()
 Constructor. More...
 
 HomTransform (const HomTransform &ht)
 Copy constructor. More...
 
 HomTransform (const Matrix &m)
 Constructor from a Matrix. More...
 
virtual ~HomTransform ()
 Destructor. More...
 
HomTransformreset ()
 Reset transformation. More...
 
virtual HomTransforminvert ()
 Invert the transformation. More...
 
virtual HomTransform get_inverse ()
 Obtain inverse transform. More...
 
void rotate_x (float rad)
 Add rotation around the x-axis. More...
 
void rotate_y (float rad)
 Add rotation around the y-axis. More...
 
void rotate_z (float rad)
 Add rotation around the z-axis. More...
 
void trans (float dx, float dy, float dz=0.0)
 Add translation to the transformation. More...
 
void set_trans (float x, float y, float z=0.0)
 Set the translation. More...
 
void mDH (const float alpha, const float a, const float theta, const float d)
 Modified Denavit-Hartenberg transformation. More...
 
HomTransformoperator= (const HomTransform &t)
 Assignment operator. More...
 
template<typename T >
operator* (const T &p) const
 Multiplication operator. More...
 
HomTransformoperator*= (const HomTransform &t)
 Multiplication-assignment operator. More...
 
bool operator== (const HomTransform &t) const
 Comparison operator. More...
 
void print_info (const char *name=0, const char *col_sep=0, const char *row_sep=0) const
 Prints the matrix. More...
 
const Matrixget_matrix () const
 Returns a copy of the matrix. More...
 
template<>
HomTransform operator* (const HomTransform &t) const
 Multiplication operator (specialization for HomTransforms) More...
 

Detailed Description

This class describes a homogeneous transformation.

Author
Daniel Beck

Definition at line 31 of file hom_transform.h.

Constructor & Destructor Documentation

fawkes::HomTransform::HomTransform ( )

Constructor.

Definition at line 40 of file hom_transform.cpp.

References fawkes::Matrix::id().

fawkes::HomTransform::HomTransform ( const HomTransform t)

Copy constructor.

Parameters
ta HomTransform

Definition at line 49 of file hom_transform.cpp.

fawkes::HomTransform::HomTransform ( const Matrix m)

Constructor from a Matrix.

Parameters
ma Matrix

Definition at line 57 of file hom_transform.cpp.

References fawkes::Matrix::num_cols(), and fawkes::Matrix::num_rows().

fawkes::HomTransform::~HomTransform ( )
virtual

Destructor.

Definition at line 68 of file hom_transform.cpp.

Member Function Documentation

HomTransform fawkes::HomTransform::get_inverse ( )
virtual

Obtain inverse transform.

Returns
the inverse transform

Definition at line 104 of file hom_transform.cpp.

References invert().

const Matrix & fawkes::HomTransform::get_matrix ( ) const

Returns a copy of the matrix.

Returns
the matrix of the transformation

Definition at line 267 of file hom_transform.cpp.

Referenced by firevision::ProjectiveCam::set_location(), and fawkes::HomCoord::transform().

HomTransform & fawkes::HomTransform::invert ( )
virtual

Invert the transformation.

Returns
reference to the inverted transformation

Definition at line 87 of file hom_transform.cpp.

References fawkes::Matrix::get_submatrix(), fawkes::Matrix::overlay(), and fawkes::Matrix::transpose().

Referenced by get_inverse().

void fawkes::HomTransform::mDH ( const float  alpha,
const float  a,
const float  theta,
const float  d 
)

Modified Denavit-Hartenberg transformation.

DH-transformation as used by Aldebaran

See also
http://robocup.aldebaran-robotics.com/index.php?option=com_content&task=view&id=30#id2514205 "3.2.2.1.3.2. Forward kinematics model parameters"
Parameters
alphathe angle from the Z_i-1 axis to the Z_i axis about the X_i-1 axis
athe offset distance between the Z_i-1 and Z_i axes along the X_i-1 axis
thetathe angle between the X_i-1 and X_i axes about the Z_i axis
dthe distance from the origin of frame X_i-1 to the X_i axis along the Z_i axis

Definition at line 195 of file hom_transform.cpp.

References rotate_x(), rotate_z(), and trans().

template<typename T >
T fawkes::HomTransform::operator* ( const T &  p) const
inline

Multiplication operator.

Parameters
pthe RHS object
Returns
the transformed RHS object

Definition at line 73 of file hom_transform.h.

template<>
HomTransform fawkes::HomTransform::operator* ( const HomTransform t) const
inline

Multiplication operator (specialization for HomTransforms)

Parameters
tthe RHS HomTransform
Returns
the result of multiplying the two transforms with each other

Definition at line 84 of file hom_transform.h.

HomTransform & fawkes::HomTransform::operator*= ( const HomTransform t)

Multiplication-assignment operator.

Parameters
tthe rhs transformation
Returns
reference to the result of the multiplication

Definition at line 234 of file hom_transform.cpp.

HomTransform & fawkes::HomTransform::operator= ( const HomTransform t)

Assignment operator.

Parameters
tthe other transformation
Returns
reference to the lhs transformation

Definition at line 222 of file hom_transform.cpp.

bool fawkes::HomTransform::operator== ( const HomTransform t) const

Comparison operator.

Parameters
tthe other transformation
Returns
true, if both transormations are equal

Definition at line 246 of file hom_transform.cpp.

void fawkes::HomTransform::print_info ( const char *  name = 0,
const char *  col_sep = 0,
const char *  row_sep = 0 
) const

Prints the matrix.

Parameters
nameHeading of the output
col_sepa string used to separate columns (defaults to '\t')
row_sepa string used to separate rows (defaults to '\n')

Definition at line 257 of file hom_transform.cpp.

References fawkes::Matrix::print_info().

HomTransform & fawkes::HomTransform::reset ( void  )

Reset transformation.

Returns
reference to this

Definition at line 77 of file hom_transform.cpp.

References fawkes::Matrix::id().

void fawkes::HomTransform::rotate_x ( float  rad)

Add rotation around the x-axis.

Parameters
radrotation angle in rad

Definition at line 116 of file hom_transform.cpp.

Referenced by mDH(), fawkes::HomCoord::rotate_x(), and firevision::ProjectiveCam::set_location().

void fawkes::HomTransform::rotate_y ( float  rad)

Add rotation around the y-axis.

Parameters
radrotation angle in rad

Definition at line 135 of file hom_transform.cpp.

Referenced by fawkes::HomPolar::phi(), fawkes::HomPolar::phi_y(), fawkes::HomPolar::phi_z(), fawkes::HomCoord::rotate_y(), and firevision::ProjectiveCam::set_location().

void fawkes::HomTransform::rotate_z ( float  rad)

Add rotation around the z-axis.

Parameters
radrotation angle in rad

Definition at line 155 of file hom_transform.cpp.

Referenced by mDH(), fawkes::HomPolar::phi(), fawkes::HomPolar::phi_y(), fawkes::HomPolar::phi_z(), fawkes::HomCoord::rotate_z(), and firevision::ProjectiveCam::set_location().

void fawkes::HomTransform::set_trans ( float  x,
float  y,
float  z = 0.0 
)

Set the translation.

Parameters
xthe translation along the x-axis
ythe translation along the y-axis
zthe translation along the z-axis

Definition at line 209 of file hom_transform.cpp.

void fawkes::HomTransform::trans ( float  dx,
float  dy,
float  dz = 0.0 
)

Add translation to the transformation.

Parameters
dxoffset along x-axis
dyoffset along y-axis
dzoffset along z-axis

Definition at line 177 of file hom_transform.cpp.

Referenced by mDH(), and firevision::ProjectiveCam::set_location().


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