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.
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:
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
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::Matrix3d PMatrix
[-] Cholesky-decomposition or matrix square root of the covariance matrix to apply errors with
[-] 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
— BSK Logging
Private Members
-
GaussMarkov errorModel
[-] Gauss-markov error states