pub struct MotionModel {
pub max_ramp_us: f64,
pub max_jerk_um_per_us3: f64,
pub max_accel_um_per_us2: f64,
}Expand description
Constant-jerk motion/timing model for AOD moves.
Holds the three timing constants and computes move durations from a
waypoint path. Defaults to the FLAIR constants; construct with
MotionModel::new to override them.
Fields§
§max_ramp_us: f64Maximum amplitude ramp rate (amplitude units per µs). Must be > 0.
max_jerk_um_per_us3: f64Maximum jerk in µm/µs³. Must be > 0.
max_accel_um_per_us2: f64Maximum acceleration in µm/µs². Must be > 0.
Implementations§
Source§impl MotionModel
impl MotionModel
Sourcepub fn new(
max_ramp_us: f64,
max_jerk_um_per_us3: f64,
max_accel_um_per_us2: f64,
) -> Option<Self>
pub fn new( max_ramp_us: f64, max_jerk_um_per_us3: f64, max_accel_um_per_us2: f64, ) -> Option<Self>
Construct a motion model from explicit constants.
All three constants must be positive and finite. max_ramp_us and
max_jerk_um_per_us3 appear as divisors; a non-positive
max_accel_um_per_us2 drives t1 to zero (or negative), which makes
the trajectory solver return NaN/negative durations. Returns None
for any non-physical constant.
Sourcepub fn const_jerk_min_duration_us(&self, max_dist_um: f64) -> f64
pub fn const_jerk_min_duration_us(&self, max_dist_um: f64) -> f64
Minimum duration (µs) for a constant-jerk move over max_dist_um.
Solves the constant-jerk trajectory: below the acceleration cap the move is jerk-limited (four jerk phases); above it, two extra constant-acceleration phases are inserted.
The sign of max_dist_um is ignored (the absolute distance is used);
a distance below ~1e-8 µm is treated as no move and returns 0.0.
Sourcepub fn lane_duration_us(
&self,
waypoints: &[[f64; 2]],
amplitude_delta: f64,
) -> f64
pub fn lane_duration_us( &self, waypoints: &[[f64; 2]], amplitude_delta: f64, ) -> f64
Compute lane duration (µs) from a waypoint path:
ramp + Σ per-segment const-jerk duration + ramp.
The pick and drop ramps are always charged, so a path with no motion
segments (fewer than two waypoints) still costs 2 * ramp rather than
collapsing to a free move. amplitude_delta scales the ramp time; its
sign is ignored.
Trait Implementations§
Source§impl Clone for MotionModel
impl Clone for MotionModel
Source§fn clone(&self) -> MotionModel
fn clone(&self) -> MotionModel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MotionModel
Source§impl Debug for MotionModel
impl Debug for MotionModel
Source§impl PartialEq for MotionModel
impl PartialEq for MotionModel
Source§fn eq(&self, other: &MotionModel) -> bool
fn eq(&self, other: &MotionModel) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MotionModel
Auto Trait Implementations§
impl Freeze for MotionModel
impl RefUnwindSafe for MotionModel
impl Send for MotionModel
impl Sync for MotionModel
impl Unpin for MotionModel
impl UnsafeUnpin for MotionModel
impl UnwindSafe for MotionModel
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<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<T> OrderedSeq<'_, T> for Twhere
T: Clone,
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
§fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
MaybeRef].