pub struct RacingDroneDynamics3D {
pub drag: f64,
pub gravity: f64,
pub max_speed: f64,
pub accel_limit: f64,
}Expand description
Point-mass drone dynamics with linear drag, gravity, and actuation limits.
The discrete update is semi-implicit: the commanded acceleration (capped to
accel_limit in magnitude) and gravity update the velocity, linear drag
decays it, the speed is capped to max_speed, and the position integrates
the new velocity. This stays stable for the step sizes used by the racing
MPPI rollouts while modeling drag and saturation effects a pure double
integrator ignores.
Fields§
§drag: f64Linear drag coefficient [1/s].
gravity: f64Downward gravitational acceleration [m/s^2] applied to vz.
max_speed: f64Maximum speed [m/s] the drone body can reach.
accel_limit: f64Maximum commanded acceleration magnitude [m/s^2].
Implementations§
Source§impl RacingDroneDynamics3D
impl RacingDroneDynamics3D
pub fn new( drag: f64, gravity: f64, max_speed: f64, accel_limit: f64, ) -> RoboticsResult<Self>
Sourcepub fn saturate(self, control: RacingDroneControl3D) -> RacingDroneControl3D
pub fn saturate(self, control: RacingDroneControl3D) -> RacingDroneControl3D
Clamp a control’s acceleration magnitude to accel_limit.
Sourcepub fn step(
self,
state: RacingDroneState3D,
control: RacingDroneControl3D,
dt: f64,
) -> RacingDroneState3D
pub fn step( self, state: RacingDroneState3D, control: RacingDroneControl3D, dt: f64, ) -> RacingDroneState3D
Advance the drone one step under the commanded acceleration.
Trait Implementations§
Source§impl Clone for RacingDroneDynamics3D
impl Clone for RacingDroneDynamics3D
Source§fn clone(&self) -> RacingDroneDynamics3D
fn clone(&self) -> RacingDroneDynamics3D
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RacingDroneDynamics3D
impl Debug for RacingDroneDynamics3D
Source§impl Default for RacingDroneDynamics3D
impl Default for RacingDroneDynamics3D
Source§impl PartialEq for RacingDroneDynamics3D
impl PartialEq for RacingDroneDynamics3D
Source§fn eq(&self, other: &RacingDroneDynamics3D) -> bool
fn eq(&self, other: &RacingDroneDynamics3D) -> bool
self and other values to be equal, and is used by ==.impl Copy for RacingDroneDynamics3D
impl StructuralPartialEq for RacingDroneDynamics3D
Auto Trait Implementations§
impl Freeze for RacingDroneDynamics3D
impl RefUnwindSafe for RacingDroneDynamics3D
impl Send for RacingDroneDynamics3D
impl Sync for RacingDroneDynamics3D
impl Unpin for RacingDroneDynamics3D
impl UnsafeUnpin for RacingDroneDynamics3D
impl UnwindSafe for RacingDroneDynamics3D
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,
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>
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>
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>
self from the equivalent element of its
superset. Read more§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).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.