Skip to main content

SRobotPath

Struct SRobotPath 

Source
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>

Source

pub fn try_new(waypoints: Vec<SRobotQ<N, T>>) -> DekeResult<Self>

Source

pub fn new_prechecked( first: SRobotQ<N, T>, last: SRobotQ<N, T>, middle: Vec<SRobotQ<N, T>>, ) -> Self

Source

pub fn from_two(start: SRobotQ<N, T>, goal: SRobotQ<N, T>) -> Self

Source

pub fn len(&self) -> usize

Source

pub fn get(&self, index: usize) -> Option<&SRobotQ<N, T>>

Source

pub fn first(&self) -> &SRobotQ<N, T>

Source

pub fn last(&self) -> &SRobotQ<N, T>

Source

pub fn iter(&self) -> Iter<'_, SRobotQ<N, T>>

Source

pub fn iter_mut(&mut self) -> IterMut<'_, SRobotQ<N, T>>

Source

pub fn segments(&self) -> impl Iterator<Item = (&SRobotQ<N, T>, &SRobotQ<N, T>)>

Source

pub fn push(&mut self, q: SRobotQ<N, T>)

Source

pub fn pop(&mut self) -> Option<SRobotQ<N, T>>

Source

pub fn truncate(&mut self, len: usize)

Source

pub fn reverse(&mut self)

Source

pub fn reversed(&self) -> Self

Source

pub fn arc_length(&self) -> T

Source

pub fn segment_lengths(&self) -> Vec<T>

Source

pub fn cumulative_lengths(&self) -> Vec<T>

Source

pub fn max_segment_length(&self) -> T

Source

pub fn max_joint_step(&self) -> T

Source

pub fn sample(&self, t: T) -> Option<SRobotQ<N, T>>

Source

pub fn densify(&self, max_dist: T) -> Self

Source

pub fn deduplicate(&self, tol: T) -> Self

Removes consecutive duplicate waypoints within tol distance of each other.

Source

pub fn simplify(&self, tol: T) -> Self

Source

pub fn to_robot_path(&self) -> RobotPath<T>

Trait Implementations§

Source§

impl<const N: usize, T: Float> AsRef<[SRobotQ<N, T>]> for SRobotPath<N, T>

Source§

fn as_ref(&self) -> &[SRobotQ<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 SRobotPath<N, T>

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl<const N: usize, T: Debug + Float> Debug for SRobotPath<N, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize, T: Float> From<&SRobotPath<N, T>> for RobotPath<T>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

fn from(path: SRobotPath<N, f64>) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize, T: Float> Index<usize> for SRobotPath<N, T>

Source§

type Output = SRobotQ<N, T>

The returned type after indexing.
Source§

fn index(&self, i: usize) -> &SRobotQ<N, T>

Performs the indexing (container[index]) operation. Read more
Source§

impl<const N: usize, T: Float> IndexMut<usize> for SRobotPath<N, T>

Source§

fn index_mut(&mut self, i: usize) -> &mut SRobotQ<N, T>

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<'a, const N: usize, T: Float> IntoIterator for &'a SRobotPath<N, T>

Source§

type Item = &'a SRobotQ<N, T>

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, SRobotQ<N, T>>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<const N: usize, T: Float> IntoIterator for SRobotPath<N, T>

Source§

type Item = SRobotQ<N, T>

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<SRobotQ<N, T>>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<const N: usize, T: Float> TryFrom<&[SRobotQ<N, T>]> for SRobotPath<N, T>

Source§

type Error = DekeError

The type returned in the event of a conversion error.
Source§

fn try_from(waypoints: &[SRobotQ<N, T>]) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize, T: Float> TryFrom<&ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>> for SRobotPath<N, T>

Source§

type Error = DekeError

The type returned in the event of a conversion error.
Source§

fn try_from(arr: &RobotPath<T>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize, T: Float> TryFrom<&Vec<SRobotQ<N, T>>> for SRobotPath<N, T>

Source§

type Error = DekeError

The type returned in the event of a conversion error.
Source§

fn try_from(waypoints: &Vec<SRobotQ<N, T>>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize, T: Float> TryFrom<ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>> for SRobotPath<N, T>

Source§

type Error = DekeError

The type returned in the event of a conversion error.
Source§

fn try_from(arr: RobotPath<T>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<ArrayBase<OwnedRepr<f32>, Dim<[usize; 2]>>> for SRobotPath<N, f64>

Source§

type Error = DekeError

The type returned in the event of a conversion error.
Source§

fn try_from(arr: RobotPath<f32>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>> for SRobotPath<N, f32>

Source§

type Error = DekeError

The type returned in the event of a conversion error.
Source§

fn try_from(arr: RobotPath<f64>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize, T: Float> TryFrom<Vec<SRobotQ<N, T>>> for SRobotPath<N, T>

Source§

type Error = DekeError

The type returned in the event of a conversion error.
Source§

fn try_from(waypoints: Vec<SRobotQ<N, T>>) -> Result<Self, Self::Error>

Performs the conversion.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.