C Module: chebyPosEphem

Executive Summary

This module allows the user to specify a set of Chebyshev coefficients to fit a space ephemeris trajectory. Next the input time is used to determine where a given body is in space.

Module Assumptions and Limitations

Each configured record requires a positive ephemTimeRad in seconds and between one and MAX_CHEB_COEFF coefficients per axis. The coefficients describe position in meters as a function of normalized time over the record’s interval. The input clock correlation maps simulation time to ephemeris time. Unused slots have nChebCoeff set to zero and are ignored during record selection. At least one record must be configured; evaluating with no configured records raises BSK_ERROR.

Within coverage, the first record in array order whose interval contains the ephemeris time is used, including at shared endpoints and in overlapping intervals. Outside all intervals, including gaps between records, the module selects the nearest interval endpoint and evaluates both position and velocity there. Equal-distance ties use the first record in array order. Records do not need to be stored chronologically.

Clamping holds the endpoint position and the fitted endpoint velocity; the reported velocity is not forced to zero outside coverage. The output timeTag continues to report the current simulation time in seconds.

Message Connection Descriptions

The following diagram and table list all the module input and output messages. The module message connection is set by the user from Python. The message type contains a link to the message structure definition, while the description provides information on what this message is used for.

chebyPosEphem module input and output messages

Module I/O Messages

Msg Variable Name

Msg Type

Description

posFitOutMsg

EphemerisMsgPayload

Output navigation message for pos/vel

clockCorrInMsg

TDBVehicleClockCorrelationMsgPayload

clock correlation input message

User Guide

Set each record’s nChebCoeff, ephemTimeMid, ephemTimeRad, and posChebyCoeff before initializing the simulation. Store the position coefficients consecutively for the x, y, and z axes, with nChebCoeff values per axis. The module derives velChebyCoeff in meters per second during reset; users do not need to populate it.

After changing position coefficients, their count, or the time radius, call the module’s Reset() method or reinitialize the simulation with InitializeSimulation() before evaluating the new fit. Every reset clears and rebuilds the velocity coefficients for every record, so changing the coefficient count or resetting repeatedly does not retain a previous fit’s derivative coefficients.


Defines

MAX_CHEB_COEFF
MAX_CHEB_RECORDS

Functions

void SelfInit_chebyPosEphem(ChebyPosEphemData *configData, int64_t moduleID)

This method creates the output navigation message (translation only) for the ephemeris model

Parameters:
  • configData – The configuration data associated with the ephemeris model

  • moduleID – The Basilisk module identifier

void Update_chebyPosEphem(ChebyPosEphemData *configData, uint64_t callTime, int64_t moduleID)

Compute the state from the first record containing the current ephemeris time. Outside all configured intervals, evaluate position and velocity at the nearest interval endpoint. Unused records with zero coefficients are skipped.

Note

Overlapping intervals and equally distant endpoints use the first record in array order.

Parameters:
  • configData – The configuration data associated with the ephemeris model

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

  • moduleID – The Basilisk module identifier

void Reset_chebyPosEphem(ChebyPosEphemData *configData, uint64_t callTime, int64_t moduleID)

This method takes the chebyshev coefficients loaded for the position estimator and computes the coefficients needed to estimate the time derivative of that position vector (velocity).

Parameters:
  • configData – The configuration data associated with the ephemeris model

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

  • moduleID – The Basilisk module identifier

struct ChebyEphemRecord
#include <chebyPosEphem.h>

Structure that defines the layout of an Ephemeris “record.” This is basically the set of coefficients for the body x/y/z positions and the time factors associated with those coefficients.

Public Members

uint32_t nChebCoeff

[-] Number chebyshev coefficients loaded into record

double ephemTimeMid

[s] Ephemeris time (TDB) associated with the mid-point of the curve

double ephemTimeRad

[s] “Radius” of time that curve is valid for (half of total range

double posChebyCoeff[3 * MAX_CHEB_COEFF]

[-] Set of chebyshev coefficients for position

double velChebyCoeff[3 * MAX_CHEB_COEFF]

[-] Set of coefficients for the velocity estimate

struct ChebyPosEphemData
#include <chebyPosEphem.h>

Top level structure for the Chebyshev position ephemeris fit system. e.

Public Members

EphemerisMsg_C posFitOutMsg

[-] output navigation message for pos/vel

TDBVehicleClockCorrelationMsg_C clockCorrInMsg

clock correlation input message

ChebyEphemRecord ephArray[MAX_CHEB_RECORDS]

[-] Array of Chebyshev records for ephemeris

uint32_t coeffSelector

[-] Index in the ephArray that we are currently using

EphemerisMsgPayload outputState

[-] The local storage of the outgoing message data

BSKLogger *bskLogger

BSK Logging.