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

AxisAngle class. More...

#include <AxisAngle.hpp>

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

Public Types

typedef Matrix< Type, 3, 1 > Matrix31
 
- Public Types inherited from matrix::Vector< Type, 3 >
typedef Matrix< Type, M, 1 > MatrixM1
 

Public Member Functions

 AxisAngle (const Type data_[3])
 Constructor from array. More...
 
 AxisAngle ()=default
 Standard constructor. More...
 
 AxisAngle (const Matrix31 &other)
 Constructor from Matrix31. More...
 
 AxisAngle (const Quaternion< Type > &q)
 Constructor from quaternion. More...
 
 AxisAngle (const Dcm< Type > &dcm)
 Constructor from dcm. More...
 
 AxisAngle (const Euler< Type > &euler)
 Constructor from euler angles. More...
 
 AxisAngle (Type x, Type y, Type z)
 Constructor from 3 axis angle values (unit vector * angle) More...
 
 AxisAngle (const Matrix31 &axis_, Type angle_)
 Constructor from axis and angle. More...
 
Vector< Type, 3 > axis ()
 
Type angle ()
 
- Public Member Functions inherited from matrix::Vector< Type, 3 >
 Vector ()=default
 
 Vector (const MatrixM1 &other)
 
 Vector (const Type data_[M])
 
 Vector (const Slice< Type, M, 1, P, Q > &slice_in)
 
Type operator() (size_t i) const
 
Type & operator() (size_t i)
 
Type dot (const MatrixM1 &b) const
 
Type operator* (const MatrixM1 &b) const
 
Vector operator* (Type b) const
 
Type norm () const
 
Type norm_squared () const
 
Type length () const
 
void normalize ()
 
Vector unit () const
 
Vector unit_or_zero (const Type eps=Type(1e-5)) const
 
Vector normalized () const
 
bool longerThan (Type testVal) const
 
Vector sqrt () const
 
- Public Member Functions inherited from matrix::Matrix< Type, M, 1 >
 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::AxisAngle< Type >

AxisAngle class.

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

Definition at line 21 of file AxisAngle.hpp.

Member Typedef Documentation

◆ Matrix31

template<typename Type>
typedef Matrix<Type, 3, 1> matrix::AxisAngle< Type >::Matrix31

Definition at line 33 of file AxisAngle.hpp.

Constructor & Destructor Documentation

◆ AxisAngle() [1/8]

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

Constructor from array.

Parameters
data_array

Definition at line 40 of file AxisAngle.hpp.

References matrix::AxisAngle< Type >::AxisAngle().

Here is the call graph for this function:

◆ AxisAngle() [2/8]

template<typename Type>
matrix::AxisAngle< Type >::AxisAngle ( )
default

Standard constructor.

Referenced by matrix::AxisAngle< Type >::AxisAngle().

Here is the caller graph for this function:

◆ AxisAngle() [3/8]

template<typename Type>
matrix::AxisAngle< Type >::AxisAngle ( const Matrix31 other)
inline

Constructor from Matrix31.

Parameters
otherMatrix31 to copy

Definition at line 55 of file AxisAngle.hpp.

◆ AxisAngle() [4/8]

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

Constructor from quaternion.

This sets the instance from a quaternion representing coordinate transformation 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
qquaternion

Definition at line 69 of file AxisAngle.hpp.

References matrix::acos(), f(), and matrix::sin().

Here is the call graph for this function:

◆ AxisAngle() [5/8]

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

Constructor from dcm.

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

Parameters
dcmdcm to set quaternion to

Definition at line 93 of file AxisAngle.hpp.

◆ AxisAngle() [6/8]

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

Constructor from euler angles.

This sets the instance to a quaternion representing coordinate transformation 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 108 of file AxisAngle.hpp.

◆ AxisAngle() [7/8]

template<typename Type>
matrix::AxisAngle< Type >::AxisAngle ( Type  x,
Type  y,
Type  z 
)
inline

Constructor from 3 axis angle values (unit vector * angle)

Parameters
xr_x*angle
yr_y*angle
zr_z*angle

Definition at line 121 of file AxisAngle.hpp.

◆ AxisAngle() [8/8]

template<typename Type>
matrix::AxisAngle< Type >::AxisAngle ( const Matrix31 axis_,
Type  angle_ 
)
inline

Constructor from axis and angle.

Parameters
axisAn axis of rotation, normalized if not unit length
angleThe amount to rotate

Definition at line 135 of file AxisAngle.hpp.

References matrix::Vector< Type, M >::unit().

Here is the call graph for this function:

Member Function Documentation

◆ angle()

template<typename Type>
Type matrix::AxisAngle< Type >::angle ( )
inline

Definition at line 155 of file AxisAngle.hpp.

References matrix::Vector< Type, M >::norm().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ axis()

template<typename Type>
Vector<Type, 3> matrix::AxisAngle< Type >::axis ( )
inline

Definition at line 147 of file AxisAngle.hpp.

References matrix::Vector< Type, M >::unit().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

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