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

Rotation matrix. More...

#include <Rotation.h>

Inheritance diagram for BIORBD_NAMESPACE::utils::Rotation:
BIORBD_NAMESPACE::utils::Matrix3d

Public Member Functions

 Rotation (const Matrix3d &matrix=Matrix3d::Identity())
 Construct Rotation matrix.
 Rotation (const Scalar &v00, const Scalar &v01, const Scalar &v02, const Scalar &v10, const Scalar &v11, const Scalar &v12, const Scalar &v20, const Scalar &v21, const Scalar &v22)
 Rotation Construct a Rotation matrix by elements.
 Rotation (const Vector &rotation, const String &rotationSequence)
 Contruct a Rotation matrix.
 Rotation (const utils::SpatialTransform &st)
 Contruct Rototrans.
Vector3d axe (size_t idx) const
 Get a particular axis of the Rotation matrix.
Public Member Functions inherited from BIORBD_NAMESPACE::utils::Matrix3d
 Matrix3d ()
 Construct matrix.
 Matrix3d (const Matrix3d &other)
 Construct a new Matrix3d from other.
 Matrix3d (const Scalar &v00, const Scalar &v01, const Scalar &v02, const Scalar &v10, const Scalar &v11, const Scalar &v12, const Scalar &v20, const Scalar &v21, const Scalar &v22)
 Rotation Construct a generic 3d matrix by elements.
utils::Scalar normOne () const
 Return the 1-norm of the matrix.
utils::Scalar normInf () const
 Return the inf-norm of the matrix.
utils::Matrix3d orthoNormalize () const
 Produce an orthonormal matrix from the current matrix.

Static Public Member Functions

static Rotation fromSpatialTransform (const utils::SpatialTransform &st)
 set the Rotation from a spatial transform
static Rotation fromEulerAngles (const Vector &rot, const String &seq)
 Create a Rotation from Euler angles.
static Rotation fromMarkersNonNormalized (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 defined by markers
static Rotation fromMarkers (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 defined by markers
static Vector toEulerAngles (const Rotation &r, const String &seq)
 Return extracted angles from the rotation matrix into Euler angles using the provided sequence.
static utils::Rotation mean (const std::vector< utils::Rotation > &mToMean)
 Get the mean of the Rotation matrices.
Static Public Member Functions inherited from BIORBD_NAMESPACE::utils::Matrix3d
static utils::Matrix3d fromEulerSequence (const utils::String &seq)
 Creates a base 3d matrix from a euler sequence of exactly 3 elements.

Protected Member Functions

void checkUnitary ()
 Check if the Rotation is a unitary matrix of rotation.

Detailed Description

Rotation matrix.

Definition at line 28 of file Rotation.h.

Constructor & Destructor Documentation

◆ Rotation() [1/4]

utils::Rotation::Rotation ( const Matrix3d & matrix = Matrix3d::Identity())

Construct Rotation matrix.

Parameters
matrix3D identity matrix

Definition at line 13 of file Rotation.cpp.

◆ Rotation() [2/4]

utils::Rotation::Rotation ( const Scalar & v00,
const Scalar & v01,
const Scalar & v02,
const Scalar & v10,
const Scalar & v11,
const Scalar & v12,
const Scalar & v20,
const Scalar & v21,
const Scalar & v22 )

Rotation Construct a Rotation matrix by elements.

Parameters
v00Row 0, Col 0
v01Row 0, Col 1
v02Row 0, Col 2
v10Row 1, Col 0
v11Row 1, Col 1
v12Row 1, Col 2
v20Row 2, Col 0
v21Row 2, Col 1
v22Row 2, Col 2

Definition at line 27 of file Rotation.cpp.

◆ Rotation() [3/4]

utils::Rotation::Rotation ( const Vector & rotation,
const String & rotationSequence )

Contruct a Rotation matrix.

Parameters
rotationThe Euler angles vector
rotationSequenceThe rotation sequence

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

Definition at line 39 of file Rotation.cpp.

◆ Rotation() [4/4]

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

Contruct Rototrans.

Parameters
stSpatial Transform vector

Definition at line 44 of file Rotation.cpp.

Member Function Documentation

◆ axe()

utils::Vector3d utils::Rotation::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 47 of file Rotation.cpp.

◆ checkUnitary()

void utils::Rotation::checkUnitary ( )
protected

Check if the Rotation is a unitary matrix of rotation.

That function throws a runtime_error if the check fails

Definition at line 297 of file Rotation.cpp.

◆ fromEulerAngles()

utils::Rotation utils::Rotation::fromEulerAngles ( const Vector & rot,
const String & seq )
static

Create a Rotation from Euler angles.

Parameters
rotThe Euler angles vector
seqThe rotation sequence
Returns
The rotation matrix

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

Definition at line 57 of file Rotation.cpp.

◆ fromMarkers()

utils::Rotation utils::Rotation::fromMarkers ( 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 defined by markers

Parameters
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 168 of file Rotation.cpp.

◆ fromMarkersNonNormalized()

utils::Rotation utils::Rotation::fromMarkersNonNormalized ( 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 defined by markers

Parameters
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 89 of file Rotation.cpp.

◆ fromSpatialTransform()

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

set the Rotation from a spatial transform

Parameters
stThe spatial transform
Returns
The matrix of Rotation

Definition at line 52 of file Rotation.cpp.

◆ mean()

utils::Rotation utils::Rotation::mean ( const std::vector< utils::Rotation > & mToMean)
static

Get the mean of the Rotation matrices.

Parameters
mToMeanThe Rotation matrices to mean
Returns
The mean Rotation matrix

Definition at line 275 of file Rotation.cpp.

◆ toEulerAngles()

utils::Vector utils::Rotation::toEulerAngles ( const Rotation & r,
const String & seq )
static

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

Parameters
rThe Rotation 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 187 of file Rotation.cpp.


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