FOUND
Loading...
Searching...
No Matches
found::Attitude Class Reference

An Attitude is an immutable object that represents the orientation of a 3D point. More...

#include <attitude-utils.hpp>

Collaboration diagram for found::Attitude:

Public Member Functions

 Attitude ()=default
 
 Attitude (const Quaternion &)
 Constructs an Attitude object from Quaternion information.
 
 Attitude (const Mat3 &dcm)
 Constructs an Attitude object from a Direction Cosine Matrix (A matrix holding the direction cosines for an attitude)
 
Quaternion GetQuaternion () const
 Provides the Quaternion corresponding to this Attitude.
 
Mat3 GetDCM () const
 Obtains the rotation matrix from this Attitude.
 
EulerAngles ToSpherical () const
 Obtains the Euler Angles of this Attitude.
 
Vec3 Rotate (const Vec3 &) const
 Obtains a vector rotated to this Attitude from another vector (Convert a vector from the reference frame to the body frame.)
 

Private Types

enum  AttitudeType { NullType , QuaternionType , DCMType }
 Represents what internal representation for attitude is being used. More...
 

Private Attributes

Quaternion quaternion
 Internal Quaternion Representation.
 
Mat3 dcm
 Internal DCM Representation.
 
AttitudeType type
 Internal Representation Type.
 

Detailed Description

An Attitude is an immutable object that represents the orientation of a 3D point.

The attitude (orientation) of a spacecraft. The Attitude object stores either a rotation matrix (direction cosine matrix) or a quaternion, and converts automatically to the other format when needed.

Note
When porting to an embedded device, you'll probably want to get rid of this class and adapt to either quaternions or DCMs exclusively, depending on the natural output format of whatever attitude estimation algorithm you're using.

Member Enumeration Documentation

◆ AttitudeType

Represents what internal representation for attitude is being used.

Enumerator
NullType 

No Internal representation.

QuaternionType 

Quaternion Internal Representation.

DCMType 

DCM Internal Representation.

Constructor & Destructor Documentation

◆ Attitude() [1/3]

found::Attitude::Attitude ( )
default

◆ Attitude() [2/3]

found::Attitude::Attitude ( const Quaternion quat)
explicit

Constructs an Attitude object from Quaternion information.

Parameters
quatThe quaternion to base the attitude off of

◆ Attitude() [3/3]

found::Attitude::Attitude ( const Mat3 matrix)
explicit

Constructs an Attitude object from a Direction Cosine Matrix (A matrix holding the direction cosines for an attitude)

Parameters
matrixThe matrix holding the direction cosines

Member Function Documentation

◆ GetDCM()

Mat3 found::Attitude::GetDCM ( ) const

Obtains the rotation matrix from this Attitude.

Returns
A matrix containing the direction cosines indicated by this

◆ GetQuaternion()

Quaternion found::Attitude::GetQuaternion ( ) const

Provides the Quaternion corresponding to this Attitude.

Returns
A Quaternion that holds the attitude information of this

◆ Rotate()

Vec3 found::Attitude::Rotate ( const Vec3 vec) const

Obtains a vector rotated to this Attitude from another vector (Convert a vector from the reference frame to the body frame.)

Parameters
vecThe vector to rotate
Returns
A new vector that is rotated from vec based on this

◆ ToSpherical()

EulerAngles found::Attitude::ToSpherical ( ) const

Obtains the Euler Angles of this Attitude.

Returns
An EulerAngles object that holds the Euler Angles of this

Member Data Documentation

◆ dcm

Mat3 found::Attitude::dcm
private

Internal DCM Representation.

◆ quaternion

Quaternion found::Attitude::quaternion
private

Internal Quaternion Representation.

◆ type

AttitudeType found::Attitude::type
private

Internal Representation Type.


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