Module: attTrackingError

Executive Summary

This module is intended to be the last module in the guidance module chain. It’s input is the reference motion message generated by a prior module. It’s output is at the guidance attitude tracking errors relative to a moving reference frame. This module applies the body to corrected body attitude correction. The module PDF Description contains further information on this module’s function, how to run it, as well as testing.

Message Connection Descriptions

The following table lists all the module input and output messages. The module msg connection is set by the user from python. The msg type contains a link to the message structure definition, while the description provides information on what this message is used for.

Module I/O Messages

Msg Variable Name

Msg Type

Description

attGuidOutMsg

AttGuidMsgPayload

attitude guidance output message

attNavInMsg

NavAttMsgPayload

attitude navigation input message

attRefInMsg

AttRefMsgPayload

attitude reference input message


Functions

void SelfInit_attTrackingError(attTrackingErrorConfig *configData, int64_t moduleID)

This method initializes the configData for this module. It checks to ensure that the inputs are sane and then creates the output message

Parameters
  • configData – The configuration data associated with the attitude tracking error module

  • moduleID – The ID associated with the configData

Returns

void

void Update_attTrackingError(attTrackingErrorConfig *configData, uint64_t callTime, int64_t moduleID)

The Update method performs reads the Navigation message (containing the spacecraft attitude information), and the Reference message (containing the desired attitude). It computes the attitude error and writes it in the Guidance message.

Parameters
  • configData – The configuration data associated with the attitude tracking error module

  • callTime – The clock time at which the function was called (nanoseconds)

  • moduleID – The Basilisk module identifier

Returns

void

void Reset_attTrackingError(attTrackingErrorConfig *configData, uint64_t callTime, int64_t moduleID)

This method performs a complete reset of the module. Local module variables that retain time varying states between function calls are reset to their default values.

Parameters
  • configData – The configuration data associated with the attitude tracking error module

  • callTime – The clock time at which the function was called (nanoseconds)

  • moduleID – The ID associated with the configData

Returns

void

void computeAttitudeError(double sigma_R0R[3], NavAttMsgPayload nav, AttRefMsgPayload ref, AttGuidMsgPayload *attGuidOut)

This method performs the attitude computations in order to extract the error.

Parameters
  • sigma_R0R – Reference frame state

  • nav – The spacecraft attitude information

  • ref – The reference attitude

  • attGuidOut – Output attitude guidance message

Returns

void

struct attTrackingErrorConfig
#include <attTrackingError.h>

Data structure for module to compute the attitude tracking error between the spacecraft attitude and the reference.

Public Members

double sigma_R0R[3]

MRP from corrected reference frame to original reference frame R0. This is the same as [BcB] going from primary body frame B to the corrected body frame Bc.

AttGuidMsg_C attGuidOutMsg

output msg of attitude guidance

NavAttMsg_C attNavInMsg

input msg measured attitude

AttRefMsg_C attRefInMsg

input msg of reference attitude

BSKLogger *bskLogger

BSK Logging.