pub struct AbsoluteRateCommand {
pub roll_radps: f32,
pub pitch_radps: f32,
pub yaw_radps: f32,
pub thrust: f32,
}Expand description
Absolute body rates and collective thrust, for ControlInput::AbsoluteRate: what a
maneuver or an offboard app (e.g. MAVLink SET_ATTITUDE_TARGET body rates) asks for, as
opposed to the stick fractions of a RateCommand.
Per the input policy, nothing is rejected: the stabilizer saturates the rates to its
limits (NaN as zero) and thrust to [0, 1] (NaN means none).
§Examples
A full-rate roll to the right at 60% thrust:
use stable_flight::{AbsoluteRateCommand, ControlInput};
let input = ControlInput::AbsoluteRate(AbsoluteRateCommand {
roll_radps: 360.0_f32.to_radians(),
thrust: 0.6,
..Default::default()
});Fields§
§roll_radps: f32Roll rate about body x in rad/s, right positive.
pitch_radps: f32Pitch rate about body y in rad/s, nose up positive.
yaw_radps: f32Yaw rate about body z in rad/s, nose right positive.
thrust: f32Collective thrust, 0.0 to 1.0.
Trait Implementations§
Source§impl Clone for AbsoluteRateCommand
impl Clone for AbsoluteRateCommand
impl Copy for AbsoluteRateCommand
Source§impl Debug for AbsoluteRateCommand
impl Debug for AbsoluteRateCommand
Source§impl Default for AbsoluteRateCommand
impl Default for AbsoluteRateCommand
Source§impl<'de> Deserialize<'de> for AbsoluteRateCommand
impl<'de> Deserialize<'de> for AbsoluteRateCommand
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<&AbsoluteRateCommand> for BodyRateSetpoint
The rates of an AbsoluteRateCommand, as given.
impl From<&AbsoluteRateCommand> for BodyRateSetpoint
The rates of an AbsoluteRateCommand, as given.
§Examples
use stable_flight::{AbsoluteRateCommand, BodyRateSetpoint};
let command = AbsoluteRateCommand { roll_radps: 2.0, thrust: 0.5, ..Default::default() };
assert_eq!(BodyRateSetpoint::from(&command).roll_radps, 2.0);Source§fn from(command: &AbsoluteRateCommand) -> Self
fn from(command: &AbsoluteRateCommand) -> Self
Converts to this type from the input type.
Source§impl PartialEq for AbsoluteRateCommand
impl PartialEq for AbsoluteRateCommand
Source§impl Serialize for AbsoluteRateCommand
impl Serialize for AbsoluteRateCommand
impl StructuralPartialEq for AbsoluteRateCommand
Auto Trait Implementations§
impl Freeze for AbsoluteRateCommand
impl RefUnwindSafe for AbsoluteRateCommand
impl Send for AbsoluteRateCommand
impl Sync for AbsoluteRateCommand
impl Unpin for AbsoluteRateCommand
impl UnsafeUnpin for AbsoluteRateCommand
impl UnwindSafe for AbsoluteRateCommand
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.