-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathmodel_config.rs
More file actions
56 lines (51 loc) · 2.1 KB
/
model_config.rs
File metadata and controls
56 lines (51 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* SPDX-License-Identifier: MIT
* Copyright (c) 2023 - 2026. The DeepCausality Authors and Contributors. All Rights Reserved.
*/
//! # Flight Envelope Monitor — Preset Configuration Values
//!
//! Runtime instances supplied to the pipeline at start-up. Lifted out of
//! `main.rs` so the composition there reads as pure orchestration without
//! the noise of literal numbers.
//!
//! * [`nominal_aircraft_config`] — sample airframe parameters used as the
//! `Context` channel.
//! * [`nominal_sensor_reading`] — a slightly-degraded sample reading that
//! exercises the smooth-deterioration aggregation in Stage 1 (the
//! airspeed is just below the healthy band).
//! * [`seed_estimate_for`] — derives a `FlightStateEstimate` seed from a
//! `SensorReading`. Used by the Stage-2.1 bind callback because
//! `SensorReading` no longer flows on the value channel by that point.
use crate::model_types::{AircraftConfig, FlightStateEstimate, SensorReading};
/// Sample airframe configuration for the `Context` channel.
pub fn nominal_aircraft_config() -> AircraftConfig {
AircraftConfig {
mass_kg: 70_000.0,
mtow_kg: 80_000.0,
stall_margin: 1.3,
service_ceiling_m: 12_800.0,
}
}
/// Sample per-cycle sensor reading. Airspeed `175 kn` sits just below the
/// healthy band `[180, 320]`, producing a non-1.0 joint-health signal that
/// seeds a non-zero `state.risk` in Stage 2.1.
pub fn nominal_sensor_reading() -> SensorReading {
SensorReading {
airspeed_kn: 175.0,
altitude_ft: 12_500.0,
attitude_deg: 2.0,
vertical_speed_fpm: 0.0,
fuel_flow_pph: 2_400.0,
}
}
/// Build the seed `FlightStateEstimate` that Stage 2.1 places on the value
/// channel after the sensor collection has reduced the value channel to a
/// scalar joint-health probability.
pub fn seed_estimate_for(reading: &SensorReading) -> FlightStateEstimate {
FlightStateEstimate {
airspeed_kn: reading.airspeed_kn,
altitude_ft: reading.altitude_ft,
attitude_deg: reading.attitude_deg,
vertical_speed_fpm: reading.vertical_speed_fpm,
}
}