Biorbd
|
Homogenous matrix to describe translations and rotations simultaneously. More...
#include <RotoTrans.h>
Public Member Functions | |
RotoTrans (const RigidBodyDynamics::Math::Matrix4d &matrix=RigidBodyDynamics::Math::Matrix4d::Identity()) | |
Construct RotoTrans matrix. More... | |
RotoTrans (const biorbd::utils::Scalar &v00, const biorbd::utils::Scalar &v01, const biorbd::utils::Scalar &v02, const biorbd::utils::Scalar &v03, const biorbd::utils::Scalar &v10, const biorbd::utils::Scalar &v11, const biorbd::utils::Scalar &v12, const biorbd::utils::Scalar &v13, const biorbd::utils::Scalar &v20, const biorbd::utils::Scalar &v21, const biorbd::utils::Scalar &v22, const biorbd::utils::Scalar &v23, const biorbd::utils::Scalar &v30, const biorbd::utils::Scalar &v31, const biorbd::utils::Scalar &v32, const biorbd::utils::Scalar &v33) | |
RotoTrans Construct a RotoTrans matrix by elements. More... | |
RotoTrans (const biorbd::utils::Rotation &rot) | |
Contruct Rototrans. More... | |
RotoTrans (const biorbd::utils::Rotation &rot, const biorbd::utils::Vector3d &trans) | |
Contruct Rototrans. More... | |
RotoTrans (const biorbd::utils::Vector &rotation, const biorbd::utils::Vector3d &translation, const biorbd::utils::String &rotationSequence) | |
Contruct Rototrans. More... | |
RotoTrans (const RigidBodyDynamics::Math::SpatialTransform &st) | |
Contruct Rototrans. More... | |
biorbd::utils::Vector3d | axe (unsigned int idx) const |
Get a particular axis of the rotation matrix. More... | |
biorbd::utils::RotoTrans | transpose () const |
Return the tranposed matrix. More... | |
biorbd::utils::Vector3d | trans () const |
Return the translation vector. More... | |
biorbd::utils::Rotation | rot () const |
Return the rotation matrix. More... | |
Static Public Member Functions | |
static biorbd::utils::RotoTrans | fromMarkers (const biorbd::rigidbody::NodeSegment &origin, const std::pair< biorbd::rigidbody::NodeSegment, biorbd::rigidbody::NodeSegment > &axis1markers, const std::pair< biorbd::rigidbody::NodeSegment, biorbd::rigidbody::NodeSegment > &axis2markers, const std::pair< biorbd::utils::String, biorbd::utils::String > &axesNames, const biorbd::utils::String &axisToRecalculate) |
fromMarkers Creates a system of axes from two axes and an origin defined by markers More... | |
static biorbd::utils::RotoTrans | combineRotAndTrans (const biorbd::utils::Rotation &rot, const biorbd::utils::Vector3d &trans) |
Set the RotoTrans from a rotation and a translation. More... | |
static biorbd::utils::RotoTrans | fromSpatialTransform (const RigidBodyDynamics::Math::SpatialTransform &st) |
set the RotoTrans from a spatial transform More... | |
static biorbd::utils::RotoTrans | fromEulerAngles (const biorbd::utils::Vector &rot, const biorbd::utils::Vector3d &trans, const biorbd::utils::String &seq) |
Create a RotoTrans from Euler angles. More... | |
static biorbd::utils::Vector | toEulerAngles (const biorbd::utils::RotoTrans &rt, const biorbd::utils::String &seq) |
Return extracted angles from the rotation matrix into Euler angles using the provided sequence. More... | |
static biorbd::utils::RotoTrans | mean (const std::vector< biorbd::utils::RotoTrans > &rt) |
Get the mean of the 4x4 matrices. More... | |
Protected Member Functions | |
RigidBodyDynamics::Math::Vector4d | expand3dTo4d (const biorbd::utils::Vector3d &v1) |
Expand 3D vector to 4D (padding with an extra 1) More... | |
void | checkUnitary () |
Check if the RotoTrans has a unitary matrix of rotation and the last row is (0, 0, 0, 1) More... | |
Homogenous matrix to describe translations and rotations simultaneously.
Definition at line 32 of file RotoTrans.h.
biorbd::utils::RotoTrans::RotoTrans | ( | const RigidBodyDynamics::Math::Matrix4d & | matrix = RigidBodyDynamics::Math::Matrix4d::Identity() | ) |
Construct RotoTrans matrix.
matrix | 4D identity matrix |
Definition at line 12 of file RotoTrans.cpp.
biorbd::utils::RotoTrans::RotoTrans | ( | const biorbd::utils::Scalar & | v00, |
const biorbd::utils::Scalar & | v01, | ||
const biorbd::utils::Scalar & | v02, | ||
const biorbd::utils::Scalar & | v03, | ||
const biorbd::utils::Scalar & | v10, | ||
const biorbd::utils::Scalar & | v11, | ||
const biorbd::utils::Scalar & | v12, | ||
const biorbd::utils::Scalar & | v13, | ||
const biorbd::utils::Scalar & | v20, | ||
const biorbd::utils::Scalar & | v21, | ||
const biorbd::utils::Scalar & | v22, | ||
const biorbd::utils::Scalar & | v23, | ||
const biorbd::utils::Scalar & | v30, | ||
const biorbd::utils::Scalar & | v31, | ||
const biorbd::utils::Scalar & | v32, | ||
const biorbd::utils::Scalar & | v33 | ||
) |
RotoTrans Construct a RotoTrans matrix by elements.
v00 | Row 0, Col 0 |
v01 | Row 0, Col 1 |
v02 | Row 0, Col 2 |
v03 | Row 0, Col 3 |
v10 | Row 1, Col 0 |
v11 | Row 1, Col 1 |
v12 | Row 1, Col 2 |
v13 | Row 1, Col 3 |
v20 | Row 2, Col 0 |
v21 | Row 2, Col 1 |
v22 | Row 2, Col 2 |
v23 | Row 2, Col 3 |
v30 | Row 3, Col 0 |
v31 | Row 3, Col 1 |
v32 | Row 3, Col 2 |
v33 | Row 3, Col 3 |
Definition at line 19 of file RotoTrans.cpp.
biorbd::utils::RotoTrans::RotoTrans | ( | const biorbd::utils::Rotation & | rot | ) |
biorbd::utils::RotoTrans::RotoTrans | ( | const biorbd::utils::Rotation & | rot, |
const biorbd::utils::Vector3d & | trans | ||
) |
Contruct Rototrans.
rot | The rotation matrix |
trans | Translation vector |
Definition at line 39 of file RotoTrans.cpp.
biorbd::utils::RotoTrans::RotoTrans | ( | const biorbd::utils::Vector & | rotation, |
const biorbd::utils::Vector3d & | translation, | ||
const biorbd::utils::String & | rotationSequence | ||
) |
Contruct Rototrans.
rotation | The Euler angles vector |
translation | The translation vector |
rotationSequence | The rotation sequence |
The number of rotation must match the number of axes in the rotation sequence
Definition at line 47 of file RotoTrans.cpp.
biorbd::utils::RotoTrans::RotoTrans | ( | const RigidBodyDynamics::Math::SpatialTransform & | st | ) |
Contruct Rototrans.
st | Spatial Transform vector |
Definition at line 56 of file RotoTrans.cpp.
biorbd::utils::Vector3d biorbd::utils::RotoTrans::axe | ( | unsigned int | idx | ) | const |
Get a particular axis of the rotation matrix.
idx | The index of axis (x = 0, y = 1 and z = 2) |
Definition at line 76 of file RotoTrans.cpp.
|
protected |
Check if the RotoTrans has a unitary matrix of rotation and the last row is (0, 0, 0, 1)
That function throws a runtime_error if the check fails
Definition at line 169 of file RotoTrans.cpp.
|
static |
Set the RotoTrans from a rotation and a translation.
rot | The matrix of rotation |
trans | The vector of translation |
Definition at line 102 of file RotoTrans.cpp.
|
protected |
Expand 3D vector to 4D (padding with an extra 1)
v1 | Vector to expand |
Definition at line 161 of file RotoTrans.cpp.
|
static |
Create a RotoTrans from Euler angles.
rot | The Euler angles vector |
trans | The translation vector |
seq | The rotation sequence |
The number of rotation umust match the number of axes in the rotation sequence
Definition at line 118 of file RotoTrans.cpp.
|
static |
fromMarkers Creates a system of axes from two axes and an origin defined by markers
origin | The position of the origin |
axis1markers | The beginning and ending of the vector of the first axis |
axis2markers | The beginning and ending of the vector of the second axis |
axesNames | The names ("x", "y" or "z") of the axes |
axisToRecalculate | The axis to recalculate to ensure orthonormal system of axes |
Definition at line 63 of file RotoTrans.cpp.
|
static |
set the RotoTrans from a spatial transform
st | The spatial transform |
Definition at line 112 of file RotoTrans.cpp.
|
static |
Get the mean of the 4x4 matrices.
rt | The RotoTrans matrices to mean |
Definition at line 140 of file RotoTrans.cpp.
biorbd::utils::Rotation biorbd::utils::RotoTrans::rot | ( | ) | const |
|
static |
Return extracted angles from the rotation matrix into Euler angles using the provided sequence.
rt | The RotoTrans matrix to extract angles from |
seq | The angle sequence |
The rotation sequence can be any combination of x, y and z
Definition at line 132 of file RotoTrans.cpp.
biorbd::utils::Vector3d biorbd::utils::RotoTrans::trans | ( | ) | const |
Return the translation vector.
Definition at line 92 of file RotoTrans.cpp.
biorbd::utils::RotoTrans biorbd::utils::RotoTrans::transpose | ( | ) | const |
Return the tranposed matrix.
Definition at line 83 of file RotoTrans.cpp.