APM:Libraries
Public Member Functions | Public Attributes | List of all members
Matrix3< T > Class Template Reference

#include <matrix3.h>

Public Member Functions

constexpr Matrix3 ()
 
constexpr Matrix3 (const Vector3< T > &a0, const Vector3< T > &b0, const Vector3< T > &c0)
 
constexpr Matrix3 (const T ax, const T ay, const T az, const T bx, const T by, const T bz, const T cx, const T cy, const T cz)
 
void operator() (const Vector3< T > &a0, const Vector3< T > &b0, const Vector3< T > &c0)
 
bool operator== (const Matrix3< T > &m)
 
bool operator!= (const Matrix3< T > &m)
 
Matrix3< T > operator- (void) const
 
Matrix3< T > operator+ (const Matrix3< T > &m) const
 
Matrix3< T > & operator+= (const Matrix3< T > &m)
 
Matrix3< T > operator- (const Matrix3< T > &m) const
 
Matrix3< T > & operator-= (const Matrix3< T > &m)
 
Matrix3< T > operator* (const T num) const
 
Matrix3< T > & operator*= (const T num)
 
Matrix3< T > operator/ (const T num) const
 
Matrix3< T > & operator/= (const T num)
 
Vector3< T > & operator[] (uint8_t i)
 
const Vector3< T > & operator[] (uint8_t i) const
 
Vector3< T > operator* (const Vector3< T > &v) const
 
Vector3< T > mul_transpose (const Vector3< T > &v) const
 
Vector2< T > mulXY (const Vector3< T > &v) const
 
Vector3< T > colx (void) const
 
Vector3< T > coly (void) const
 
Vector3< T > colz (void) const
 
Matrix3< T > operator* (const Matrix3< T > &m) const
 
Matrix3< T > & operator*= (const Matrix3< T > &m)
 
Matrix3< T > transposed (void) const
 
void transpose (void)
 
det () const
 
bool inverse (Matrix3< T > &inv) const
 
bool invert ()
 
void zero (void)
 
void identity (void)
 
bool is_nan (void)
 
void from_euler (float roll, float pitch, float yaw)
 
void to_euler (float *roll, float *pitch, float *yaw) const
 
void from_rotation (enum Rotation rotation)
 
Vector3< T > to_euler312 () const
 
void from_euler312 (float roll, float pitch, float yaw)
 
void rotate (const Vector3< T > &g)
 
void from_axis_angle (const Vector3< T > &v, float theta)
 
void normalize (void)
 

Public Attributes

Vector3< T > a
 
Vector3< T > b
 
Vector3< T > c
 

Detailed Description

template<typename T>
class Matrix3< T >

Definition at line 44 of file matrix3.h.

Constructor & Destructor Documentation

◆ Matrix3() [1/3]

template<typename T>
constexpr Matrix3< T >::Matrix3 ( )
inline

Definition at line 52 of file matrix3.h.

◆ Matrix3() [2/3]

template<typename T>
constexpr Matrix3< T >::Matrix3 ( const Vector3< T > &  a0,
const Vector3< T > &  b0,
const Vector3< T > &  c0 
)
inline

Definition at line 55 of file matrix3.h.

◆ Matrix3() [3/3]

template<typename T>
constexpr Matrix3< T >::Matrix3 ( const T  ax,
const T  ay,
const T  az,
const T  bx,
const T  by,
const T  bz,
const T  cx,
const T  cy,
const T  cz 
)
inline

Definition at line 61 of file matrix3.h.

Member Function Documentation

◆ colx()

template<typename T>
Vector3<T> Matrix3< T >::colx ( void  ) const
inline

Definition at line 157 of file matrix3.h.

Referenced by AP_AHRS_DCM::drift_correction(), AP_AHRS_DCM::estimate_wind(), and Vector3< int32_t >::operator*().

Here is the caller graph for this function:

◆ coly()

template<typename T>
Vector3<T> Matrix3< T >::coly ( void  ) const
inline

Definition at line 163 of file matrix3.h.

Referenced by Vector3< int32_t >::operator*().

Here is the caller graph for this function:

◆ colz()

template<typename T>
Vector3<T> Matrix3< T >::colz ( void  ) const
inline

Definition at line 169 of file matrix3.h.

Referenced by Vector3< int32_t >::operator*().

Here is the caller graph for this function:

◆ det()

template<typename T >
template double Matrix3< T >::det ( ) const

Calculate the determinant of this matrix.

Returns
The value of the determinant.

Definition at line 197 of file matrix3.cpp.

Referenced by Matrix3< float >::from_axis_angle(), and Matrix3< float >::transpose().

Here is the caller graph for this function:

◆ from_axis_angle()

template<typename T>
void Matrix3< T >::from_axis_angle ( const Vector3< T > &  v,
float  theta 
)

Definition at line 248 of file matrix3.cpp.

Referenced by SITL::Calibration::_calibration_poses(), Matrix3< float >::from_axis_angle(), Matrix3< float >::is_nan(), and test_rotation_accuracy().

Here is the caller graph for this function:

◆ from_euler()

template<typename T >
template void Matrix3< T >::from_euler ( float  roll,
float  pitch,
float  yaw 
)

◆ from_euler312()

template<typename T >
void Matrix3< T >::from_euler312 ( float  roll,
float  pitch,
float  yaw 
)

Definition at line 92 of file matrix3.cpp.

Referenced by Matrix3< float >::from_axis_angle(), Quaternion::from_vector312(), NavEKF2_core::fuseEulerYaw(), NavEKF3_core::fuseEulerYaw(), and Matrix3< float >::is_nan().

Here is the caller graph for this function:

◆ from_rotation()

template<typename T >
void Matrix3< T >::from_rotation ( enum Rotation  rotation)

Definition at line 63 of file matrix3.cpp.

Referenced by SITL::Aircraft::fill_fdm(), Matrix3< float >::from_axis_angle(), Matrix3< float >::is_nan(), and test_rotate_matrix().

Here is the caller graph for this function:

◆ identity()

template<typename T>
void Matrix3< T >::identity ( void  )
inline

Definition at line 219 of file matrix3.h.

Referenced by SITL::Calibration::_calibration_poses(), AP_AHRS_DCM::AP_AHRS_DCM(), AP_AHRS_NavEKF::AP_AHRS_NavEKF(), AP_AHRS_View::AP_AHRS_View(), test_matrix_rotate(), and CompassLearn::update().

Here is the caller graph for this function:

◆ inverse()

template<typename T>
template bool Matrix3< T >::inverse ( Matrix3< T > &  inv) const

Calculate the inverse of this matrix.

Parameters
inv[in]Where to store the result.
Returns
If this matrix is invertible, then true is returned. Otherwise, inv is unmodified and false is returned.

Definition at line 205 of file matrix3.cpp.

Referenced by Matrix3< float >::from_axis_angle(), TEST_P(), and Matrix3< float >::transpose().

Here is the caller graph for this function:

◆ invert()

template<typename T >
template bool Matrix3< T >::invert ( )

Invert this matrix if it is invertible.

Returns
Return true if this matrix could be successfully inverted and false otherwise.

Definition at line 227 of file matrix3.cpp.

Referenced by Matrix3< float >::from_axis_angle(), Matrix3< float >::transpose(), and CompassLearn::update().

Here is the caller graph for this function:

◆ is_nan()

template<typename T>
bool Matrix3< T >::is_nan ( void  )
inline

Definition at line 227 of file matrix3.h.

Referenced by AP_AHRS_DCM::check_matrix(), and test_conversion().

Here is the caller graph for this function:

◆ mul_transpose()

template<typename T>
template Vector3< double > Matrix3< T >::mul_transpose ( const Vector3< T > &  v) const

◆ mulXY()

template<typename T>
template Vector2< double > Matrix3< T >::mulXY ( const Vector3< T > &  v) const

Definition at line 157 of file matrix3.cpp.

Referenced by Matrix3< float >::from_axis_angle(), Matrix3< float >::operator[](), and AP_AHRS_DCM::yaw_error_compass().

Here is the caller graph for this function:

◆ normalize()

template<typename T >
void Matrix3< T >::normalize ( void  )

Definition at line 135 of file matrix3.cpp.

Referenced by SITL::Aircraft::extrapolate_sensors(), Matrix3< float >::from_axis_angle(), Matrix3< float >::is_nan(), SITL::Gimbal::update(), SITL::Tracker::update(), SITL::SimRover::update(), and SITL::Aircraft::update_dynamics().

Here is the caller graph for this function:

◆ operator!=()

template<typename T>
bool Matrix3< T >::operator!= ( const Matrix3< T > &  m)
inline

Definition at line 81 of file matrix3.h.

◆ operator()()

template<typename T>
void Matrix3< T >::operator() ( const Vector3< T > &  a0,
const Vector3< T > &  b0,
const Vector3< T > &  c0 
)
inline

Definition at line 69 of file matrix3.h.

◆ operator*() [1/3]

template<typename T>
Matrix3<T> Matrix3< T >::operator* ( const T  num) const
inline

Definition at line 113 of file matrix3.h.

Referenced by Matrix3< float >::colz(), Matrix3< float >::from_axis_angle(), and Matrix3< float >::operator[]().

Here is the caller graph for this function:

◆ operator*() [2/3]

template<typename T>
Vector3< T > Matrix3< T >::operator* ( const Vector3< T > &  v) const

Definition at line 148 of file matrix3.cpp.

◆ operator*() [3/3]

template<typename T>
Matrix3< T > Matrix3< T >::operator* ( const Matrix3< T > &  m) const

Definition at line 174 of file matrix3.cpp.

◆ operator*=() [1/2]

template<typename T>
Matrix3<T>& Matrix3< T >::operator*= ( const T  num)
inline

Definition at line 117 of file matrix3.h.

◆ operator*=() [2/2]

template<typename T>
Matrix3<T>& Matrix3< T >::operator*= ( const Matrix3< T > &  m)
inline

Definition at line 177 of file matrix3.h.

◆ operator+()

template<typename T>
Matrix3<T> Matrix3< T >::operator+ ( const Matrix3< T > &  m) const
inline

Definition at line 93 of file matrix3.h.

◆ operator+=()

template<typename T>
Matrix3<T>& Matrix3< T >::operator+= ( const Matrix3< T > &  m)
inline

Definition at line 97 of file matrix3.h.

◆ operator-() [1/2]

template<typename T>
Matrix3<T> Matrix3< T >::operator- ( void  ) const
inline

Definition at line 87 of file matrix3.h.

◆ operator-() [2/2]

template<typename T>
Matrix3<T> Matrix3< T >::operator- ( const Matrix3< T > &  m) const
inline

Definition at line 103 of file matrix3.h.

◆ operator-=()

template<typename T>
Matrix3<T>& Matrix3< T >::operator-= ( const Matrix3< T > &  m)
inline

Definition at line 107 of file matrix3.h.

◆ operator/()

template<typename T>
Matrix3<T> Matrix3< T >::operator/ ( const T  num) const
inline

Definition at line 121 of file matrix3.h.

◆ operator/=()

template<typename T>
Matrix3<T>& Matrix3< T >::operator/= ( const T  num)
inline

Definition at line 125 of file matrix3.h.

◆ operator==()

template<typename T>
bool Matrix3< T >::operator== ( const Matrix3< T > &  m)
inline

Definition at line 75 of file matrix3.h.

◆ operator[]() [1/2]

template<typename T>
Vector3<T>& Matrix3< T >::operator[] ( uint8_t  i)
inline

Definition at line 131 of file matrix3.h.

◆ operator[]() [2/2]

template<typename T>
const Vector3<T>& Matrix3< T >::operator[] ( uint8_t  i) const
inline

Definition at line 139 of file matrix3.h.

◆ rotate()

template<typename T>
template void Matrix3< T >::rotate ( const Vector3< T > &  g)

Definition at line 115 of file matrix3.cpp.

Referenced by SITL::Aircraft::extrapolate_sensors(), Matrix3< float >::from_axis_angle(), Matrix3< float >::is_nan(), AP_AHRS_DCM::matrix_update(), test_matrix_rotate(), test_rotation_accuracy(), SITL::Gimbal::update(), SITL::Tracker::update(), SITL::SimRover::update(), and SITL::Aircraft::update_dynamics().

Here is the caller graph for this function:

◆ to_euler()

template<typename T >
template void Matrix3< T >::to_euler ( float *  roll,
float *  pitch,
float *  yaw 
) const

◆ to_euler312()

template<typename T >
Vector3< T > Matrix3< T >::to_euler312 ( ) const

Definition at line 81 of file matrix3.cpp.

Referenced by Matrix3< float >::from_axis_angle(), Matrix3< float >::is_nan(), Quaternion::to_vector312(), and SITL::Gimbal::update().

Here is the caller graph for this function:

◆ transpose()

template<typename T>
void Matrix3< T >::transpose ( void  )
inline

Definition at line 185 of file matrix3.h.

Referenced by AP_Mount_Servo::stabilize(), and AP_AHRS_View::update().

Here is the caller graph for this function:

◆ transposed()

template<typename T >
template Matrix3< double > Matrix3< T >::transposed ( void  ) const

◆ zero()

template<typename T >
template void Matrix3< T >::zero ( void  )

Definition at line 238 of file matrix3.cpp.

Referenced by Matrix3< float >::from_axis_angle(), NavEKF2_core::InitialiseVariables(), NavEKF3_core::InitialiseVariables(), and Matrix3< float >::transpose().

Here is the caller graph for this function:

Member Data Documentation

◆ a

template<typename T>
Vector3<T> Matrix3< T >::a

◆ b

template<typename T>
Vector3<T> Matrix3< T >::b

◆ c

template<typename T>
Vector3<T> Matrix3< T >::c

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