class
#include <iDynTree/Transform.h>
Transform Class representation the relative displacement between two different frames.
This class is designed to be an easy to use proxy to perform change of frame of expression for iDynTree::
Given that this class it may used to represent homogeneous transform matrix as well as adjoint matrix, no raw access to the underline storage ( data() method ) is provided, because it does not have a canonical representation. Instead, access is given to the two elements of a transform: The position vector and the rotation matrix .
We will indicate this tranform as
The frame whose origin is the reference point and whose orientation the reference orientation is often indicated as .
Similarly the frame whose origin is the point and whose orientation is the orientation is indicated as .
This transform object can be obtained as the 4x4 homogeneous matrix using the asHomogeneousTransform method, or as the 6x6 adjoint matrix using the asAdjointTransform .
Public static functions
Constructors, destructors, conversion operators
Public functions
- void fromHomogeneousTransform(const Matrix4x4& transform)
- Set rotation and translation from a iDynTree::Matrix4x4 object.
- auto operator=(const Transform& other) -> Transform&
- Assigment operator.
- auto getRotation() const -> const Rotation&
- Get the rotation part of the transform.
- auto getPosition() const -> const Position&
- Get the translation part of the transform.
- void setRotation(const Rotation& rotation)
- Set the rotation part of the transform.
- void setPosition(const Position& position)
- Set the translation part of the transform.
Protected variables
Overloaded operators.
This operators are used to change the frame in which a quantity is expressed from the to the of the transform.
- auto operator*(const Transform& other) const -> Transform
- Combine two transforms.
- auto inverse() const -> Transform
- Return the inverse of this Transform.
- auto operator*(const Position& other) const -> Position
- Change reference frame of a point.
- auto operator*(const Wrench& other) const -> Wrench
- Change frame in which a Wrench is expressed.
- auto operator*(const Twist& other) const -> Twist
- Change the frame in which a Twist is expressed.
- auto operator*(const SpatialMomentum& other) const -> SpatialMomentum
- Change the frame in which a SpatialMomentum is expressed.
- auto operator*(const SpatialAcc& other) const -> SpatialAcc
- Change the frame in which a SpatialAcc is expressed.
- auto operator*(const SpatialMotionVector& other) const -> SpatialMotionVector
- Change the frame in which a SpatialMotionVector is expressed.
- auto operator*(const SpatialForceVector& other) const -> SpatialForceVector
- Change the frame in which a SpatialForceVector is expressed.
- auto operator*(const SpatialInertia& other) const -> SpatialInertia
- Change the frame in which a SpatialInertia is expressed.
- auto operator*(const ArticulatedBodyInertia& other) const -> ArticulatedBodyInertia
- Change the frame in which a ArticulatedBodyInertia is expressed.
- auto operator*(const Direction& other) const -> Direction
- Change the frame in which a Direction is expressed.
- auto operator*(const Axis& other) const -> Axis
- Change the frame in which a Axis is expressed.
Raw data accessors.
For several applications it may be useful to access the fransform contents in the raw form of homogeneous matrix or an adjoint matrix.
- auto asHomogeneousTransform() const -> Matrix4x4
- Return the 4x4 homogeneous matrix representing the transform.
- auto asAdjointTransform() const -> Matrix6x6
- Return the 6x6 adjoint matrix representing this transform.
- auto asAdjointTransformWrench() const -> Matrix6x6
- Return the 6x6 adjoint matrix (for wrench) representing this transform.
- auto log() const -> SpatialMotionVector
Output helpers.
Function to print out the Transform.
- auto toString() const -> std::string
- auto reservedToString() const -> std::string
Function documentation
iDynTree:: Transform:: Transform()
Default constructor.
The data is not reset to the default for perfomance reason. Please initialize the data in the class before any use.
iDynTree:: Transform:: Transform(const Matrix4x4& transform)
Constructor from a Matrix4x4 object.
Parameters | |
---|---|
transform | The input homogeneous matrix |
It is equivalent of calling fromHomogeneousTransform()
void iDynTree:: Transform:: fromHomogeneousTransform(const Matrix4x4& transform)
Set rotation and translation from a iDynTree::Matrix4x4 object.
Parameters | |
---|---|
transform | The input homogeneous matrix |
const Rotation& iDynTree:: Transform:: getRotation() const
Get the rotation part of the transform.
Get the rotation matrix , that is the rotation matrix that takes a 3d vector expressed in the orientationFrame and transform it in a 3d vector expressed in the reference orientation frame.
const Position& iDynTree:: Transform:: getPosition() const
Get the translation part of the transform.
Get 3d vector , that is the vector between the point and the reference point, pointing toward the point and expressed in the reference orientation frame.
void iDynTree:: Transform:: setRotation(const Rotation& rotation)
Set the rotation part of the transform.
Set the rotation matrix , that is the rotation matrix that takes a 3d vector expressed in the orientationFrame and transform it in a 3d vector expressed in the reference orientation frame.
void iDynTree:: Transform:: setPosition(const Position& position)
Set the translation part of the transform.
Set 3d vector , that is the vector between the point and the reference point, pointing toward the point and expressed in the reference orientation frame.
SpatialMomentum iDynTree:: Transform:: operator*(const SpatialMomentum& other) const
Change the frame in which a SpatialMomentum is expressed.
Check the operator*(const Wrench & other) documentation for the mathematical details.
SpatialAcc iDynTree:: Transform:: operator*(const SpatialAcc& other) const
Change the frame in which a SpatialAcc is expressed.
Check the operator*(const Twist & other) documentation for the mathematical details.
SpatialMotionVector iDynTree:: Transform:: operator*(const SpatialMotionVector& other) const
Change the frame in which a SpatialMotionVector is expressed.
Check the operator*(const Twist & other) documentation for the mathematical details.
SpatialForceVector iDynTree:: Transform:: operator*(const SpatialForceVector& other) const
Change the frame in which a SpatialForceVector is expressed.
Check the operator*(const Wrench & other) documentation for the mathematical details.
Matrix4x4 iDynTree:: Transform:: asHomogeneousTransform() const
Return the 4x4 homogeneous matrix representing the transform.
The returned matrix is the one with this structure:
Where is the rotation matrix that takes a 3d vector expressed in the orientationFrame and transform it in a 3d vector expressed in the reference orientation frame.
is the vector between the point and the reference point, pointing toward the point and expressed in the reference orientation frame.
Matrix6x6 iDynTree:: Transform:: asAdjointTransform() const
Return the 6x6 adjoint matrix representing this transform.
The returned matrix is the one with this structure:
Where is the rotation matrix that takes a 3d vector expressed in the orientationFrame and transform it in a 3d vector expressed in the reference orientation frame.
is the vector between the point and the reference point, pointing toward the point and expressed in the reference orientation frame is the skew simmetric matrix such that .
Matrix6x6 iDynTree:: Transform:: asAdjointTransformWrench() const
Return the 6x6 adjoint matrix (for wrench) representing this transform.
The returned matrix is the one with this structure:
Where is the rotation matrix that takes a 3d vector expressed in the orientationFrame and transform it in a 3d vector expressed in the reference orientation frame.
is the vector between the point and the reference point, pointing toward the point and expressed in the reference orientation frame is the skew simmetric matrix such that .