pub struct PlaneRateControllerConfig {
pub roll: RateGains,
pub pitch: RateGains,
pub yaw: RateGains,
pub max_integral: f32,
pub trim: Vec3,
}Expand description
Configures the PlaneRateController.
Fields§
§roll: RateGainsRoll-rate gains.
pitch: RateGainsPitch-rate gains.
yaw: RateGainsYaw-rate gains.
max_integral: f32Largest accumulated rate error per axis, in rad.
trim: Vec3The moment each axis holds at trim airspeed and zero rate error, roll (x), pitch
(y), and yaw (z), normalized: what the wing needs in steady level flight (a nose-up
pitch moment for a wing that pitches down), so neither the attitude loop’s error nor the
rate integral has to hold it.
Implementations§
Source§impl PlaneRateControllerConfig
impl PlaneRateControllerConfig
Sourcepub fn validate(&self) -> Result<(), InvalidConfig>
pub fn validate(&self) -> Result<(), InvalidConfig>
Ok when every gain and max_integral is non-negative and finite, and each trim is in
[-1, 1].
§Errors
InvalidConfig naming the first field out of range.
§Examples
use stable_flight::controllers::PlaneRateControllerConfig;
assert!(PlaneRateControllerConfig::default().validate().is_ok());
let mut bad = PlaneRateControllerConfig::default();
bad.pitch.ff = -0.1;
assert_eq!(bad.validate().unwrap_err().field, "pitch.ff");Trait Implementations§
Source§impl Clone for PlaneRateControllerConfig
impl Clone for PlaneRateControllerConfig
impl Copy for PlaneRateControllerConfig
Source§impl Debug for PlaneRateControllerConfig
impl Debug for PlaneRateControllerConfig
Source§impl Default for PlaneRateControllerConfig
impl Default for PlaneRateControllerConfig
impl StructuralPartialEq for PlaneRateControllerConfig
Auto Trait Implementations§
impl Forget for PlaneRateControllerConfig
impl Freeze for PlaneRateControllerConfig
impl Move for PlaneRateControllerConfig
impl RefUnwindSafe for PlaneRateControllerConfig
impl Send for PlaneRateControllerConfig
impl Sync for PlaneRateControllerConfig
impl Unpin for PlaneRateControllerConfig
impl UnsafeUnpin for PlaneRateControllerConfig
impl UnwindSafe for PlaneRateControllerConfig
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.