sunlineSRuKF#
Executive Summary#
This module implements a square-root unscented Kalman filter to estimate the direction of the Sun vector in body-frame coordinates using coarse sun sensor (CSS) and gyro measurements. This module is a child class of srukfInterface.
Message Connection Descriptions#
The following table lists all the module input and output messages. 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 |
---|---|---|
navAttInMsg |
NavAttMsgPayload |
Input gyro message |
cssDataInMsg |
CSSArraySensorMsgPayload |
Input message containing the direction cosines of the Sun as seen by the CSSs |
cssConfigInMsg |
CSSConfigMsgPayload |
Input message containing the geometry of the CSS constellation |
navAttOutMsg |
NavAttMsgPayload |
Output message containing the estimated Sun vector in body-frame coordinates |
navAttOutMsgC |
NavAttMsgPayload |
Output message containing the estimated Sun vector in body-frame coordinates - C-wrapped |
filterOutMsg |
FilterMsgPayload |
Output message with the filter estimated state and covariance |
filterGyroResOutMsg |
FilterResidualsMsgPayload |
Output message containing pre- and post-fit residuals for the gyro measurements |
filterCssResOutMsg |
FilterResidualsMsgPayload |
Output message containing pre- and post-fit residuals for the CSS measurements |
Detailed Module Description#
The estimated state of the filter is a 6-dimensional vector combining the sun heading vector in body-frame coordinates and body-frame rates also in body frame coordinates: The optional bias state models the varying solar intensity which scales the measurements.
Dynamics model#
The sun heading is fixed in inertial coordinates, it only changes in body-frame coordinates due to the motion of the spacecraft. Therefore, the dynamics of the sun heading is only given by the body-frame derivative of the sun heading unit-direction vector. For simplicity, the derivative of the angular rate vector is set to zero in this module. This gives: If the bias state is present, it has no dynamics.
Measurement model#
Two types of measurements are processed by this filter: gyro measurements and CSS measurements. For gyro measurements, the gyro rates are mapped directly to the rate component of the state via a \(3 \times 3\) identity matrix, which constitutes the measurement model.
For the CSS measurement, the measurement model is constituted by the \(n \times 3\) matrix \([\boldsymbol{H}]\), where \(n\) is the number of active sun sensors active at that moment. With \({}^\mathcal{B}\boldsymbol{\hat{n}}_i\) being the boresight of the \(i\)-th CSS, the measurement model is given by:
If a bias state is present and named \(b\), and the current state is \(\hat{\boldsymbol{s}}\), the predicted measurements will be given by:
User Guide#
The required module configuration is:
filter_object.setInitialPosition([0.0, 0.0, 1.0])
filter_object.setInitialVelocity([0.02, -0.005, 0.01])
filter_object.setInitialBias([0.6])
filter_object.setInitialCovariance([[0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
[0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0],
[0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0],
[0.0, 0.0, 0.0, 0.001, 0.0, 0.0, 0.0],
[0.0, 0.0, 0.0, 0.0, 0.001, 0.0, 0.0],
[0.0, 0.0, 0.0, 0.0, 0.0, 0.001, 0.0],
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5]])
filter_object.setCssMeasurementNoiseStd(0.01)
filter_object.setGyroMeasurementNoiseStd(0.001)
filter_object.setBiasLowerBound(1)
sigmaSun = (1E-6) ** 2
sigmaRate = (1E-8) ** 2
sigmaBias = (1E-5) ** 2
filter_object.setProcessNoise([[sigmaSun, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
[0.0, sigmaSun, 0.0, 0.0, 0.0, 0.0, 0.0],
[0.0, 0.0, sigmaSun, 0.0, 0.0, 0.0, 0.0],
[0.0, 0.0, 0.0, sigmaRate, 0.0, 0.0, 0.0],
[0.0, 0.0, 0.0, 0.0, sigmaRate, 0.0, 0.0],
[0.0, 0.0, 0.0, 0.0, 0.0, sigmaRate, 0.0],
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, sigmaBias]])
Class SunlineSRuKF#
-
class SunlineSRuKF : public SRukfInterface#
Public Functions
-
void setCssMeasurementNoiseStd(double cssMeasurementNoiseStd)#
Set the CSS measurement noise
- Parameters:
double – cssMeasurementNoise
- Returns:
void
-
void setGyroMeasurementNoiseStd(double gyroMeasurementNoiseStd)#
Set the gyro measurement noise
- Parameters:
double – gyroMeasurementNoise
- Returns:
void
-
double getCssMeasurementNoiseStd() const#
Get the CSS measurement noise
- Parameters:
double – cssMeasurementNoise
- Returns:
void
-
double getGyroMeasurementNoiseStd() const#
Get the gyro measurement noise
- Parameters:
double – gyroMeasurementNoise
- Returns:
void
-
void setSensorThreshold(double threshold)#
Set the threshold value to accept a css measurement
- Parameters:
double – threshold
- Returns:
void
-
double getSensorThreshold() const#
Get the threshold value to accept a css measurement
- Returns:
double threshold
-
void setBiasUpperBound(double biasUpperBound)#
Set the bias upper bound value it is not allowed to exceed
- Parameters:
double – biasUpperBound
-
double getBiasUpperBound() const#
Get the bias upper bound value it is not allowed to exceed
- Returns:
double biasUpperBound
-
void setBiasLowerBound(double biasLowerBound)#
Set the bias lower bound value it is not allowed to subceed
- Parameters:
double – biasUpperBound
-
double getBiasLowerBound() const#
Get the bias lower bound value it is not allowed to subceed
- Returns:
double biasUpperBound
-
void setCssMeasurementNoiseStd(double cssMeasurementNoiseStd)#