ADCS.satellite_hardware.sensors.star_tracker module¶
- class ADCS.satellite_hardware.sensors.star_tracker.StarTracker(sample_time=0.1, bias=None, anisotropic_noise=None, estimate_bias=False, boresight=array([0., 0., 1.]), fov=np.float64(0.06981317007977318), sun_exclusion=np.float64(0.4363323129985824), star_catalog=None)[source]¶
Bases:
SensorStar tracker direction sensor model.
This class implements a simplified but estimator-consistent star tracker that provides a vector observation corresponding to the line-of-sight (LOS) from the spacecraft to a selected navigation star, expressed in the spacecraft body frame.
Unlike a full star tracker attitude solution, this model returns a single unit vector measurement, making it suitable for tightly coupled state estimation frameworks such as EKF or UKF.
The class conforms to the generic sensor interface defined by
Sensor.Measurement model¶
Let
Symbol
Description
\(\mathbf{q}\)
Attitude quaternion (body → inertial)
\(\mathbf{s}_{\mathrm{ECI}}\)
Inertial-frame unit vector to a star
\(\mathbf{C}(\mathbf{q})\)
Rotation matrix (body → inertial)
The clean (ideal) star tracker measurement is
\[\mathbf{y}_{\text{clean}} = \mathbf{C}(\mathbf{q})^\top \mathbf{s}_{\mathrm{ECI}} \in \mathbb{R}^3,\]which represents the star direction expressed in the body frame.
Including bias and noise, the full measurement is
\[\tilde{\mathbf{y}} = \mathbf{y}_{\text{clean}} + \mathbf{b} + \mathbf{n},\]where:
\(\mathbf{b}\) is an optional additive bias modeled by
Bias\(\mathbf{n}\) is anisotropic noise modeled by
AnisotropicNoise
After corruption, the measurement is renormalized to enforce a unit-vector constraint:
\[\tilde{\mathbf{y}} \leftarrow \frac{\tilde{\mathbf{y}}}{\lVert \tilde{\mathbf{y}} \rVert}.\]Star selection¶
At each measurement epoch, the sensor:
Projects the sensor boresight into the inertial frame
Queries the
StarCatalogfor visible starsApplies field-of-view and exclusion constraints (Sun, optional Moon)
Selects the brightest visible star (minimum visual magnitude)
If no valid star is available, the sensor output is
NaN.Estimator properties¶
Output dimension: 3
Depends only on attitude quaternion
Jacobian is nonzero only w.r.t. quaternion states
No coupling to angular velocity or momentum states
See also
StarCatalog,NavigationStar,Sensor- basestate_jac(x, os)[source]¶
Jacobian of the star tracker measurement with respect to the base state.
The measurement depends only on the attitude quaternion. Therefore,
\[\frac{\partial \mathbf{y}}{\partial \boldsymbol{\omega}} = \mathbf{0}, \qquad \frac{\partial \mathbf{y}}{\partial \mathbf{q}} = D_{\mathbf{q}} \left( \mathbf{C}(\mathbf{q})^\top \mathbf{s}_{\mathrm{ECI}} \right).\]The quaternion derivative is computed using
drotmatTvecdq().- Parameters:
x (numpy.ndarray) – Full spacecraft state vector.
os (
Orbital_State) – Orbital state.
- Returns:
Base-state Jacobian stacked as
[ω; q], shape(7, 3).- Return type:
numpy.ndarray
- bias_jac(x, os)[source]¶
Jacobian of the measurement with respect to bias states.
The star tracker bias is not included in the estimator state for this model, so the bias Jacobian is empty.
- Parameters:
x (numpy.ndarray) – Full spacecraft state vector (unused).
os (
Orbital_State) – Orbital state object (unused).
- Returns:
Empty bias Jacobian of shape
(0, 3).- Return type:
numpy.ndarray
- clean_reading(x, os)[source]¶
Compute the noise-free, bias-free star tracker measurement.
The attitude quaternion is extracted from the state vector as
\[\mathbf{q} = x_{3:7},\]and the measurement is computed as
\[\mathbf{y}_{\text{clean}} = \mathbf{C}(\mathbf{q})^\top \mathbf{s}_{\mathrm{ECI}}.\]- Parameters:
x (numpy.ndarray) – Full spacecraft state vector.
os (
Orbital_State) – Orbital state used for star visibility determination.
- Returns:
Unit vector pointing toward the selected navigation star in the body frame, or
NaNif no star is visible.- Return type:
numpy.ndarray
- reading(x, os, dmode=None)[source]¶
Compute the full star tracker measurement including bias and noise.
Bias and noise are applied using
reading(), after which the output is renormalized to enforce a unit-vector constraint.- Parameters:
x (numpy.ndarray) – Full spacecraft state vector.
os (
Orbital_State) – Orbital state.dmode (
ErrorModeor None) – Controls whether bias and noise are applied and propagated.
- Returns:
Normalized star direction measurement in the body frame.
- Return type:
numpy.ndarray
- property noise_covariance: ndarray[tuple[int, ...], dtype[float64]]¶
Measurement noise covariance matrix.
- Returns:
Measurement noise covariance expressed in the spacecraft body frame.
- Return type:
numpy.ndarray
- output_length: int = 3¶
- Parameters:
sample_time (float)
bias (Bias)
anisotropic_noise (AnisotropicNoise)
estimate_bias (bool)
boresight (ndarray)
fov (float)
sun_exclusion (float)
star_catalog (StarCatalog | None)