RobWorkProject
23.9.11-
|
A 4x4 homogeneous transform matrix \( \mathbf{T}\in SE(3) \). More...
#include <Transform3D.hpp>
Public Types | |
typedef T | value_type |
Value type. | |
typedef Eigen::Matrix< T, 4, 4 > | EigenMatrix4x4 |
Type for the internal Eigen matrix. | |
Public Member Functions | |
Transform3D () | |
Default Constructor. More... | |
Transform3D (const rw::math::Vector3D< T > &d, const rw::math::Rotation3D< T > &R) | |
Constructs a homogeneous transform. More... | |
Transform3D (const rw::math::Rotation3D< T > &R) | |
A homogeneous transform with a rotation of R and a translation of zero. | |
Transform3D (const rw::math::Vector3D< T > &d) | |
A homogeneous transform with a rotation of zero and a translation of d. | |
Transform3D (const rw::math::Transform3D< T > &t) | |
Copy Constructor. More... | |
Transform3D (const rw::math::Vector3D< T > &d, const rw::math::Rotation3DVector< T > &r) | |
Constructs a homogeneous transform. More... | |
template<class R > | |
Transform3D (const Eigen::MatrixBase< R > &r) | |
Creates a Transform3D from matrix_expression. More... | |
T & | operator() (std::size_t row, std::size_t col) |
Returns matrix element reference. More... | |
const T & | operator() (std::size_t row, std::size_t col) const |
Returns const matrix element reference. More... | |
bool | operator== (const Transform3D< T > &rhs) const |
Comparison operator. More... | |
bool | operator!= (const Transform3D< T > &rhs) const |
Comparison operator. More... | |
bool | equal (const Transform3D< T > &t3d, const T precision=std::numeric_limits< T >::epsilon()) const |
Compares the transformations with a given precision. More... | |
const Transform3D | operator* (const Transform3D &bTc) const |
Calculates \( \robabx{a}{c}{\mathbf{T}} = \robabx{a}{b}{\mathbf{T}} \robabx{b}{c}{\mathbf{T}} \). More... | |
const rw::math::Vector3D< T > | operator* (const rw::math::Vector3D< T > &bP) const |
Calculates \( \robax{a}{\mathbf{p}} = \robabx{a}{b}{\mathbf{T}} \robax{b}{\mathbf{p}} \) thus transforming point \( \mathbf{p} \) from frame \( b \) to frame \( a \). More... | |
rw::math::Rotation3D< T > & | R () |
Gets the rotation part \( \mathbf{R} \) from \( \mathbf{T} \). More... | |
const rw::math::Rotation3D< T > & | R () const |
Gets the rotation part \( \mathbf{R} \) from \( \mathbf{T} \). More... | |
rw::math::Vector3D< T > & | P () |
Gets the position part \( \mathbf{d} \) from \( \mathbf{T} \). More... | |
const rw::math::Vector3D< T > & | P () const |
Gets the position part \( \mathbf{d} \) from \( \mathbf{T} \). More... | |
Eigen::Matrix< T, 4, 4 > | e () const |
Returns a Eigen 4x4 matrix \( \mathbf{M}\in SE(3) \) that represents this homogeneous transformation. More... | |
Static Public Member Functions | |
static const Transform3D | DH (T alpha, T a, T d, T theta) |
Constructs a homogeneous transform using the original Denavit-Hartenberg notation. More... | |
static const Transform3D | craigDH (T alpha, T a, T d, T theta) |
Constructs a homogeneous transform using the Craig (modified) Denavit-Hartenberg notation. More... | |
static const Transform3D | DHHGP (T alpha, T a, T beta, T b) |
Constructs a homogeneous transform using the Gordon (modified) Denavit-Hartenberg notation. More... | |
static const Transform3D< T > | identity () |
Constructs the identity transform. More... | |
static void | multiply (const Transform3D< T > &a, const Transform3D< T > &b, Transform3D< T > &result) |
Write to result the product a * b. | |
static Transform3D< T > & | invMult (Transform3D< T > &t1, const Transform3D< T > &t2) |
computes the inverse of t1 and multiplies it with t2. The result is saved in t1. t1 = inv(t1) * t2 | |
static Transform3D< T > & | invMult (const Transform3D< T > &t1, const Transform3D< T > &t2, Transform3D< T > &t3) |
computes the inverse of t1 and multiplies it with t2. The result is saved in t1. t1 = inv(t1) * t2 | |
static Transform3D< T > | makeLookAt (const rw::math::Vector3D< T > &eye, const rw::math::Vector3D< T > ¢er, const rw::math::Vector3D< T > &up) |
creates a transformation that is positioned in eye and looking toward center along -z where up indicates the upward direction along which the y-axis is placed. Same convention as for gluLookAt and is handy for placing a cameraview. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Transform3D< T > &t) |
Outputs transform to stream. More... | |
Related Functions | |
(Note that these are not member functions.) | |
template<class T > | |
const Transform3D< T > | inverse (const Transform3D< T > &aTb) |
Calculates \( \robabx{b}{a}{\mathbf{T}} = \robabx{a}{b}{\mathbf{T}}^{-1} \). More... | |
template<> | |
void | write (const rw::math::Transform3D< double > &sobject, rw::common::OutputArchive &oarchive, const std::string &id) |
template<> | |
void | write (const rw::math::Transform3D< float > &sobject, rw::common::OutputArchive &oarchive, const std::string &id) |
template<> | |
void | read (rw::math::Transform3D< double > &sobject, rw::common::InputArchive &iarchive, const std::string &id) |
template<> | |
void | read (rw::math::Transform3D< float > &sobject, rw::common::InputArchive &iarchive, const std::string &id) |
template<class Archive , class T > | |
void | serialize (Archive &archive, rw::math::Transform3D< T > &transform, const unsigned int version) |
Boost serialization. More... | |
A 4x4 homogeneous transform matrix \( \mathbf{T}\in SE(3) \).
\( \mathbf{T} = \left[ \begin{array}{cc} \mathbf{R} & \mathbf{d} \\ \begin{array}{ccc}0 & 0 & 0\end{array} & 1 \end{array} \right] \)
|
inline |
Default Constructor.
Initializes with 0 translation and Identity matrix as rotation
|
inline |
Constructs a homogeneous transform.
d | [in] \( \mathbf{d} \) A 3x1 translation vector |
R | [in] \( \mathbf{R} \) A 3x3 rotation matrix |
|
inline |
Copy Constructor.
t | [in] Values to initialize the transform |
|
inline |
Constructs a homogeneous transform.
Calling this constructor is equivalent to the transform Transform3D(d, r.toRotation3D()).
d | [in] \( \mathbf{d} \) A 3x1 translation vector |
r | [in] \( \mathbf{r} \) A 3x1 rotation vector |
|
inlineexplicit |
Creates a Transform3D from matrix_expression.
r | [in] an Eigen Vector |
|
static |
Constructs a homogeneous transform using the Craig (modified) Denavit-Hartenberg notation.
alpha | [in] \( \alpha_{i-1} \) |
a | [in] \( a_{i-1} \) |
d | [in] \( d_i \) |
theta | [in] \( \theta_i \) |
\( \robabx{i-1}{i}{\mathbf{T}} = \left[ \begin{array}{cccc} c\theta_i & -s\theta_i & 0 & a_{i-1} \\ s\theta_i c\alpha_{i-1} & c\theta_i c\alpha_{i-1} & -s\alpha_{i-1} & -s\alpha_{i-1}d_i \\ s\theta_i s\alpha_{i-1} & c\theta_i s\alpha_{i-1} & c\alpha_{i-1} & c\alpha_{i-1}d_i \\ 0 & 0 & 0 & 1 \end{array} \right] \)
|
static |
Constructs a homogeneous transform using the original Denavit-Hartenberg notation.
alpha | [in] \( \alpha_i \) |
a | [in] \( a_i \) |
d | [in] \( d_i \) |
theta | [in] \( \theta_i \) |
\( \robabx{i-1}{i}{\mathbf{T}}= \left[ \begin{array}{cccc} c\theta_i & -s\theta_i c\alpha_i & s\theta_i s\alpha_i & a_i c\theta_i \\ s\theta_i & c\theta_i c\alpha_i & -c\theta_i s\alpha_i & a_i s\theta_i \\ 0 & s\alpha_i & c\alpha_i & d_i \\ 0 & 0 & 0 & 1 \end{array} \right] \)
|
static |
Constructs a homogeneous transform using the Gordon (modified) Denavit-Hartenberg notation.
alpha | [in] \( \alpha_i \) |
a | [in] \( a_i \) |
beta | [in] \( \beta_i \) |
b | [in] \( b_i \) |
\( z_{i-1} \) is close to parallel to \( z_i \) \( \robabx{i-1}{i}{\mathbf{T}}= \left[ \begin{array}{cccc} c\beta_i & s\alpha_i s\beta_i & c\alpha_i s\beta_i & a_i c\beta_i \\ 0 & c\alpha_i & -s\alpha_i & b_i \\ -s\beta_i & s\alpha_i c\beta_i & c\alpha_i c\beta_i & -a_i s\beta \\ 0 & 0 & 0 & 1 \end{array} \right] \)
Eigen::Matrix<T, 4, 4> e | ( | ) | const |
Returns a Eigen 4x4 matrix \( \mathbf{M}\in SE(3) \) that represents this homogeneous transformation.
|
inline |
Compares the transformations with a given precision.
Performs an element wise comparison. Two elements are considered equal if the difference are less than precision.
t3d | [in] Transform to compare with |
precision | [in] The precision to use for testing |
|
static |
Constructs the identity transform.
\( \mathbf{T} = \left[ \begin{array}{cccc} 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 1 \end{array} \right] \)
|
inlinestatic |
creates a transformation that is positioned in eye and looking toward center along -z where up indicates the upward direction along which the y-axis is placed. Same convention as for gluLookAt and is handy for placing a cameraview.
eye | [in] position of view |
center | [in] point to look toward |
up | [in] the upward direction (the |
|
inline |
Comparison operator.
The comparison operator makes a element wise comparison. Returns true if any of the elements are different.
rhs | [in] Transform to compare with |
|
inline |
Returns matrix element reference.
row | [in] row, row must be \( < 3 \) |
col | [in] col, col must be \( < 4 \) |
|
inline |
Returns const matrix element reference.
row | [in] row, row must be \( < 3 \) |
col | [in] col, col must be \( < 4 \) |
|
inline |
Calculates \( \robax{a}{\mathbf{p}} = \robabx{a}{b}{\mathbf{T}} \robax{b}{\mathbf{p}} \) thus transforming point \( \mathbf{p} \) from frame \( b \) to frame \( a \).
bP | [in] \( \robax{b}{\mathbf{p}} \) |
|
inline |
Calculates \( \robabx{a}{c}{\mathbf{T}} = \robabx{a}{b}{\mathbf{T}} \robabx{b}{c}{\mathbf{T}} \).
bTc | [in] \( \robabx{b}{c}{\mathbf{T}} \) |
\( \robabx{a}{c}{\mathbf{T}} = \left[ \begin{array}{cc} \robabx{a}{b}{\mathbf{R}}\robabx{b}{c}{\mathbf{R}} & \robabx{a}{b}{\mathbf{d}} + \robabx{a}{b}{\mathbf{R}}\robabx{b}{c}{\mathbf{d}} \\ \begin{array}{ccc}0 & 0 & 0\end{array} & 1 \end{array} \right] \)
|
inline |
Comparison operator.
The comparison operator makes a element wise comparison. Returns true only if all elements are equal.
rhs | [in] Transform to compare with |
|
inline |
Gets the position part \( \mathbf{d} \) from \( \mathbf{T} \).
|
inline |
Gets the position part \( \mathbf{d} \) from \( \mathbf{T} \).
|
inline |
Gets the rotation part \( \mathbf{R} \) from \( \mathbf{T} \).
|
inline |
Gets the rotation part \( \mathbf{R} \) from \( \mathbf{T} \).
|
related |
Calculates \( \robabx{b}{a}{\mathbf{T}} = \robabx{a}{b}{\mathbf{T}}^{-1} \).
aTb | [in] the transform matrix \( \robabx{a}{b}{\mathbf{T}} \) |
\( \robabx{a}{b}{\mathbf{T}}^{-1} = \left[ \begin{array}{cc} \robabx{a}{b}{\mathbf{R}}^{T} & - \robabx{a}{b}{\mathbf{R}}^{T} \robabx{a}{b}{\mathbf{d}} \\ \begin{array}{ccc}0 & 0 & 0\end{array} & 1 \end{array} \right] \)
|
friend |
Outputs transform to stream.
os | [in/out] an output stream |
t | [in] the transform that is to be sent to the output stream |
|
related |
Enable read-serialization of class T by overloading this method. Data is read from iarchive and filled into sobject.
sobject | [out] the object in which the data should be streamed into |
iarchive | [in] the InputArchive from which to read data. |
id | [in] The id of the serialized sobject. |
|
related |
Enable read-serialization of class T by overloading this method. Data is read from iarchive and filled into sobject.
sobject | [out] the object in which the data should be streamed into |
iarchive | [in] the InputArchive from which to read data. |
id | [in] The id of the serialized sobject. |
|
related |
Boost serialization.
archive | [in] the boost archive to read from or write to. |
transform | [in/out] the transformation to read/write. |
version | [in] class version (currently version 0). |
|
related |
Enable write-serialization of class T by overloading this method. Data is written to oarchive from the sobject.
sobject | [in] the object from which the data should be streamed. |
oarchive | [out] the OutputArchive in which data should be written. |
id | [in] The id of the serialized sobject. |
|
related |
Enable write-serialization of class T by overloading this method. Data is written to oarchive from the sobject.
sobject | [in] the object from which the data should be streamed. |
oarchive | [out] the OutputArchive in which data should be written. |
id | [in] The id of the serialized sobject. |