Skip to main content

PlaneStabilizerConfig

Struct PlaneStabilizerConfig 

Source
pub struct PlaneStabilizerConfig {
    pub rate: PlaneRateControllerConfig,
    pub time_constant_s: Vec2,
    pub max_attitude_rate_radps: Vec2,
    pub max_body_rate_radps: Vec3,
    pub max_bank_rad: f32,
    pub max_pitch_rad: f32,
    pub trim_airspeed_mps: f32,
    pub min_airspeed_mps: f32,
    pub max_airspeed_mps: f32,
    pub thrust_curve_exponent: f32,
}
Expand description

PlaneStabilizer settings.

Fields§

§rate: PlaneRateControllerConfig

The rate loop’s gains and integral limit.

§time_constant_s: Vec2

How fast the attitude loops close their error, roll (x) and pitch (y), in s: the rate target is the error divided by it.

§max_attitude_rate_radps: Vec2

Largest roll (x) and pitch (y) rate the attitude loops ask for, in rad/s.

§max_body_rate_radps: Vec3

Largest body rate an absolute-rate setpoint gets, per axis, in rad/s.

§max_bank_rad: f32

Largest bank an attitude setpoint gets, in radians.

§max_pitch_rad: f32

Largest pitch, up or down, an attitude setpoint gets, in radians; a transition ramp’s isn’t held to it.

§trim_airspeed_mps: f32

The airspeed the gains are tuned at (scale 1), in m/s; assumed without an airspeed.

§min_airspeed_mps: f32

Below this airspeed the scale stops growing and the rate integrals hold, in m/s.

§max_airspeed_mps: f32

Above this airspeed the scale stops shrinking, in m/s.

§thrust_curve_exponent: f32

Linear throttle → motor command exponent (1 passes throttle through). A tailsitter uses its hover stabilizer’s, so a handoff keeps motor commands continuous.

Implementations§

Source§

impl PlaneStabilizerConfig

Source

pub fn validate(&self) -> Result<(), InvalidConfig>

Ok when every field is in range: positive time constants, non-negative rate limits, bank and pitch limits in [0, π], positive airspeeds, and a positive thrust exponent. Each is checked on its own; the scale clamps the airspeed to [min, max] with a max below min read as min, so out-of-order airspeeds degrade, not fail.

§Errors

InvalidConfig naming the first field out of range.

Trait Implementations§

Source§

impl Clone for PlaneStabilizerConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PlaneStabilizerConfig

Source§

impl Debug for PlaneStabilizerConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PlaneStabilizerConfig

Source§

fn default() -> Self

PX4’s fixed-wing defaults (time constants 0.4 s, attitude rate limits 70°/s roll and 60°/s pitch, fw_att_control_params.yaml), acro up to 180°/s roll and pitch and 60°/s yaw, 50° bank and 30° pitch, airspeeds 10/15/25 m/s, and throttle passed through. Placeholders until an airframe is tuned.

Source§

impl ParamMetadata for PlaneStabilizerConfig

Source§

const METADATA: &'static [ParamMeta]

One entry per param: the same names, in the same order, as PARAMS.
Source§

impl ParamTable for PlaneStabilizerConfig

Source§

const PARAMS: &'static [Param<Self>]

Every param, in a stable order.
Source§

impl PartialEq for PlaneStabilizerConfig

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl SideConfig<PlaneSide> for PlaneStabilizerConfig

Source§

fn side(&self) -> &PlaneStabilizerConfig

The side’s config.
Source§

fn side_mut(&mut self) -> &mut PlaneStabilizerConfig

The side’s config, to change it.
Source§

impl StructuralPartialEq for PlaneStabilizerConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.