Module: celestialTwoBodyPoint

This module point one body-fixed axis towards a primary celestial object. The secondary goal is to point a second body-fixed axis towards another celestial object.

For example, the goal is to point the sensor towards the center of a planet while doing the best to keep the solar panel normal point at the sun.The module PDF Description contains further information on this module’s function, how to run it, as well as testing.


Functions

void SelfInit_celestialTwoBodyPoint(celestialTwoBodyPointConfig *configData, int64_t moduleID)

This method initializes the configData for the nominal delta-V maneuver guidance. 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 celestial body guidance

void CrossInit_celestialTwoBodyPoint(celestialTwoBodyPointConfig *configData, int64_t moduleID)

This method performs the second stage of initialization for the celestial body 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 attitude maneuver guidance

void Update_celestialTwoBodyPoint(celestialTwoBodyPointConfig *configData, uint64_t callTime, int64_t moduleID)

This method takes the spacecraft and points a specified axis at a named celestial body specified in the configuration data. It generates the commanded attitude and assumes that the control errors are computed downstream.

Return

void

Parameters
  • configData: The configuration data associated with the celestial body guidance

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

void Reset_celestialTwoBodyPoint(celestialTwoBodyPointConfig *configData, uint64_t callTime, int64_t moduleID)
void parseInputMessages(celestialTwoBodyPointConfig *configData, int64_t moduleID)

This method takes the navigation translational info as well as the spice data of the primary celestial body and, if applicable, the second one, and computes the relative state vectors necessary to create the restricted 2-body pointing reference frame.

Return

void

void computeCelestialTwoBodyPoint(celestialTwoBodyPointConfig *configData, uint64_t callTime)

This method takes the spacecraft and points a specified axis at a named celestial body specified in the configuration data. It generates the commanded attitude and assumes that the control errors are computed downstream.

Return

void

Parameters
  • configData: The configuration data associated with the celestial body guidance

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

struct celestialTwoBodyPointConfig
#include <celestialTwoBodyPoint.h>

Data structure for module to compute the two-body celestial pointing navigation solution.

Public Members

double singularityThresh

(r) Threshold for when to fix constraint axis*/

double R_P1B_N[3]

[m] planet 1 position vector relative to inertial frame, in N-frame components

double R_P2B_N[3]

[m] planet 2 position vector relative to inertial frame, in N-frame components

double v_P1B_N[3]

[m/s] planet 1 velocity vector relative to inertial frame, in N-frame components

double v_P2B_N[3]

[m/s] planet 2 velocity vector relative to inertial frame, in N-frame components

double a_P1B_N[3]

[m/s^2] planet 1 acceleration vector relative to inertial frame, in N-frame components

double a_P2B_N[3]

[m/s^2] planet 2 acceleration vector relative to inertial frame, in N-frame components

char outputDataName[MAX_STAT_MSG_LENGTH]

The name of the output message*/.

char inputNavDataName[MAX_STAT_MSG_LENGTH]

The name of the incoming attitude command*/.

char inputCelMessName[MAX_STAT_MSG_LENGTH]

The name of the celestial body message*/.

char inputSecMessName[MAX_STAT_MSG_LENGTH]

The name of the secondary body to constrain point*/.

int32_t outputMsgID

(-) ID for the outgoing body estimate message*/

int32_t inputNavID

(-) ID for the incoming IMU data message*/

int32_t inputCelID

(-) ID for the incoming mass properties message*/

int32_t inputSecID

(-) ID for the secondary constraint message*/

AttRefFswMsg attRefOut
BSKLogger *bskLogger

BSK Logging.