#[non_exhaustive]pub enum Setpoint {
Attitude(AttitudeSetpoint),
Rate(RateSetpoint),
}Expand description
What the Stabilizer should hold this tick, as produced by a Guidance.
A ControlInput says what the operator or mission wants (stick positions, a waypoint);
a Setpoint is the inner-loop target derived from it. Attitude targets are physical
angles in radians; rates and thrust are normalized. The stabilizer owns the physical
limits (maximum tilt and rates) and the thrust curve, and saturates out-of-range or NaN
inputs per the input policy.
#[non_exhaustive]: new setpoint kinds (e.g. fixed-wing) can be added without a breaking
change. A Stabilizer that can’t fly a variant must fall back to neutral, not panic (see
Stabilizer::stabilize).
§Examples
use stable_flight::{AttitudeSetpoint, Setpoint};
// Level, north-facing hover at half linear thrust.
let hover = Setpoint::Attitude(AttitudeSetpoint { thrust: 0.5, ..Default::default() });Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Attitude(AttitudeSetpoint)
Hold a roll/pitch attitude and an absolute heading.
Rate(RateSetpoint)
Hold body rates.
Trait Implementations§
impl Copy for Setpoint
Source§impl<'de> Deserialize<'de> for Setpoint
impl<'de> Deserialize<'de> for Setpoint
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Setpoint
Auto Trait Implementations§
impl Freeze for Setpoint
impl RefUnwindSafe for Setpoint
impl Send for Setpoint
impl Sync for Setpoint
impl Unpin for Setpoint
impl UnsafeUnpin for Setpoint
impl UnwindSafe for Setpoint
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.