fawkes::HomTransform Class Reference
This class describes a homogeneous transformation. More...
#include <geometry/hom_transform.h>
Public Member Functions | |
| HomTransform () | |
| Constructor. | |
| HomTransform (const HomTransform &ht) | |
| Copy constructor. | |
| HomTransform (const Matrix &m) | |
| Constructor from a Matrix. | |
| virtual | ~HomTransform () |
| Destructor. | |
| HomTransform & | reset () |
| Reset transformation. | |
| virtual HomTransform & | invert () |
| 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. | |
| HomTransform & | operator= (const HomTransform &t) |
| Assignment operator. | |
| template<typename T > | |
| T | operator* (const T &p) const |
| Multiplication operator. | |
| HomTransform & | operator*= (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 Matrix & | get_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.
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 | ) |
| 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] |
Member Function Documentation
| HomTransform fawkes::HomTransform::get_inverse | ( | ) | [virtual] |
Obtain inverse transform.
- Returns:
- the inverse transform
Definition at line 102 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 265 of file hom_transform.cpp.
Referenced by ProjectiveCam::set_location(), and fawkes::HomCoord::transform().
| HomTransform & fawkes::HomTransform::invert | ( | ) | [virtual] |
Invert the transformation.
- Returns:
- reference to the inverted transformation
Definition at line 85 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 193 of file hom_transform.cpp.
References rotate_x(), rotate_z(), and trans().
| 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().
| 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 232 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 220 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 244 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 255 of file hom_transform.cpp.
References fawkes::Matrix::print_info().
| HomTransform & fawkes::HomTransform::reset | ( | void | ) |
Reset transformation.
Definition at line 75 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 114 of file hom_transform.cpp.
Referenced by mDH(), fawkes::HomCoord::rotate_x(), and 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 133 of file hom_transform.cpp.
Referenced by fawkes::HomPolar::phi(), fawkes::HomPolar::phi_y(), fawkes::HomPolar::phi_z(), fawkes::HomCoord::rotate_y(), and 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 153 of file hom_transform.cpp.
Referenced by mDH(), fawkes::HomPolar::phi(), fawkes::HomPolar::phi_y(), fawkes::HomPolar::phi_z(), fawkes::HomCoord::rotate_z(), and 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 207 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 175 of file hom_transform.cpp.
Referenced by mDH(), and ProjectiveCam::set_location().
The documentation for this class was generated from the following files:
- src/libs/geometry/hom_transform.h
- src/libs/geometry/hom_transform.cpp

