Module: starTracker

Executive Summary

Sensor model to simulate a Star Tracker.

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

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

scStateInMsg

SCStatesMsgPayload

sc input state message

sensorOutMsg

STSensorMsgPayload

sensor output state message


class StarTracker : public SysModel
#include <starTracker.h>

Star tracker sensor model that simulates quaternion measurements with configurable noise.

The star tracker supports noise configuration through:

  • Walk bounds: Maximum allowed deviations from truth [rad]

  • PMatrix: Noise covariance matrix (diagonal elements = noiseStd)

  • AMatrix: Propagation matrix for error model (defaults to identity)

Example Python usage:

starTracker = StarTracker()

# Configure noise (rad)
noiseStd = 0.001  # Standard deviation
PMatrix = [0.0] * 9  # 3x3 matrix
PMatrix[0] = PMatrix[4] = PMatrix[8] = noiseStd
starTracker.PMatrix = PMatrix

# Set maximum error bounds (rad)
starTracker.setWalkBounds([0.01, 0.01, 0.01])

Public Functions

StarTracker()
~StarTracker()
void UpdateState(uint64_t CurrentSimNanos)

update module states

void Reset(uint64_t CurrentClock)

Method for reseting the module.

This method is used to reset the module.

Parameters:

CurrentSimNanos – The current simulation time from the architecture

void readInputMessages()

read input messages

void writeOutputMessages(uint64_t Clock)

write output messages

void computeSensorErrors()

compute sensor errors

void applySensorErrors()

apply sensor errors

void computeTrueOutput()

compute true output values

void computeQuaternion(double *sigma, STSensorMsgPayload *sensorValue)

compute quaternion from MRPs

Parameters:
  • sigma

  • sensorValues

void setAMatrix(const Eigen::MatrixXd &propMatrix)

Setter for AMatrix used for error propagation

Parameters:

propMatrix – Matrix to set

Eigen::MatrixXd getAMatrix() const

Getter for AMatrix used for error propagation

Returns:

Current matrix

void setWalkBounds(const Eigen::Vector3d &bounds)

Sets walk bounds [rad]

Eigen::Vector3d getWalkBounds() const

Gets current walk bounds [rad]

Public Members

uint64_t sensorTimeTag

[ns] Current time tag for sensor out

ReadFunctor<SCStatesMsgPayload> scStateInMsg

[-] sc input state message

Message<STSensorMsgPayload> sensorOutMsg

[-] sensor output state message

Eigen::Matrix3d PMatrix

[-] Cholesky-decomposition or matrix square root of the covariance matrix to apply errors with

Eigen::Vector3d walkBounds

[-] “3-sigma” errors to permit for states

Eigen::Vector3d navErrors

[-] Current navigation errors applied to truth

double dcm_CB[3][3]

[-] Transformation matrix from body to case

STSensorMsgPayload trueValues

[-] total measurement without perturbations

STSensorMsgPayload sensedValues

[-] total measurement including perturbations

double mrpErrors[3]

[-] Errors to be applied to the input MRP set indicating whether

SCStatesMsgPayload scState

[-] Module variable where the input State Data message is stored

BSKLogger bskLogger

&#8212; BSK Logging

Private Members

Eigen::Matrix3d AMatrix

[-] AMatrix that we use for error propagation

GaussMarkov errorModel

[-] Gauss-markov error states