コンテンツにスキップ

SunSensor

このコンテンツはまだ日本語訳がありません。

Defined in: sun_sensor.rs:29

pub struct SunSensor

Sun sensor that measures the sun direction in the body frame.

Computes the satellite→Sun unit vector and rotates it into the body frame via the attitude quaternion:

d_eci = normalize(sun_pos_eci - sc_pos_eci)
d_body = noise(R_bi · d_eci)

When eclipse support is enabled (shadow_body_radius is set), the sensor also computes the illumination fraction. During total eclipse (illumination = 0), direction is None.

fn new() -> Self

Create an ideal sun sensor (no noise, no eclipse).


fn for_earth() -> Self

Create a sun sensor for Earth orbit with conical shadow model.


fn with_noise(self, noise: impl NoiseModel + ‘static) -> Self

Add a noise model. Multiple calls chain in order.


fn with_shadow_body(self, radius: f64) -> Self

Set the shadow body radius for eclipse computation.


fn with_shadow_model(self, model: ShadowModel) -> Self

Set the shadow model.


fn measure(&mut self, state: &SpacecraftState, epoch: &Epoch) -> SunSensorOutput

Measure the sun direction in the body frame (fine sun sensor).

Returns SunSensorOutput::Fine with:

  • direction: Some(...) when the sun is visible (illumination > 0)
  • direction: None when in total eclipse (illumination = 0)
  • illumination in [0, 1]: actual eclipse-aware illumination fraction