maliput
RollPitchYaw Class Reference

Detailed Description

This class represents the orientation between two arbitrary frames A and D associated with a Space-fixed (extrinsic) X-Y-Z rotation by "roll-pitch-yaw" angles [r, p, y], which is equivalent to a Body-fixed (intrinsic) Z-Y-X rotation by "yaw-pitch-roll" angles [y, p, r].

The rotation matrix R_AD associated with this roll-pitch-yaw [r, p, y] rotation sequence is equal to the matrix multiplication shown below.

⎡cos(y) -sin(y) 0⎤ ⎡ cos(p) 0 sin(p)⎤ ⎡1 0 0 ⎤
R_AD = ⎢sin(y) cos(y) 0⎥ * ⎢ 0 1 0 ⎥ * ⎢0 cos(r) -sin(r)⎥
⎣ 0 0 1⎦ ⎣-sin(p) 0 cos(p)⎦ ⎣0 sin(r) cos(r)⎦
= R_AB * R_BC * R_CD

#include <include/maliput/math/roll_pitch_yaw.h>

Public Member Functions

 MALIPUT_DEFAULT_COPY_AND_MOVE_AND_ASSIGN (RollPitchYaw)
 
 RollPitchYaw ()=default
 Constructs a RollPitchYaw with zeros for each angle. More...
 
 RollPitchYaw (const Vector3 &rpy)
 Constructs a RollPitchYaw from a 3x1 array of angles. More...
 
 RollPitchYaw (double roll, double pitch, double yaw)
 Constructs a RollPitchYaw from roll, pitch, yaw angles in radians. More...
 
 RollPitchYaw (const Quaternion &quaternion)
 Uses a Quaternion to construct a RollPitchYaw with roll-pitch-yaw angles [r, p, y] in the range -π <= r <= π, -π/2 <= p <= π/2, -π <= y <= n. More...
 
RollPitchYawset (const Vector3 &rpy)
 Sets this RollPitchYaw from a 3x1 array of angles. More...
 
RollPitchYawset (double roll, double pitch, double yaw)
 Sets this RollPitchYaw from roll, pitch, yaw angles in radians. More...
 
void SetFromQuaternion (const Quaternion &quaternion)
 Uses a Quaternion to set this RollPitchYaw with roll-pitch-yaw angles [r, p, y] in the range -π <= r <= π, -π/2 <= p <= π/2, -π <= y <= n. More...
 
const Vector3vector () const
 Returns the Vector3 underlying this RollPitchYaw. More...
 
double roll_angle () const
 Returns the roll-angle underlying this RollPitchYaw. More...
 
double pitch_angle () const
 Returns the pitch-angle underlying this RollPitchYaw. More...
 
double yaw_angle () const
 Returns the yaw-angle underlying this RollPitchYaw. More...
 
doubleroll_angle ()
 Mutable reference to roll angle. More...
 
doublepitch_angle ()
 Mutable reference to pitch angle. More...
 
doubleyaw_angle ()
 Mutable reference to yaw angle. More...
 
Matrix3 ToMatrix () const
 Returns the 3x3 matrix representation of the rotation matrix that corresponds to this RollPitchYaw. More...
 
Quaternion ToQuaternion () const
 Returns a quaternion representation of this RollPitchYaw. More...
 
Matrix3 CalcRotationMatrixDt (const Vector3 &rpyDt) const
 Forms Ṙ, the ordinary derivative of the RotationMatrix R with respect to an independent variable t (t usually denotes time) and R is the RotationMatrix formed by this RollPitchYaw. More...
 

Static Public Attributes

static constexpr double kTolerance = 1e-15
 Tolerance value to determine nearness to the gimbal-lock singularity as cos(pitch_angle) -> 0. More...
 

Constructor & Destructor Documentation

◆ RollPitchYaw() [1/4]

RollPitchYaw ( )
default

Constructs a RollPitchYaw with zeros for each angle.

◆ RollPitchYaw() [2/4]

RollPitchYaw ( const Vector3 rpy)
explicit

Constructs a RollPitchYaw from a 3x1 array of angles.

Parameters
[in]rpy3x1 array with roll, pitch, yaw angles in radians.

◆ RollPitchYaw() [3/4]

RollPitchYaw ( double  roll,
double  pitch,
double  yaw 
)

Constructs a RollPitchYaw from roll, pitch, yaw angles in radians.

Parameters
[in]rollx-directed angle in the SpaceXYZ rotation sequence.
[in]pitchy-directed angle in the SpaceXYZ rotation sequence.
[in]yawz-directed angle in the SpaceXYZ rotation sequence.

◆ RollPitchYaw() [4/4]

RollPitchYaw ( const Quaternion quaternion)
explicit

Uses a Quaternion to construct a RollPitchYaw with roll-pitch-yaw angles [r, p, y] in the range -π <= r <= π, -π/2 <= p <= π/2, -π <= y <= n.

Parameters
[in]quaternionunit Quaternion.

Member Function Documentation

◆ CalcRotationMatrixDt()

Matrix3 CalcRotationMatrixDt ( const Vector3 rpyDt) const

Forms Ṙ, the ordinary derivative of the RotationMatrix R with respect to an independent variable t (t usually denotes time) and R is the RotationMatrix formed by this RollPitchYaw.

The roll-pitch-yaw angles r, p, y are regarded as functions of t [i.e., r(t), p(t), y(t)].

Parameters
[in]rpyDtOrdinary derivative of rpy with respect to an independent variable t (t usually denotes time, but not necessarily).
Returns
Ṙ, the ordinary derivative of R with respect to t, calculated as Ṙ = ∂R/∂r * ṙ + ∂R/∂p * ṗ + ∂R/∂y * ẏ. In other words, the returned (i, j) element is ∂Rij/∂r * ṙ + ∂Rij/∂p * ṗ + ∂Rij/∂y * ẏ.

◆ MALIPUT_DEFAULT_COPY_AND_MOVE_AND_ASSIGN()

MALIPUT_DEFAULT_COPY_AND_MOVE_AND_ASSIGN ( RollPitchYaw  )

◆ pitch_angle() [1/2]

double& pitch_angle ( )

Mutable reference to pitch angle.

◆ pitch_angle() [2/2]

double pitch_angle ( ) const

Returns the pitch-angle underlying this RollPitchYaw.

◆ roll_angle() [1/2]

double& roll_angle ( )

Mutable reference to roll angle.

◆ roll_angle() [2/2]

double roll_angle ( ) const

Returns the roll-angle underlying this RollPitchYaw.

◆ set() [1/2]

RollPitchYaw & set ( const Vector3 rpy)

Sets this RollPitchYaw from a 3x1 array of angles.

Parameters
[in]rpy3x1 array with roll, pitch, yaw angles in radians.

◆ set() [2/2]

RollPitchYaw & set ( double  roll,
double  pitch,
double  yaw 
)

Sets this RollPitchYaw from roll, pitch, yaw angles in radians.

Parameters
[in]rollx-directed angle in the SpaceXYZ rotation sequence.
[in]pitchy-directed angle in the SpaceXYZ rotation sequence.
[in]yawz-directed angle in the SpaceXYZ rotation sequence.

◆ SetFromQuaternion()

void SetFromQuaternion ( const Quaternion quaternion)

Uses a Quaternion to set this RollPitchYaw with roll-pitch-yaw angles [r, p, y] in the range -π <= r <= π, -π/2 <= p <= π/2, -π <= y <= n.

Parameters
[in]quaternionunit Quaternion.

◆ ToMatrix()

Matrix3 ToMatrix ( ) const

Returns the 3x3 matrix representation of the rotation matrix that corresponds to this RollPitchYaw.

◆ ToQuaternion()

Quaternion ToQuaternion ( ) const

Returns a quaternion representation of this RollPitchYaw.

◆ vector()

const Vector3 & vector ( ) const

Returns the Vector3 underlying this RollPitchYaw.

◆ yaw_angle() [1/2]

double& yaw_angle ( )

Mutable reference to yaw angle.

◆ yaw_angle() [2/2]

double yaw_angle ( ) const

Returns the yaw-angle underlying this RollPitchYaw.

Member Data Documentation

◆ kTolerance

constexpr double kTolerance = 1e-15
staticconstexpr

Tolerance value to determine nearness to the gimbal-lock singularity as cos(pitch_angle) -> 0.


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