pub struct SRobotTraj<const N: usize, T: Float = f32> { /* private fields */ }Expand description
Statically-sized robot trajectory: an SRobotPath sampled uniformly at dt.
Implementations§
Source§impl<const N: usize, T: Float> SRobotTraj<N, T>
impl<const N: usize, T: Float> SRobotTraj<N, T>
pub fn new(dt: Duration, path: SRobotPath<N, T>) -> Self
pub fn try_from_waypoints( dt: Duration, waypoints: Vec<SRobotQ<N, T>>, ) -> DekeResult<Self>
pub fn dt(&self) -> Duration
pub fn set_dt(&mut self, dt: Duration)
pub fn path(&self) -> &SRobotPath<N, T>
pub fn path_mut(&mut self) -> &mut SRobotPath<N, T>
pub fn into_path(self) -> SRobotPath<N, T>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn dof(&self) -> usize
pub fn first(&self) -> &SRobotQ<N, T>
pub fn last(&self) -> &SRobotQ<N, T>
pub fn get(&self, index: usize) -> Option<&SRobotQ<N, T>>
pub fn duration(&self) -> Duration
pub fn time_at(&self, index: usize) -> Duration
pub fn iter(&self) -> Iter<'_, SRobotQ<N, T>>
pub fn iter_timed( &self, ) -> impl Iterator<Item = (Duration, &SRobotQ<N, T>)> + '_
Sourcepub fn sample_at_time(&self, t: Duration) -> Option<SRobotQ<N, T>>
pub fn sample_at_time(&self, t: Duration) -> Option<SRobotQ<N, T>>
Samples the trajectory at a given wall-clock time via linear interpolation between
adjacent waypoints. Times outside [0, duration()] are clamped.
Sourcepub fn velocity_at(&self, i: usize) -> Option<SRobotQ<N, T>>
pub fn velocity_at(&self, i: usize) -> Option<SRobotQ<N, T>>
Finite-difference velocity at sample index i, in joint-units per second.
Uses forward difference at the start, backward at the end, central elsewhere.
Sourcepub fn acceleration_at(&self, i: usize) -> Option<SRobotQ<N, T>>
pub fn acceleration_at(&self, i: usize) -> Option<SRobotQ<N, T>>
Finite-difference acceleration at sample index i, in joint-units per second^2.
pub fn max_joint_velocity(&self) -> T
pub fn max_joint_acceleration(&self) -> T
Sourcepub fn reverse(&mut self)
pub fn reverse(&mut self)
Reverses the trajectory in place (swaps start and end, preserves dt).
pub fn reversed(&self) -> Self
Sourcepub fn rescale_time(&mut self, scale: f64)
pub fn rescale_time(&mut self, scale: f64)
Rescales the trajectory by changing dt. scale > 1.0 slows it down; < 1.0 speeds it up.
pub fn to_robot_traj(&self) -> RobotTraj<T>
Trait Implementations§
Source§impl<const N: usize, T: Float> AsRef<SRobotPath<N, T>> for SRobotTraj<N, T>
impl<const N: usize, T: Float> AsRef<SRobotPath<N, T>> for SRobotTraj<N, T>
Source§fn as_ref(&self) -> &SRobotPath<N, T>
fn as_ref(&self) -> &SRobotPath<N, T>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<const N: usize, T: Clone + Float> Clone for SRobotTraj<N, T>
impl<const N: usize, T: Clone + Float> Clone for SRobotTraj<N, T>
Source§fn clone(&self) -> SRobotTraj<N, T>
fn clone(&self) -> SRobotTraj<N, T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<const N: usize, T: Float> From<SRobotTraj<N, T>> for RobotTraj<T>
impl<const N: usize, T: Float> From<SRobotTraj<N, T>> for RobotTraj<T>
Source§fn from(traj: SRobotTraj<N, T>) -> Self
fn from(traj: SRobotTraj<N, T>) -> Self
Converts to this type from the input type.
Source§impl<const N: usize, T: Float> From<SRobotTraj<N, T>> for SRobotPath<N, T>
impl<const N: usize, T: Float> From<SRobotTraj<N, T>> for SRobotPath<N, T>
Source§fn from(traj: SRobotTraj<N, T>) -> Self
fn from(traj: SRobotTraj<N, T>) -> Self
Converts to this type from the input type.
Source§impl<'a, const N: usize, T: Float> IntoIterator for &'a SRobotTraj<N, T>
impl<'a, const N: usize, T: Float> IntoIterator for &'a SRobotTraj<N, T>
Auto Trait Implementations§
impl<const N: usize, T> Freeze for SRobotTraj<N, T>where
T: Freeze,
impl<const N: usize, T> RefUnwindSafe for SRobotTraj<N, T>where
T: RefUnwindSafe,
impl<const N: usize, T> Send for SRobotTraj<N, T>where
T: Send,
impl<const N: usize, T> Sync for SRobotTraj<N, T>where
T: Sync,
impl<const N: usize, T> Unpin for SRobotTraj<N, T>where
T: Unpin,
impl<const N: usize, T> UnsafeUnpin for SRobotTraj<N, T>where
T: UnsafeUnpin,
impl<const N: usize, T> UnwindSafe for SRobotTraj<N, T>where
T: UnwindSafe,
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