Module: attTrackingError

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.


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

Return

void

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

void CrossInit_attTrackingError(attTrackingErrorConfig *configData, int64_t moduleID)

This method performs the second stage of initialization for this module. It’s primary function is to link the input messages that were created elsewhere.

Return

void

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

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.

Return

void

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

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.

Return

void

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

void computeAttitudeError(double sigma_R0R[3], NavAttIntMsg nav, AttRefFswMsg ref, AttGuidFswMsg *attGuidOut)

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

Return

void

Parameters
  • nav: The spacecraft attitude information

  • ref: The reference attitude

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

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.

char outputDataName[MAX_STAT_MSG_LENGTH]

The name of the output message.

char inputRefName[MAX_STAT_MSG_LENGTH]

The name of the guidance reference Input message.

char inputNavName[MAX_STAT_MSG_LENGTH]

The name of the navigation Input message.

int32_t outputMsgID

ID for the outgoing message.

int32_t inputRefID

ID for the incoming guidance reference message.

int32_t inputNavID

ID for the incoming navigation message.

BSKLogger *bskLogger

BSK Logging.