Biorbd Release_1.13.0
Loading...
Searching...
No Matches
BIORBD_NAMESPACE::utils::RotoTrans Class Reference

Homogenous matrix to describe translations and rotations simultaneously. More...

#include <RotoTrans.h>

Inheritance diagram for BIORBD_NAMESPACE::utils::RotoTrans:
BIORBD_NAMESPACE::utils::RotoTransNode BIORBD_NAMESPACE::rigidbody::IMU

Public Member Functions

 RotoTrans (const RigidBodyDynamics::Math::Matrix4d &matrix=RigidBodyDynamics::Math::Matrix4d::Identity())
 Construct RotoTrans matrix.
 RotoTrans (const Scalar &v00, const Scalar &v01, const Scalar &v02, const Scalar &v03, const Scalar &v10, const Scalar &v11, const Scalar &v12, const Scalar &v13, const Scalar &v20, const Scalar &v21, const Scalar &v22, const Scalar &v23, const Scalar &v30, const Scalar &v31, const Scalar &v32, const Scalar &v33)
 RotoTrans Construct a RotoTrans matrix by elements.
 RotoTrans (const Rotation &rot)
 Contruct Rototrans.
 RotoTrans (const Rotation &rot, const Vector3d &trans)
 Contruct Rototrans.
 RotoTrans (const Vector &rotation, const Vector3d &translation, const String &rotationSequence)
 Contruct Rototrans.
 RotoTrans (const utils::SpatialTransform &st)
 Contruct Rototrans.
Vector3d axe (size_t idx) const
 Get a particular axis of the rotation matrix.
RotoTrans transpose () const
 Return the tranposed matrix.
Vector3d trans () const
 Return the translation vector.
Rotation rot () const
 Return the rotation matrix.
void checkUnitary ()
 Check if the RotoTrans has a unitary matrix of rotation and the last row is (0, 0, 0, 1).

Static Public Member Functions

static RotoTrans fromMarkers (const rigidbody::NodeSegment &origin, const std::pair< rigidbody::NodeSegment, rigidbody::NodeSegment > &axis1markers, const std::pair< rigidbody::NodeSegment, rigidbody::NodeSegment > &axis2markers, const std::pair< String, String > &axesNames, const String &axisToRecalculate)
 fromMarkers Creates a system of axes from two axes and an origin defined by markers
static RotoTrans combineRotAndTrans (const Rotation &rot, const Vector3d &trans)
 Set the RotoTrans from a rotation and a translation.
static RotoTrans fromSpatialTransform (const utils::SpatialTransform &st)
 set the RotoTrans from a spatial transform
static RotoTrans fromEulerAngles (const Vector &rot, const Vector3d &trans, const String &seq)
 Create a RotoTrans from Euler angles.
static Vector toEulerAngles (const RotoTrans &rt, const String &seq)
 Return extracted angles from the rotation matrix into Euler angles using the provided sequence.
static utils::RotoTrans mean (const std::vector< utils::RotoTrans > &rt)
 Get the mean of the 4x4 matrices.

Protected Member Functions

RigidBodyDynamics::Math::Vector4d expand3dTo4d (const Vector3d &v1)
 Expand 3D vector to 4D (padding with an extra 1).

Detailed Description

Homogenous matrix to describe translations and rotations simultaneously.

Definition at line 31 of file RotoTrans.h.

Constructor & Destructor Documentation

◆ RotoTrans() [1/6]

utils::RotoTrans::RotoTrans ( const RigidBodyDynamics::Math::Matrix4d & matrix = RigidBodyDynamics::Math::Matrix4d::Identity())

Construct RotoTrans matrix.

Parameters
matrix4D identity matrix

Definition at line 14 of file RotoTrans.cpp.

◆ RotoTrans() [2/6]

utils::RotoTrans::RotoTrans ( const Scalar & v00,
const Scalar & v01,
const Scalar & v02,
const Scalar & v03,
const Scalar & v10,
const Scalar & v11,
const Scalar & v12,
const Scalar & v13,
const Scalar & v20,
const Scalar & v21,
const Scalar & v22,
const Scalar & v23,
const Scalar & v30,
const Scalar & v31,
const Scalar & v32,
const Scalar & v33 )

RotoTrans Construct a RotoTrans matrix by elements.

Parameters
v00Row 0, Col 0
v01Row 0, Col 1
v02Row 0, Col 2
v03Row 0, Col 3
v10Row 1, Col 0
v11Row 1, Col 1
v12Row 1, Col 2
v13Row 1, Col 3
v20Row 2, Col 0
v21Row 2, Col 1
v22Row 2, Col 2
v23Row 2, Col 3
v30Row 3, Col 0
v31Row 3, Col 1
v32Row 3, Col 2
v33Row 3, Col 3

Definition at line 19 of file RotoTrans.cpp.

◆ RotoTrans() [3/6]

utils::RotoTrans::RotoTrans ( const Rotation & rot)

Contruct Rototrans.

Parameters
rotThe rotation matrix

Definition at line 56 of file RotoTrans.cpp.

◆ RotoTrans() [4/6]

utils::RotoTrans::RotoTrans ( const Rotation & rot,
const Vector3d & trans )

Contruct Rototrans.

Parameters
rotThe rotation matrix
transTranslation vector

Definition at line 60 of file RotoTrans.cpp.

◆ RotoTrans() [5/6]

utils::RotoTrans::RotoTrans ( const Vector & rotation,
const Vector3d & translation,
const String & rotationSequence )

Contruct Rototrans.

Parameters
rotationThe Euler angles vector
translationThe translation vector
rotationSequenceThe rotation sequence

The number of rotation must match the number of axes in the rotation sequence

Definition at line 65 of file RotoTrans.cpp.

◆ RotoTrans() [6/6]

utils::RotoTrans::RotoTrans ( const utils::SpatialTransform & st)

Contruct Rototrans.

Parameters
stSpatial Transform vector

Definition at line 72 of file RotoTrans.cpp.

Member Function Documentation

◆ axe()

utils::Vector3d utils::RotoTrans::axe ( size_t idx) const

Get a particular axis of the rotation matrix.

Parameters
idxThe index of axis (x = 0, y = 1 and z = 2)
Returns
The axis

Definition at line 90 of file RotoTrans.cpp.

◆ checkUnitary()

void utils::RotoTrans::checkUnitary ( )

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 174 of file RotoTrans.cpp.

◆ combineRotAndTrans()

utils::RotoTrans utils::RotoTrans::combineRotAndTrans ( const Rotation & rot,
const Vector3d & trans )
static

Set the RotoTrans from a rotation and a translation.

Parameters
rotThe matrix of rotation
transThe vector of translation
Returns
The matrix of RotoTrans

Definition at line 112 of file RotoTrans.cpp.

◆ expand3dTo4d()

RigidBodyDynamics::Math::Vector4d utils::RotoTrans::expand3dTo4d ( const Vector3d & v1)
protected

Expand 3D vector to 4D (padding with an extra 1).

Parameters
v1Vector to expand
Returns
The expanded 4D vector

Definition at line 166 of file RotoTrans.cpp.

◆ fromEulerAngles()

utils::RotoTrans utils::RotoTrans::fromEulerAngles ( const Vector & rot,
const Vector3d & trans,
const String & seq )
static

Create a RotoTrans from Euler angles.

Parameters
rotThe Euler angles vector
transThe translation vector
seqThe rotation sequence
Returns
The RotoTrans matrix

The number of rotation umust match the number of axes in the rotation sequence

Definition at line 128 of file RotoTrans.cpp.

◆ fromMarkers()

utils::RotoTrans utils::RotoTrans::fromMarkers ( const rigidbody::NodeSegment & origin,
const std::pair< rigidbody::NodeSegment, rigidbody::NodeSegment > & axis1markers,
const std::pair< rigidbody::NodeSegment, rigidbody::NodeSegment > & axis2markers,
const std::pair< String, String > & axesNames,
const String & axisToRecalculate )
static

fromMarkers Creates a system of axes from two axes and an origin defined by markers

Parameters
originThe position of the origin
axis1markersThe beginning and ending of the vector of the first axis
axis2markersThe beginning and ending of the vector of the second axis
axesNamesThe names ("x", "y" or "z") of the axes
axisToRecalculateThe axis to recalculate to ensure orthonormal system of axes
Returns
The system of axes

Definition at line 75 of file RotoTrans.cpp.

◆ fromSpatialTransform()

utils::RotoTrans utils::RotoTrans::fromSpatialTransform ( const utils::SpatialTransform & st)
static

set the RotoTrans from a spatial transform

Parameters
stThe spatial transform
Returns
The matrix of RotoTrans

Definition at line 123 of file RotoTrans.cpp.

◆ mean()

utils::RotoTrans utils::RotoTrans::mean ( const std::vector< utils::RotoTrans > & rt)
static

Get the mean of the 4x4 matrices.

Parameters
rtThe RotoTrans matrices to mean
Returns
The mean RotoTrans

Definition at line 147 of file RotoTrans.cpp.

◆ rot()

utils::Rotation utils::RotoTrans::rot ( ) const

Return the rotation matrix.

Returns
The rotation matrix

Definition at line 108 of file RotoTrans.cpp.

◆ toEulerAngles()

utils::Vector utils::RotoTrans::toEulerAngles ( const RotoTrans & rt,
const String & seq )
static

Return extracted angles from the rotation matrix into Euler angles using the provided sequence.

Parameters
rtThe RotoTrans matrix to extract angles from
seqThe angle sequence
Returns
The angles (the length of the vector will match the length of sequence)

The rotation sequence can be any combination of x, y and z

Definition at line 140 of file RotoTrans.cpp.

◆ trans()

utils::Vector3d utils::RotoTrans::trans ( ) const

Return the translation vector.

Returns
The translation vector

Definition at line 104 of file RotoTrans.cpp.

◆ transpose()

utils::RotoTrans utils::RotoTrans::transpose ( ) const

Return the tranposed matrix.

Returns
The transposed matrix

Definition at line 95 of file RotoTrans.cpp.


The documentation for this class was generated from the following files: