Fawkes API
Fawkes Development Version
|
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... | |
HomTransform & | reset () |
Reset transformation. More... | |
virtual HomTransform & | invert () |
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... | |
HomTransform & | operator= (const HomTransform &t) |
Assignment operator. More... | |
template<typename T > | |
T | operator* (const T &p) const |
Multiplication operator. More... | |
HomTransform & | operator*= (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 Matrix & | get_matrix () const |
Returns a copy of the matrix. More... | |
template<> | |
HomTransform | operator* (const HomTransform &t) const |
Multiplication operator (specialization for HomTransforms) More... | |
This class describes a homogeneous transformation.
Definition at line 31 of file hom_transform.h.
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 | ) |
fawkes::HomTransform::HomTransform | ( | const Matrix & | m | ) |
Constructor from a Matrix.
m | a Matrix |
Definition at line 57 of file hom_transform.cpp.
References fawkes::Matrix::num_cols(), and fawkes::Matrix::num_rows().
|
virtual |
Destructor.
Definition at line 68 of file hom_transform.cpp.
|
virtual |
Obtain 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.
Definition at line 267 of file hom_transform.cpp.
Referenced by firevision::ProjectiveCam::set_location(), and fawkes::HomCoord::transform().
|
virtual |
Invert the 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
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().
|
inline |
Multiplication operator.
p | the RHS object |
Definition at line 73 of file hom_transform.h.
|
inline |
Multiplication operator (specialization for HomTransforms)
t | the RHS HomTransform |
Definition at line 84 of file hom_transform.h.
References HomTransform().
HomTransform & fawkes::HomTransform::operator*= | ( | const HomTransform & | t | ) |
Multiplication-assignment operator.
t | the rhs transformation |
Definition at line 234 of file hom_transform.cpp.
HomTransform & fawkes::HomTransform::operator= | ( | const HomTransform & | t | ) |
Assignment operator.
t | the other transformation |
Definition at line 222 of file hom_transform.cpp.
bool fawkes::HomTransform::operator== | ( | const HomTransform & | t | ) | const |
Comparison operator.
t | the other transformation |
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.
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.
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.
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.
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.
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.
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.
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().