PX4 Firmware
PX4 Autopilot Software http://px4.io
matrix::Dcm< Type > Class Template Reference

Direction cosine matrix class. More...

#include <AxisAngle.hpp>

Inheritance diagram for matrix::Dcm< Type >:
Collaboration diagram for matrix::Dcm< Type >:

Public Types

typedef Matrix< Type, 3, 1 > Vector3
 

Public Member Functions

 Dcm ()
 Standard constructor. More...
 
 Dcm (const Type data_[3][3])
 Constructor from array. More...
 
 Dcm (const Type data_[9])
 Constructor from array. More...
 
 Dcm (const Matrix< Type, 3, 3 > &other)
 Copy constructor. More...
 
 Dcm (const Quaternion< Type > &q)
 Constructor from quaternion. More...
 
 Dcm (const Euler< Type > &euler)
 Constructor from euler angles. More...
 
 Dcm (const AxisAngle< Type > &aa)
 Constructor from axis angle. More...
 
Vector< Type, 3 > vee () const
 
void renormalize ()
 
- Public Member Functions inherited from matrix::SquareMatrix< Type, 3 >
 SquareMatrix ()=default
 
 SquareMatrix (const Type data_[M][M])
 
 SquareMatrix (const Type data_[M *M])
 
 SquareMatrix (const Matrix< Type, M, M > &other)
 
 SquareMatrix (const Slice< Type, M, M, P, Q > &in_slice)
 
SquareMatrix< Type, M > & operator= (const Matrix< Type, M, M > &other)
 
SquareMatrix< Type, M > & operator= (const Slice< Type, M, M, P, Q > &in_slice)
 
SquareMatrix< Type, M > I () const
 
bool I (SquareMatrix< Type, M > &i) const
 
Vector< Type, M > diag () const
 
Vector< Type, M *(M+1)/2 > upper_right_triangle () const
 
Type trace () const
 
- Public Member Functions inherited from matrix::Matrix< Type, M, M >
 Matrix ()=default
 
 Matrix (const Type data_[M *N])
 
 Matrix (const Type data_[M][N])
 
 Matrix (const Matrix &other)
 
 Matrix (const Slice< Type, M, N, P, Q > &in_slice)
 
Type operator() (size_t i, size_t j) const
 Accessors/ Assignment etc. More...
 
Type & operator() (size_t i, size_t j)
 
Matrix< Type, M, N > & operator= (const Matrix< Type, M, N > &other)
 
void copyTo (Type dst[M *N]) const
 
void copyToColumnMajor (Type dst[M *N]) const
 
Matrix< Type, M, Poperator* (const Matrix< Type, N, P > &other) const
 Matrix Operations. More...
 
Matrix< Type, M, N > operator* (Type scalar) const
 Scalar Operations. More...
 
Matrix< Type, M, N > emult (const Matrix< Type, M, N > &other) const
 
Matrix< Type, M, N > edivide (const Matrix< Type, M, N > &other) const
 
Matrix< Type, M, N > operator+ (const Matrix< Type, M, N > &other) const
 
Matrix< Type, M, N > operator+ (Type scalar) const
 
Matrix< Type, M, N > operator- (const Matrix< Type, M, N > &other) const
 
Matrix< Type, M, N > operator- () const
 
Matrix< Type, M, N > operator- (Type scalar) const
 
void operator+= (const Matrix< Type, M, N > &other)
 
void operator+= (Type scalar)
 
void operator-= (const Matrix< Type, M, N > &other)
 
void operator-= (Type scalar)
 
void operator*= (const Matrix< Type, N, P > &other)
 
void operator*= (Type scalar)
 
Matrix< Type, M, N > operator/ (Type scalar) const
 
void operator/= (Type scalar)
 
bool operator== (const Matrix< Type, M, N > &other) const
 
bool operator!= (const Matrix< Type, M, N > &other) const
 
void write_string (char *buf, size_t n) const
 Misc. More...
 
void print (FILE *stream=stdout) const
 
Matrix< Type, N, M > transpose () const
 
Matrix< Type, N, M > T () const
 
const Slice< Type, P, Q, M, N > slice (size_t x0, size_t y0) const
 
Slice< Type, P, Q, M, N > slice (size_t x0, size_t y0)
 
const Slice< Type, 1, N, M, N > row (size_t i) const
 
Slice< Type, 1, N, M, N > row (size_t i)
 
const Slice< Type, M, 1, M, N > col (size_t j) const
 
Slice< Type, M, 1, M, N > col (size_t j)
 
void setRow (size_t i, const Matrix< Type, N, 1 > &row_in)
 
void setCol (size_t j, const Matrix< Type, M, 1 > &column)
 
void setZero ()
 
void zero ()
 
void setAll (Type val)
 
void setOne ()
 
void setNaN ()
 
void setIdentity ()
 
void identity ()
 
void swapRows (size_t a, size_t b)
 
void swapCols (size_t a, size_t b)
 
Matrix< Type, M, N > abs () const
 
Type max () const
 
Type min () const
 
bool isAllNan () const
 

Detailed Description

template<typename Type>
class matrix::Dcm< Type >

Direction cosine matrix class.

The rotation between two coordinate frames is described by this class.

Definition at line 15 of file AxisAngle.hpp.

Member Typedef Documentation

◆ Vector3

template<typename Type>
typedef Matrix<Type, 3, 1> matrix::Dcm< Type >::Vector3

Definition at line 42 of file Dcm.hpp.

Constructor & Destructor Documentation

◆ Dcm() [1/7]

template<typename Type>
matrix::Dcm< Type >::Dcm ( )
inline

Standard constructor.

Initializes to identity

Definition at line 49 of file Dcm.hpp.

◆ Dcm() [2/7]

template<typename Type>
matrix::Dcm< Type >::Dcm ( const Type  data_[3][3])
inlineexplicit

Constructor from array.

Parameters
_datapointer to array

Definition at line 59 of file Dcm.hpp.

◆ Dcm() [3/7]

template<typename Type>
matrix::Dcm< Type >::Dcm ( const Type  data_[9])
inlineexplicit

Constructor from array.

Parameters
_datapointer to array

Definition at line 68 of file Dcm.hpp.

◆ Dcm() [4/7]

template<typename Type>
matrix::Dcm< Type >::Dcm ( const Matrix< Type, 3, 3 > &  other)
inline

Copy constructor.

Parameters
otherMatrix33 to set dcm to

Definition at line 77 of file Dcm.hpp.

◆ Dcm() [5/7]

template<typename Type>
matrix::Dcm< Type >::Dcm ( const Quaternion< Type > &  q)
inline

Constructor from quaternion.

Instance is initialized from quaternion representing coordinate transformation from frame 2 to frame 1.

Parameters
qquaternion to set dcm to

Definition at line 89 of file Dcm.hpp.

◆ Dcm() [6/7]

template<typename Type>
matrix::Dcm< Type >::Dcm ( const Euler< Type > &  euler)
inline

Constructor from euler angles.

This sets the transformation matrix from frame 2 to frame 1 where the rotation from frame 1 to frame 2 is described by a 3-2-1 intrinsic Tait-Bryan rotation sequence.

Parameters
eulereuler angle instance

Definition at line 126 of file Dcm.hpp.

◆ Dcm() [7/7]

template<typename Type>
matrix::Dcm< Type >::Dcm ( const AxisAngle< Type > &  aa)
inline

Constructor from axis angle.

This sets the transformation matrix from frame 2 to frame 1 where the rotation from frame 1 to frame 2 is described by a 3-2-1 intrinsic Tait-Bryan rotation sequence.

Parameters
eulereuler angle instance

Definition at line 159 of file Dcm.hpp.

Member Function Documentation

◆ renormalize()

template<typename Type>
void matrix::Dcm< Type >::renormalize ( )
inline

Definition at line 175 of file Dcm.hpp.

Referenced by MatrixTest::dcmRenormTests(), and main().

Here is the caller graph for this function:

◆ vee()

template<typename Type>
Vector<Type, 3> matrix::Dcm< Type >::vee ( ) const
inline

Definition at line 165 of file Dcm.hpp.

Referenced by main().

Here is the caller graph for this function:

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