Module: spacecraftPointing

The primary purpose of this module is to provide an attitude reference output to make sure that a vector given in the deputy spacecraft’s body frame points to the chief spacecraft. The position of the chief- and deputy spacecraft in the inertial frame are used as inputs for this module. The module uses the positions to create a reference vector that points from the deputy to the chief. A coordinate system is built around this vector and the orientation, angular velocity, and angular acceleration of this coordinate system are calculated with respect to the inertial frame. The output consists of these three vectors and can consequently be used as an input for the attitude tracking error module.

More information can be found in the PDF Description.


Functions

void SelfInit_spacecraftPointing(spacecraftPointingConfig *configData, int64_t moduleID)

This method initializes the configData for the spacecraft pointing 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 spacecraft pointing module

void CrossInit_spacecraftPointing(spacecraftPointingConfig *configData, int64_t moduleID)

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

Return

void

Parameters
  • configData: The configuration data associated with the spacecraft pointing module

void Update_spacecraftPointing(spacecraftPointingConfig *configData, uint64_t callTime, int64_t moduleID)

This method takes the vector that points from the deputy spacecraft to the chief spacecraft and calculates the orientation, angular velocity and angular acceleration of this vector with respect to the inertial reference frame in inertial reference frame components and passes them to the attitude tracking error module, where that attitude error can be calculated.

Return

void

Parameters
  • configData: The configuration data associated with the spacecraft pointing module

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

void Reset_spacecraftPointing(spacecraftPointingConfig *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 pointing module

struct spacecraftPointingConfig
#include <spacecraftPointing.h>

Top level structure for the spacecraft pointing module.

Public Members

char attReferenceOutMsgName[MAX_STAT_MSG_LENGTH]

The name of the output message

char chiefPositionInMsgName[MAX_STAT_MSG_LENGTH]

The name of the Input message of the chief

char deputyPositionInMsgName[MAX_STAT_MSG_LENGTH]

The name of the Input message of the deputy

double alignmentVector_B[3]

Vector within the B-frame that points to antenna

double sigma_BA[3]

MRP of B-frame with respect to A-frame

double old_sigma_RN[3]

MRP of previous timestep

double old_omega_RN_N[3]

Omega of previous timestep

int i

Flag used to set incorrect numerical answers to zero

int32_t attReferenceOutMsgID

ID for the outgoing reference message

int32_t chiefPositionInMsgID

ID for the incoming chief position message

int32_t deputyPositionInMsgID

ID for the incoming deputy position message

uint64_t priorTime

[ns] Last time the attitude control is called

AttRefFswMsg attReferenceOutBuffer
BSKLogger *bskLogger

BSK Logging.