Module: spacecraftPointing

Executive Summary

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.

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

chiefPositionInMsg

NavTransMsgPayload

primary position input message

deputyPositionInMsg

NavTransMsgPayload

secondary position input message

attReferenceOutMsg

AttRefMsgPayload

attitude reference output message


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

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

  • moduleID – The Basilisk module identifier

Returns

void

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.

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

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

  • moduleID – The Basilisk module identifier

Returns

void

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.

Parameters
  • configData – The configuration data associated with the pointing module

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

  • moduleID – The Basilisk module identifier

Returns

void

struct spacecraftPointingConfig
#include <spacecraftPointing.h>

Top level structure for the spacecraft pointing module.

Public Members

AttRefMsg_C attReferenceOutMsg

The name of the output message

NavTransMsg_C chiefPositionInMsg

The name of the Input message of the chief

NavTransMsg_C deputyPositionInMsg

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]

&#8212; MRP of B-frame with respect to A-frame

double old_sigma_RN[3]

&#8212; MRP of previous timestep

double old_omega_RN_N[3]

&#8212; Omega of previous timestep

int i

&#8212; Flag used to set incorrect numerical answers to zero

uint64_t priorTime

[ns] Last time the attitude control is called

AttRefMsgPayload attReferenceOutBuffer

output msg copy

BSKLogger *bskLogger

BSK Logging.