pub struct AttitudeCommand {
pub throttle: f32,
pub roll: f32,
pub pitch: f32,
pub yaw: f32,
}Expand description
Represents direct manual control of an aircraft’s attitude (orientation).
This struct encapsulates pilot inputs from control devices like joysticks,
yokes, or keyboard/mouse combinations to control the aircraft’s orientation
(roll, pitch, yaw) and throttle. It is typically used within a ControlInput::Attitude
variant to issue manual flight commands to the flight system.
§Value Ranges
throttle:0.0(idle) to1.0(full power)roll:-1.0(full left bank) to1.0(full right bank)pitch:-1.0(full nose down) to1.0(full nose up)yaw:-1.0(full left turn) to1.0(full right turn)
Note: The specified ranges are conventional and recommended for typical use. Values outside these ranges may be clamped, ignored, or cause undefined behavior depending on the flight system’s implementation.
§Examples
Creating an AttitudeCommand for a slight climb with a right bank:
use stable_flight::AttitudeCommand;
let cmd = AttitudeCommand {
throttle: 0.75, // 75% throttle
roll: 0.1, // Slight right bank
pitch: 0.05, // Slight nose up
yaw: 0.0, // No yaw input
};§Default Implementation
The Default trait is implemented for AttitudeCommand, providing the following
default values:
throttle:0.0roll:0.0pitch:0.0yaw:0.0
Fields§
§throttle: f32Controls the engine power output, ranging from 0.0 (idle) to 1.0 (maximum).
roll: f32Controls the aircraft’s roll/bank angle, ranging from -1.0 (full left bank)
to 1.0 (full right bank).
pitch: f32Controls the aircraft’s pitch angle, ranging from -1.0 (full nose down)
to 1.0 (full nose up).
yaw: f32Controls the aircraft’s yaw rotation, ranging from -1.0 (full left turn)
to 1.0 (full right turn).
Trait Implementations§
Source§impl Clone for AttitudeCommand
impl Clone for AttitudeCommand
impl Copy for AttitudeCommand
Source§impl Debug for AttitudeCommand
impl Debug for AttitudeCommand
Source§impl Default for AttitudeCommand
impl Default for AttitudeCommand
Source§impl<'de> Deserialize<'de> for AttitudeCommand
impl<'de> Deserialize<'de> for AttitudeCommand
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 AttitudeCommand
impl PartialEq for AttitudeCommand
Source§impl Serialize for AttitudeCommand
impl Serialize for AttitudeCommand
impl StructuralPartialEq for AttitudeCommand
Auto Trait Implementations§
impl Forget for AttitudeCommand
impl Freeze for AttitudeCommand
impl Move for AttitudeCommand
impl RefUnwindSafe for AttitudeCommand
impl Send for AttitudeCommand
impl Sync for AttitudeCommand
impl Unpin for AttitudeCommand
impl UnsafeUnpin for AttitudeCommand
impl UnwindSafe for AttitudeCommand
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.