pub struct RateSetpoint {
pub roll_rate: f32,
pub pitch_rate: f32,
pub yaw_rate: f32,
pub thrust: f32,
pub idle: bool,
}Expand description
Body-rate target for the Stabilizer; see Setpoint.
Fields§
§roll_rate: f32Roll rate as a fraction of the stabilizer’s maximum, -1.0 to 1.0 (right positive).
pitch_rate: f32Pitch rate as a fraction of the stabilizer’s maximum, -1.0 to 1.0 (nose up
positive).
yaw_rate: f32Yaw rate as a fraction of the stabilizer’s maximum, -1.0 to 1.0 (nose right
positive).
thrust: f32Linear collective thrust, 0.0 to 1.0, before the stabilizer’s thrust curve.
idle: boolGround idle, as AttitudeSetpoint::idle.
Trait Implementations§
Source§impl Clone for RateSetpoint
impl Clone for RateSetpoint
impl Copy for RateSetpoint
Source§impl Debug for RateSetpoint
impl Debug for RateSetpoint
Source§impl Default for RateSetpoint
impl Default for RateSetpoint
Source§impl<'de> Deserialize<'de> for RateSetpoint
impl<'de> Deserialize<'de> for RateSetpoint
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
Source§impl From<&RateCommand> for RateSetpoint
Passes the sticks through as rates, with throttle as thrust.
impl From<&RateCommand> for RateSetpoint
Passes the sticks through as rates, with throttle as thrust.
§Examples
use stable_flight::{RateCommand, RateSetpoint};
let command = RateCommand {
throttle: 0.6,
roll_rate: 0.1,
pitch_rate: -0.2,
yaw_rate: 0.3,
};
let setpoint = RateSetpoint::from(&command);
assert_eq!(
setpoint,
RateSetpoint { roll_rate: 0.1, pitch_rate: -0.2, yaw_rate: 0.3, thrust: 0.6, idle: false }
);Source§fn from(command: &RateCommand) -> Self
fn from(command: &RateCommand) -> Self
Converts to this type from the input type.
Source§impl PartialEq for RateSetpoint
impl PartialEq for RateSetpoint
Source§impl Serialize for RateSetpoint
impl Serialize for RateSetpoint
impl StructuralPartialEq for RateSetpoint
Auto Trait Implementations§
impl Freeze for RateSetpoint
impl RefUnwindSafe for RateSetpoint
impl Send for RateSetpoint
impl Sync for RateSetpoint
impl Unpin for RateSetpoint
impl UnsafeUnpin for RateSetpoint
impl UnwindSafe for RateSetpoint
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.