pub struct AltitudeControllerConfig {
pub gains: Gains,
pub max_integral: f32,
pub hover_thrust: f32,
}Expand description
Configures the AltitudeController.
Fields§
§gains: GainsPID gains from altitude error (m) to vertical acceleration (m/s², up).
max_integral: f32Maximum absolute value of the integrated altitude error, in m·s. Prevents integral windup by limiting error accumulation.
hover_thrust: f32Linear thrust (before the stabilizer’s thrust curve) that holds a level hover. The controller feeds it forward, so the integral only trims the residual. Airframe-specific.
Implementations§
Source§impl AltitudeControllerConfig
impl AltitudeControllerConfig
Sourcepub fn validate(&self) -> Result<(), InvalidConfig>
pub fn validate(&self) -> Result<(), InvalidConfig>
Checks the config: max_integral must be non-negative and finite, and hover_thrust
in (0, 1].
§Examples
use stable_flight::controllers::AltitudeControllerConfig;
assert!(AltitudeControllerConfig::default().validate().is_ok());
let bad = AltitudeControllerConfig { hover_thrust: 1.5, ..Default::default() };
assert!(bad.validate().is_err());Trait Implementations§
Source§impl Clone for AltitudeControllerConfig
impl Clone for AltitudeControllerConfig
impl Copy for AltitudeControllerConfig
Source§impl Debug for AltitudeControllerConfig
impl Debug for AltitudeControllerConfig
Source§impl Default for AltitudeControllerConfig
impl Default for AltitudeControllerConfig
Source§impl PartialEq for AltitudeControllerConfig
impl PartialEq for AltitudeControllerConfig
impl StructuralPartialEq for AltitudeControllerConfig
Auto Trait Implementations§
impl Freeze for AltitudeControllerConfig
impl RefUnwindSafe for AltitudeControllerConfig
impl Send for AltitudeControllerConfig
impl Sync for AltitudeControllerConfig
impl Unpin for AltitudeControllerConfig
impl UnsafeUnpin for AltitudeControllerConfig
impl UnwindSafe for AltitudeControllerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.