C++ Module: starTracker
Executive Summary
Sensor model to simulate a Star Tracker.
The principal-rotation-vector error state evolves according to
where PMatrix is a matrix square root of the process-noise covariance and
setAMatrix() configures the propagation matrix. The propagation matrix
defaults to zero, so configuring only PMatrix produces independent white
Gaussian attitude errors. RNGSeed controls the repeatable random sequence.
A correlated process or random walk must be configured explicitly. For example, identity propagation with positive walk bounds creates a bounded random walk:
tracker.setAMatrix([[1.0, 0.0, 0.0],
[0.0, 1.0, 0.0],
[0.0, 0.0, 1.0]])
tracker.setWalkBounds([0.01, 0.01, 0.01]) # [rad]
Each positive walk-bound entry is an exact hard bound on the corresponding error state. A non-positive entry disables clipping for that state.
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.
Msg Variable Name |
Msg Type |
Description |
|---|---|---|
scStateInMsg |
sc input state message |
|
sensorOutMsg |
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:
PMatrix: Matrix square root of the process-noise covariance [rad]
AMatrix: Propagation matrix for the error model (defaults to zero for white noise)
Walk bounds: Optional hard bounds on the propagated error state [rad]
Example Python usage:
tracker = starTracker.StarTracker() # Configure noise (rad) tracker.PMatrix = [[0.001, 0.0, 0.0], [0.0, 0.001, 0.0], [0.0, 0.0, 0.001]] # Optional: configure a bounded random walk explicitly tracker.setAMatrix([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]) tracker.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 resetting 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
AMatrixused for error propagation- Parameters:
propMatrix – Matrix to set
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::Vector3d walkBounds
[rad] Hard bounds on error states; non-positive entries disable clipping
[rad] Current principal-rotation-vector 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
— BSK Logging
Private Members
-
GaussMarkov errorModel
[-] Gauss-markov error states