pub struct AbsoluteAttitudeCommand {
pub roll_rad: f32,
pub pitch_rad: f32,
pub heading_rad: f32,
pub thrust: f32,
}Expand description
An absolute attitude and collective thrust, for ControlInput::AbsoluteAttitude: what
an offboard app (e.g. MAVLink SET_ATTITUDE_TARGET) asks for, as opposed to the normalized
stick positions of an AttitudeCommand.
Per the input policy, nothing is rejected: the stabilizer saturates roll and pitch to its
maximum tilt and flies NaN as level, a NaN heading holds the current heading-hold target,
and thrust saturates to [0, 1] (NaN means none).
§Examples
A 10° right bank, holding north, at 45% thrust:
use stable_flight::{AbsoluteAttitudeCommand, ControlInput};
let input = ControlInput::AbsoluteAttitude(AbsoluteAttitudeCommand {
roll_rad: 10.0_f32.to_radians(),
pitch_rad: 0.0,
heading_rad: 0.0,
thrust: 0.45,
});Fields§
§roll_rad: f32Roll in radians, right positive, per the
frame contract’s roll_rad.
pitch_rad: f32Pitch in radians, nose up positive, per the
frame contract’s pitch_rad.
heading_rad: f32Absolute heading in radians, in the
frame contract’s heading_rad convention; any value,
wrapped by guidance.
thrust: f32Collective thrust along the body axis, 0.0 to 1.0. Unlike an AttitudeCommand’s
throttle, it is not boosted for tilt: the sender owns that compensation.
Trait Implementations§
Source§impl Clone for AbsoluteAttitudeCommand
impl Clone for AbsoluteAttitudeCommand
impl Copy for AbsoluteAttitudeCommand
Source§impl Debug for AbsoluteAttitudeCommand
impl Debug for AbsoluteAttitudeCommand
Source§impl Default for AbsoluteAttitudeCommand
impl Default for AbsoluteAttitudeCommand
Source§impl<'de> Deserialize<'de> for AbsoluteAttitudeCommand
impl<'de> Deserialize<'de> for AbsoluteAttitudeCommand
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>,
Source§impl PartialEq for AbsoluteAttitudeCommand
impl PartialEq for AbsoluteAttitudeCommand
Source§impl Serialize for AbsoluteAttitudeCommand
impl Serialize for AbsoluteAttitudeCommand
impl StructuralPartialEq for AbsoluteAttitudeCommand
Auto Trait Implementations§
impl Freeze for AbsoluteAttitudeCommand
impl RefUnwindSafe for AbsoluteAttitudeCommand
impl Send for AbsoluteAttitudeCommand
impl Sync for AbsoluteAttitudeCommand
impl Unpin for AbsoluteAttitudeCommand
impl UnsafeUnpin for AbsoluteAttitudeCommand
impl UnwindSafe for AbsoluteAttitudeCommand
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
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.