fawkes::HomTransform Class Reference

This class describes a homogeneous transformation. More...

#include <geometry/hom_transform.h>

List of all members.

Public Member Functions

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

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().

Referenced by operator*().

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

Copy constructor.

Parameters:
t a HomTransform

Definition at line 49 of file hom_transform.cpp.

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

Constructor from a Matrix.

Parameters:
m a 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:
alpha the angle from the Z_i-1 axis to the Z_i axis about the X_i-1 axis
a the offset distance between the Z_i-1 and Z_i axes along the X_i-1 axis
theta the angle between the X_i-1 and X_i axes about the Z_i axis
d the 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<>
HomTransform fawkes::HomTransform::operator* ( const HomTransform t  )  const [inline]

Multiplication operator (specialization for HomTransforms).

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

Definition at line 84 of file hom_transform.h.

References HomTransform().

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

Multiplication operator.

Parameters:
p the RHS object
Returns:
the transformed RHS object

Definition at line 73 of file hom_transform.h.

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

Multiplication-assignment operator.

Parameters:
t the 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:
t the 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:
t the 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:
name Heading of the output
col_sep a string used to separate columns (defaults to '\t')
row_sep a 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:
rad rotation 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:
rad rotation 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:
rad rotation 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:
x the translation along the x-axis
y the translation along the y-axis
z the 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:
dx offset along x-axis
dy offset along y-axis
dz offset 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:

Generated on 1 Mar 2011 for Fawkes API by  doxygen 1.6.1