LOST 0.0.1
LOST: Open-source Star Tracker
Loading...
Searching...
No Matches
lost::Attitude Class Reference

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

#include <attitude-utils.hpp>

Public Member Functions

 Attitude ()=default
 constructs unknown attitude:
 Attitude (const Quaternion &)
 Attitude (const Mat3 &dcm)
Quaternion GetQuaternion () const
 Get the quaternion representing the attitude, converting from whatever format is stored.
Mat3 GetDCM () const
 Get the rotation matrix (direction cosine matrix) representing the attitude, converting from whatever format is stored.
EulerAngles ToSpherical () const
 Get the euler angles from the attitude, converting from whatever format is stored.
Vec3 Rotate (const Vec3 &) const
 Convert a vector from the reference frame to the body frame.
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 145 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 362 of file attitude-utils.cpp.

◆ Attitude() [3/3]

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

Definition at line 365 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 422 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 410 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 457 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 434 of file attitude-utils.cpp.

◆ ToSpherical()

EulerAngles lost::Attitude::ToSpherical ( ) const

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

Definition at line 446 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: