LOST  0.0.1
LOST: Open-source Star Tracker
lost::Attitude Class Reference

The attitude (orientation) of a spacecraft. More...

#include <attitude-utils.hpp>

Public Member Functions

 Attitude ()=default
 constructs unknown attitude: More...
 
 Attitude (const Quaternion &)
 
 Attitude (const Mat3 &dcm)
 
Quaternion GetQuaternion () const
 Get the quaternion representing the attitude, converting from whatever format is stored. More...
 
Mat3 GetDCM () const
 Get the rotation matrix (direction cosine matrix) representing the attitude, converting from whatever format is stored. More...
 
EulerAngles ToSpherical () const
 Get the euler angles from the attitude, converting from whatever format is stored. More...
 
Vec3 Rotate (const Vec3 &) const
 Convert a vector from the reference frame to the body frame. More...
 
bool IsKnown () const
 

Detailed Description

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. Importantly, an attitude may also be "unknown", representing for example if there weren't enough stars to determine an attitude. When set to unknown, it is illegal to try and convert it to anything, so check IsKnown first!

Note
When porting to an embedded device, you may 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.

Definition at line 138 of file attitude-utils.hpp.

Constructor & Destructor Documentation

◆ Attitude() [1/3]

lost::Attitude::Attitude ( )
default

constructs unknown attitude:

◆ Attitude() [2/3]

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

Definition at line 348 of file attitude-utils.cpp.

◆ Attitude() [3/3]

lost::Attitude::Attitude ( const Mat3 dcm)
explicit

Definition at line 351 of file attitude-utils.cpp.

Member Function Documentation

◆ GetDCM()

Mat3 lost::Attitude::GetDCM ( ) const

Get the rotation matrix (direction cosine matrix) representing the attitude, converting from whatever format is stored.

Definition at line 408 of file attitude-utils.cpp.

Here is the call graph for this function:

◆ GetQuaternion()

Quaternion lost::Attitude::GetQuaternion ( ) const

Get the quaternion representing the attitude, converting from whatever format is stored.

Definition at line 396 of file attitude-utils.cpp.

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

◆ IsKnown()

bool lost::Attitude::IsKnown ( ) const

Definition at line 443 of file attitude-utils.cpp.

◆ Rotate()

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

Convert a vector from the reference frame to the body frame.

Definition at line 420 of file attitude-utils.cpp.

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

◆ ToSpherical()

EulerAngles lost::Attitude::ToSpherical ( ) const

Get the euler angles from the attitude, converting from whatever format is stored.

Definition at line 432 of file attitude-utils.cpp.

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 files: