pub struct SRobotPath<const N: usize, T: Float = f32> { /* private fields */ }Expand description
Statically-sized robot path backed by Vec<SRobotQ<N, T>>.
SRobotPath is guaranteed to have at least 2 waypoints, so it always has a defined start and end configuration.
Implementations§
Source§impl<const N: usize, T: Float> SRobotPath<N, T>
impl<const N: usize, T: Float> SRobotPath<N, T>
pub fn try_new(waypoints: Vec<SRobotQ<N, T>>) -> DekeResult<Self>
pub fn new_prechecked( first: SRobotQ<N, T>, last: SRobotQ<N, T>, middle: Vec<SRobotQ<N, T>>, ) -> Self
pub fn from_two(start: SRobotQ<N, T>, goal: SRobotQ<N, T>) -> Self
pub fn len(&self) -> usize
pub fn get(&self, index: usize) -> Option<&SRobotQ<N, T>>
pub fn first(&self) -> &SRobotQ<N, T>
pub fn last(&self) -> &SRobotQ<N, T>
pub fn iter(&self) -> Iter<'_, SRobotQ<N, T>>
pub fn iter_mut(&mut self) -> IterMut<'_, SRobotQ<N, T>>
pub fn segments(&self) -> impl Iterator<Item = (&SRobotQ<N, T>, &SRobotQ<N, T>)>
pub fn push(&mut self, q: SRobotQ<N, T>)
pub fn pop(&mut self) -> Option<SRobotQ<N, T>>
pub fn truncate(&mut self, len: usize)
pub fn reverse(&mut self)
pub fn reversed(&self) -> Self
pub fn arc_length(&self) -> T
pub fn segment_lengths(&self) -> Vec<T>
pub fn cumulative_lengths(&self) -> Vec<T>
pub fn max_segment_length(&self) -> T
pub fn max_joint_step(&self) -> T
pub fn sample(&self, t: T) -> Option<SRobotQ<N, T>>
pub fn densify(&self, max_dist: T) -> Self
Sourcepub fn deduplicate(&self, tol: T) -> Self
pub fn deduplicate(&self, tol: T) -> Self
Removes consecutive duplicate waypoints within tol distance of each other.
pub fn simplify(&self, tol: T) -> Self
pub fn to_robot_path(&self) -> RobotPath<T>
Trait Implementations§
Source§impl<const N: usize, T: Clone + Float> Clone for SRobotPath<N, T>
impl<const N: usize, T: Clone + Float> Clone for SRobotPath<N, T>
Source§fn clone(&self) -> SRobotPath<N, T>
fn clone(&self) -> SRobotPath<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<&SRobotPath<N, T>> for RobotPath<T>
impl<const N: usize, T: Float> From<&SRobotPath<N, T>> for RobotPath<T>
Source§fn from(sp: &SRobotPath<N, T>) -> Self
fn from(sp: &SRobotPath<N, T>) -> Self
Converts to this type from the input type.
Source§impl<const N: usize> From<SRobotPath<N>> for RobotPath<f64>
impl<const N: usize> From<SRobotPath<N>> for RobotPath<f64>
Source§fn from(sp: SRobotPath<N, f32>) -> Self
fn from(sp: SRobotPath<N, f32>) -> Self
Converts to this type from the input type.
Source§impl<const N: usize> From<SRobotPath<N>> for SRobotPath<N, f64>
impl<const N: usize> From<SRobotPath<N>> for SRobotPath<N, f64>
Source§fn from(path: SRobotPath<N, f32>) -> Self
fn from(path: SRobotPath<N, f32>) -> Self
Converts to this type from the input type.
Source§impl<const N: usize, T: Float> From<SRobotPath<N, T>> for RobotPath<T>
impl<const N: usize, T: Float> From<SRobotPath<N, T>> for RobotPath<T>
Source§fn from(sp: SRobotPath<N, T>) -> Self
fn from(sp: SRobotPath<N, T>) -> Self
Converts to this type from the input type.
Source§impl<const N: usize> From<SRobotPath<N, f64>> for RobotPath<f32>
impl<const N: usize> From<SRobotPath<N, f64>> for RobotPath<f32>
Source§fn from(sp: SRobotPath<N, f64>) -> Self
fn from(sp: SRobotPath<N, f64>) -> Self
Converts to this type from the input type.
Source§impl<const N: usize> From<SRobotPath<N, f64>> for SRobotPath<N, f32>
impl<const N: usize> From<SRobotPath<N, f64>> for SRobotPath<N, f32>
Source§fn from(path: SRobotPath<N, f64>) -> Self
fn from(path: SRobotPath<N, f64>) -> Self
Converts to this type from the input type.
Source§impl<'a, const N: usize, T: Float> IntoIterator for &'a SRobotPath<N, T>
impl<'a, const N: usize, T: Float> IntoIterator for &'a SRobotPath<N, T>
Source§impl<const N: usize, T: Float> IntoIterator for SRobotPath<N, T>
impl<const N: usize, T: Float> IntoIterator for SRobotPath<N, T>
Source§impl<const N: usize, T: Float> TryFrom<&ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>> for SRobotPath<N, T>
impl<const N: usize, T: Float> TryFrom<&ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>> for SRobotPath<N, T>
Source§impl<const N: usize, T: Float> TryFrom<ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>> for SRobotPath<N, T>
impl<const N: usize, T: Float> TryFrom<ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>> for SRobotPath<N, T>
Source§impl<const N: usize> TryFrom<ArrayBase<OwnedRepr<f32>, Dim<[usize; 2]>>> for SRobotPath<N, f64>
impl<const N: usize> TryFrom<ArrayBase<OwnedRepr<f32>, Dim<[usize; 2]>>> for SRobotPath<N, f64>
Auto Trait Implementations§
impl<const N: usize, T> Freeze for SRobotPath<N, T>where
T: Freeze,
impl<const N: usize, T> RefUnwindSafe for SRobotPath<N, T>where
T: RefUnwindSafe,
impl<const N: usize, T> Send for SRobotPath<N, T>where
T: Send,
impl<const N: usize, T> Sync for SRobotPath<N, T>where
T: Sync,
impl<const N: usize, T> Unpin for SRobotPath<N, T>where
T: Unpin,
impl<const N: usize, T> UnsafeUnpin for SRobotPath<N, T>where
T: UnsafeUnpin,
impl<const N: usize, T> UnwindSafe for SRobotPath<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