pub struct QuadrotorParams {
pub gravity: f64,
pub drag: f64,
pub min_thrust: f64,
pub max_thrust: f64,
pub max_body_rate: f64,
pub max_speed: f64,
}Expand description
Quadrotor rigid-body parameters and actuation limits.
Translational dynamics are semi-implicit: the collective thrust along the current body z-axis, minus gravity and linear drag, updates the velocity, the speed is capped, and the position integrates the new velocity. Attitude is integrated from the commanded body rates and renormalized each step.
Fields§
§gravity: f64Downward gravitational acceleration [m/s^2].
drag: f64Linear aerodynamic drag coefficient [1/s].
min_thrust: f64Minimum mass-normalized collective thrust [m/s^2].
max_thrust: f64Maximum mass-normalized collective thrust [m/s^2].
max_body_rate: f64Maximum body-rate magnitude [rad/s].
max_speed: f64Maximum speed [m/s] the body can reach.
Implementations§
Source§impl QuadrotorParams
impl QuadrotorParams
pub fn new( gravity: f64, drag: f64, min_thrust: f64, max_thrust: f64, max_body_rate: f64, max_speed: f64, ) -> RoboticsResult<Self>
Sourcepub fn saturate(self, control: QuadrotorControl) -> QuadrotorControl
pub fn saturate(self, control: QuadrotorControl) -> QuadrotorControl
Clamp a command to the thrust and body-rate limits.
Sourcepub fn step(
self,
state: QuadrotorState,
control: QuadrotorControl,
dt: f64,
) -> QuadrotorState
pub fn step( self, state: QuadrotorState, control: QuadrotorControl, dt: f64, ) -> QuadrotorState
Advance the quadrotor one step under the commanded thrust and body rates.
Trait Implementations§
Source§impl Clone for QuadrotorParams
impl Clone for QuadrotorParams
Source§fn clone(&self) -> QuadrotorParams
fn clone(&self) -> QuadrotorParams
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for QuadrotorParams
impl Debug for QuadrotorParams
Source§impl Default for QuadrotorParams
impl Default for QuadrotorParams
Source§impl PartialEq for QuadrotorParams
impl PartialEq for QuadrotorParams
Source§fn eq(&self, other: &QuadrotorParams) -> bool
fn eq(&self, other: &QuadrotorParams) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for QuadrotorParams
impl StructuralPartialEq for QuadrotorParams
Auto Trait Implementations§
impl Freeze for QuadrotorParams
impl RefUnwindSafe for QuadrotorParams
impl Send for QuadrotorParams
impl Sync for QuadrotorParams
impl Unpin for QuadrotorParams
impl UnsafeUnpin for QuadrotorParams
impl UnwindSafe for QuadrotorParams
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,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
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.