Module: celestialTwoBodyPoint

Executive Summary

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.

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

attRefOutMsg

AttRefMsgPayload

attitude reference output message

transNavInMsg

NavTransMsgPayload

spacecraft translation motion input message

celBodyInMsg

EphemerisMsgPayload

primary celestial body information input message

secCelBodyInMsg

EphemerisMsgPayload

(optional) secondary celestial body information


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

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

  • moduleID – The ID associated with the configData

Returns:

void

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.

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

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

  • moduleID – The ID associated with the configData

Returns:

void

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.

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

  • moduleID – The ID associated with the configData

Returns:

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.

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

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

Returns:

void

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

AttRefMsg_C attRefOutMsg

The name of the output message*/.

EphemerisMsg_C celBodyInMsg

The name of the celestial body message*/.

EphemerisMsg_C secCelBodyInMsg

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

NavTransMsg_C transNavInMsg

The name of the incoming attitude command*/.

int secCelBodyIsLinked

flag to indicate if the optional 2nd celestial body message is linked

AttRefMsgPayload attRefOut

(-) copy of output reference frame message

BSKLogger *bskLogger

BSK Logging.