Struct embedded_flight::copter::control::QuadMotorControl
source · [−]pub struct QuadMotorControl<E> {
pub m: f32,
pub k_m: f32,
pub k_f: f32,
pub l: f32,
pub min_thrust: f32,
pub max_thrust: f32,
pub motors: [E; 4],
}Fields
m: f32k_m: f32k_f: f32l: f32Perpendicular distance to axes (in meters)
min_thrust: f32max_thrust: f32motors: [E; 4]Implementations
sourceimpl<E: ESC<f32>> QuadMotorControl<E>
impl<E: ESC<f32>> QuadMotorControl<E>
pub fn new(
m: f32,
length: f32,
max_thrust: f32,
min_thrust: f32,
motors: [E; 4]
) -> Self
sourcepub fn thrust_from_acceleration(
&self,
acceleration: Vector3<f32>,
thrust_acceleration: f32,
moment_of_inertia: &Vector3<f32>
) -> [f32; 4]
pub fn thrust_from_acceleration(
&self,
acceleration: Vector3<f32>,
thrust_acceleration: f32,
moment_of_inertia: &Vector3<f32>
) -> [f32; 4]
Calculate the thrust on each propeller (in N) needed to command an angular acceleration (in m/s^2) and thrust acceleration (in m/s^2) with the moment of inertia (kgm^2).
sourcepub fn angular_velocity(
&self,
torque: Vector3<f32>,
thrust_acceleration: f32,
moment_of_inertia: &Vector3<f32>
) -> [f32; 4]
pub fn angular_velocity(
&self,
torque: Vector3<f32>,
thrust_acceleration: f32,
moment_of_inertia: &Vector3<f32>
) -> [f32; 4]
Calculate the angular velocity on each propeller (in m/s) needed to command a torque (in Nm) and thrust acceleration (in m/s^2) with the moment of inertia (kgm^2).
sourcepub fn angular_velocity_from_acceleration(
&self,
acceleration: Vector3<f32>,
thrust_acceleration: f32,
moment_of_inertia: &Vector3<f32>
) -> [f32; 4]
pub fn angular_velocity_from_acceleration(
&self,
acceleration: Vector3<f32>,
thrust_acceleration: f32,
moment_of_inertia: &Vector3<f32>
) -> [f32; 4]
Calculate the angular velocity on each propeller (in m/s) needed to command an angular acceleration (in m/s^2) and thrust acceleration (in m/s^2).
pub fn thrust_from_angular_velocity(
&self,
angular_velocity: [f32; 4]
) -> [f32; 4]
pub fn output_thrust(&mut self, thrust: [f32; 4])
Trait Implementations
sourceimpl<E: ESC<f32>> MotorControl for QuadMotorControl<E>
impl<E: ESC<f32>> MotorControl for QuadMotorControl<E>
Auto Trait Implementations
impl<E> RefUnwindSafe for QuadMotorControl<E> where
E: RefUnwindSafe,
impl<E> Send for QuadMotorControl<E> where
E: Send,
impl<E> Sync for QuadMotorControl<E> where
E: Sync,
impl<E> Unpin for QuadMotorControl<E> where
E: Unpin,
impl<E> UnwindSafe for QuadMotorControl<E> where
E: UnwindSafe,
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.