Module: boreAngCalc

Executive Summary

A class to perform a range of boresight related calculations. 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 variable name 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

scStateInMsg

SCStatesMsgPayload

spacecraft state input message

celBodyInMsg

SpicePlanetStateMsgPayload

(optional) celestial body state msg at which we pointing at

angOutMsg

BoreAngleMsgPayload

bore sight output message


class BoreAngCalc : public SysModel
#include <boreAngCalc.h>

A class to perform a range of boresight related calculations.

Public Functions

BoreAngCalc()

The constructor. Note that you have to overwrite the message names.

~BoreAngCalc()

The destructor.

void Reset(uint64_t CurrentSimNanos)

This method is used to reset the module.

Returns

void

void UpdateState(uint64_t CurrentSimNanos)

This method is the main carrier for the boresight calculation routine. If it detects that it needs to re-init (direction change maybe) it will re-init itself. Then it will compute the angles away that the boresight is from the celestial target.

Parameters

CurrentSimNanos – The current simulation time for system

Returns

void

void computeCelestialAxisPoint()

This method computes the vector specified in the input file in the LVLH reference frame of the spacecraft above the target celestial body. This is used later to compute how far off that vector is in an angular sense.

Returns

void

void computeCelestialOutputData()

This method computes the output structure for messaging. The miss angle is absolute distance between the desired body point and the specified structural vector. The aximuth angle is the angle between the y pointing axis and the desired pointing vector projected into the y/z plane.

Returns

void

void computeInertialOutputData()

This method computes the output structure for messaging. The miss angle is computed using the body heading and the provided inertial heading

Returns

void

void WriteOutputMessages(uint64_t CurrentClock)

This method writes the output data out into the messaging system.

Parameters

CurrentClock – The current time in the system for output stamping

Returns

void

void ReadInputs()

This method reads the input messages in from the system and sets the appropriate parameters

Returns

void

Public Members

ReadFunctor<SCStatesMsgPayload> scStateInMsg

(-) spacecraft state input message

ReadFunctor<SpicePlanetStateMsgPayload> celBodyInMsg

(-) celestial body state msg at which we pointing at

Message<BoreAngleMsgPayload> angOutMsg

(-) bore sight output message

Eigen::Vector3d boreVec_B

(-) boresight vector in structure

Eigen::Vector3d boreVec_Po

(-) pointing vector in the target relative point frame

Eigen::Vector3d inertialHeadingVec_N

(-) inertial boresight vector

Private Members

SpicePlanetStateMsgPayload localPlanet

(-) planet that we are pointing at

SCStatesMsgPayload localState

(-) observed state of the spacecraft

BoreAngleMsgPayload boresightAng = {}

(-) Boresight angles relative to target

bool inputsGood = false

(-) Flag indicating that inputs were read correctly

bool useCelestialHeading = false

(-) Flag indicating that the module should use the celestial body heading

bool useInertialHeading = false

(-) Flag indicating that the module should use the inertial heading

BSKLogger bskLogger

&#8212; BSK Logging