Module: pixelLineBiasUKF

This module filters position measurements that have been processed from planet images in order to estimate spacecraft relative position to an observed body in the inertial frame. It is similar to the relativeOD filter except that it estimates measurement bias in pixels and therefore integrates the pixel and line transformation in the measurement model. This means this module reads in circle data directly.

The module PDF Description contains further information on this module’s function, how to run it, as well as testing.


Functions

void SelfInit_pixelLineBiasUKF(PixelLineBiasUKFConfig *configData, int64_t moduleId)

This method creates the two moduel output messages.

Return

void

Parameters
  • configData: The configuration data associated with the OD filter

void CrossInit_pixelLineBiasUKF(PixelLineBiasUKFConfig *configData, int64_t moduleId)

This method performs the second stage of initialization for the OD filter. It’s primary function is to link the input messages that were created elsewhere.

Return

void

Parameters
  • configData: The configuration data associated with the OD filter

void Update_pixelLineBiasUKF(PixelLineBiasUKFConfig *configData, uint64_t callTime, int64_t moduleId)

This method takes the relative position measurements and outputs an estimate of the spacecraft states in the intertial frame.

Return

void

Parameters
  • configData: The configuration data associated with the OD filter

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

void Reset_pixelLineBiasUKF(PixelLineBiasUKFConfig *configData, uint64_t callTime, int64_t moduleId)

This method resets the relative OD filter to an initial state and initializes the internal estimation matrices.

Return

void

Parameters
  • configData: The configuration data associated with the OD filter

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

void pixelLineBiasUKFTwoBodyDyn(double state[PIXLINE_N_STATES], double mu, double *stateDeriv)
int pixelLineBiasUKFTimeUpdate(PixelLineBiasUKFConfig *configData, double updateTime)

This method performs the time update for the relative OD kalman filter. It propagates the sigma points forward in time and then gets the current covariance and state estimates.

Return

void

Parameters
  • configData: The configuration data associated with the OD filter

  • updateTime: The time that we need to fix the filter to (seconds)

int pixelLineBiasUKFMeasUpdate(PixelLineBiasUKFConfig *configData)

This method performs the measurement update for the kalman filter. It applies the observations in the obs vectors to the current state estimate and updates the state/covariance with that information.

Return

void

Parameters
  • configData: The configuration data associated with the OD filter

  • updateTime: The time that we need to fix the filter to (seconds)

void pixelLineBiasUKFCleanUpdate(PixelLineBiasUKFConfig *configData)

This method cleans the filter states after a bad upadate on the fly. It removes the potentially corrupted previous estimates and puts the filter back to a working state.

Return

void

Parameters
  • configData: The configuration data associated with the OD filter

void relODStateProp(PixelLineBiasUKFConfig *configData, double *stateInOut, double dt)

This method propagates a relative OD state vector forward in time. Note that the calling parameter is updated in place to save on data copies.

Return

void

Parameters
  • stateInOut: The state that is propagated

void pixelLineBiasUKFMeasModel(PixelLineBiasUKFConfig *configData)

This method computes the measurement model. Given that the data is coming from the pixelLine Converter, the transformation has already taken place from pixel data to spacecraft position.

Return

void

Parameters
  • configData: The configuration data associated with the OD filter

struct PixelLineBiasUKFConfig
#include <pixelLineBiasUKF.h>

Top level structure for the relative OD unscented kalman filter. Used to estimate the spacecraft’s inertial position relative to a body.

Public Members

char navStateOutMsgName[MAX_STAT_MSG_LENGTH]

The name of the output message.

char filtDataOutMsgName[MAX_STAT_MSG_LENGTH]

The name of the output filter data message.

char circlesInMsgName[MAX_STAT_MSG_LENGTH]

[-] The name of the input RW speeds message

char cameraConfigMsgName[MAX_STAT_MSG_LENGTH]

The name of the camera config message.

char attInMsgName[MAX_STAT_MSG_LENGTH]

The name of the attitude message.

int moduleId
size_t numStates

[-] Number of states for this filter

size_t countHalfSPs

[-] Number of sigma points over 2

size_t numObs

[-] Number of measurements this cycle

double beta

[-] Beta parameter for filter

double alpha

[-] Alpha parameter for filter

double kappa

[-] Kappa parameter for filter

double lambdaVal

[-] Lambda parameter for filter

double gamma

[-] Gamma parameter for filter

double switchMag

[-] Threshold for where we switch MRP set

double dt

[s] seconds since last data epoch

double timeTag

[s] Time tag for statecovar/etc

double gyrAggTimeTag

[s] Time-tag for aggregated gyro data

double aggSigma_b2b1[3]

[-] Aggregated attitude motion from gyros

double dcm_BdyGyrpltf[3][3]

[-] DCM for converting gyro data to body frame

double wM[2 * PIXLINE_N_STATES + 1]

[-] Weighting vector for sigma points

double wC[2 * PIXLINE_N_STATES + 1]

[-] Weighting vector for sigma points

double stateInit[PIXLINE_N_STATES]

[-] State estimate to initialize filter to

double state[PIXLINE_N_STATES]

[-] State estimate for time TimeTag

double statePrev[PIXLINE_N_STATES]

[-] State estimate for time TimeTag at previous time

double sBar[PIXLINE_N_STATES * PIXLINE_N_STATES]

[-] Time updated covariance

double sBarPrev[PIXLINE_N_STATES * PIXLINE_N_STATES]

[-] Time updated covariance at previous time

double covar[PIXLINE_N_STATES * PIXLINE_N_STATES]

[-] covariance

double covarPrev[PIXLINE_N_STATES * PIXLINE_N_STATES]

[-] covariance at previous time

double covarInit[PIXLINE_N_STATES * PIXLINE_N_STATES]

[-] Covariance to init filter with

double xBar[PIXLINE_N_STATES]

[-] Current mean state estimate

double obs[PIXLINE_N_MEAS]

[-] Observation vector for frame

double yMeas[PIXLINE_N_MEAS * (2 * PIXLINE_N_STATES + 1)]

[-] Measurement model data

double SP[(2 * PIXLINE_N_STATES + 1) * PIXLINE_N_STATES]

[-] sigma point matrix

double qNoise[PIXLINE_N_STATES * PIXLINE_N_STATES]

[-] process noise matrix

double sQnoise[PIXLINE_N_STATES * PIXLINE_N_STATES]

[-] cholesky of Qnoise

double measNoise[PIXLINE_N_MEAS * PIXLINE_N_MEAS]

[-] Measurement Noise

int planetIdInit

[-] Planet being navigated inital value

int planetId

[-] Planet being navigated as per measurement

uint32_t firstPassComplete

[-] Flag to know if first filter update

double postFits[3]

[-] PostFit residuals

double timeTagOut

[s] Output time-tag information

double maxTimeJump

[s] Maximum time jump to allow in propagation

CirclesOpNavMsg cirlcesInMsg

[-] ST sensor data read in from message bus

CameraConfigMsg cameraSpecs

[-] Camera specs for nav

NavAttIntMsg attInfo

[-] Att info for frame transformation

int32_t navStateOutMsgId

Id for the outgoing body estimate message

int32_t filtDataOutMsgId

[-] Id for the filter data output message

int32_t circlesInMsgId

[-] Id for the incoming mass properties message

int32_t attInMsgID

[-] The ID associated with the outgoing message

int32_t cameraConfigMsgID

[-] The ID associated with the incoming camera config

BSKLogger *bskLogger

BSK Logging.