pub struct MultiCopterAttitudeController {
pub roll_rate: PID,
pub pitch_rate: PID,
pub yaw_rate: PID,
pub attitude_controller: AttitudeController,
}Expand description
use embedded_flight_control::MultiCopterAttitudeController;
let mut controller = MultiCopterAttitudeController::default();
// Input the desired attitude and angular velocity with the current attitude
controller.attitude_controller.input(
Quaternion::default(),
Vector3::default(),
Quaternion::default(),
);
// Output the control to the motors with the current gyroscope data.
let output = controller.motor_output(Vector3::default(), 1);
dbg!(output);Fields
roll_rate: PIDpitch_rate: PIDyaw_rate: PIDattitude_controller: AttitudeControllerImplementations
sourceimpl MultiCopterAttitudeController
impl MultiCopterAttitudeController
sourcepub fn motor_output(
&mut self,
gyro: Vector3<f32>,
now_ms: u32
) -> MotorOutput<f32>
pub fn motor_output(
&mut self,
gyro: Vector3<f32>,
now_ms: u32
) -> MotorOutput<f32>
Calculate the motor output of the controller (in -1 ~ +1) .
sourcepub fn motor_output_with_limit(
&mut self,
gyro: Vector3<f32>,
now_ms: u32,
limit: [bool; 3]
) -> MotorOutput<f32>
pub fn motor_output_with_limit(
&mut self,
gyro: Vector3<f32>,
now_ms: u32,
limit: [bool; 3]
) -> MotorOutput<f32>
Calculate the motor output of the controller (in -1 ~ +1) with an optional limit for roll, pitch, and yaw.
pub fn update_throttle_rpy_mix(&mut self)
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for MultiCopterAttitudeController
impl Send for MultiCopterAttitudeController
impl Sync for MultiCopterAttitudeController
impl Unpin for MultiCopterAttitudeController
impl UnwindSafe for MultiCopterAttitudeController
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
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 more
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).
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.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self to the equivalent element of its superset.