Skip to main content

stable_flight/guidance/vtol/off_nose/
params.rs

1//! [`OffNoseSpeedConfig`]'s params; the names and units are tabled in [`crate::params`].
2
3use super::OffNoseSpeedConfig;
4use crate::params::{Param, ParamTable, param};
5
6impl ParamTable for OffNoseSpeedConfig {
7    const PARAMS: &'static [Param<Self>] = &[
8        param!("OFFNOSE_SPD", speed_mps),
9        param!(deg "OFFNOSE_FREE", free_rad),
10        param!(deg "OFFNOSE_FULL", full_rad),
11        param!("OFFNOSE_DIV", tail_first_divisor),
12    ];
13}
14
15#[cfg(feature = "param-metadata")]
16mod metadata {
17    use super::OffNoseSpeedConfig;
18    use crate::params::metadata::{ParamMeta, ParamMetadata};
19
20    const OFF_NOSE: ParamMeta = ParamMeta::in_group("Guidance", "Off-nose speed");
21
22    impl ParamMetadata for OffNoseSpeedConfig {
23        const METADATA: &'static [ParamMeta] = &[
24            OFF_NOSE
25                .param(
26                    "OFFNOSE_SPD",
27                    "Copter-flight speed cap just off the nose; divided tail first (0: off)",
28                )
29                .with_units("m/s")
30                .at_least(0.0),
31            OFF_NOSE
32                .param("OFFNOSE_FREE", "Heading error the speed isn't cut within")
33                .with_units("deg")
34                .at_least(0.0)
35                .below(180.0),
36            OFF_NOSE
37                .param("OFFNOSE_FULL", "Heading error from which the cut is whole")
38                .with_units("deg")
39                .above(0.0)
40                .at_most(180.0),
41            OFF_NOSE
42                .param("OFFNOSE_DIV", "What the speed is divided by tail first")
43                .at_least(1.0),
44        ];
45    }
46}