Skip to main content

RobotPath

Struct RobotPath 

Source
pub struct RobotPath { /* private fields */ }
Expand description

An ordered sequence of joint configurations representing a robot path.

Implementations§

Source§

impl RobotPath

Source

pub fn new(waypoints: Vec<RobotQ>) -> DekeResult<Self>

Source

pub fn empty() -> Self

Source

pub fn with_capacity(cap: usize) -> Self

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn ndof(&self) -> usize

Number of joints per waypoint, or 0 if the path is empty.

Source

pub fn get(&self, index: usize) -> Option<&RobotQ>

Source

pub fn first(&self) -> Option<&RobotQ>

Source

pub fn last(&self) -> Option<&RobotQ>

Source

pub fn iter(&self) -> Iter<'_, RobotQ>

Source

pub fn iter_mut(&mut self) -> IterMut<'_, RobotQ>

Source

pub fn segments(&self) -> impl Iterator<Item = (&RobotQ, &RobotQ)>

Iterator over consecutive pairs of waypoints.

Source

pub fn push(&mut self, q: RobotQ) -> DekeResult<()>

Source

pub fn pop(&mut self) -> Option<RobotQ>

Source

pub fn clear(&mut self)

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) -> f32

Total arc length (sum of Euclidean distances between consecutive waypoints).

Source

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

Euclidean distance of each segment.

Source

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

Cumulative arc length at each waypoint, starting at 0.0.

Source

pub fn max_segment_length(&self) -> f32

Maximum Euclidean distance between any two consecutive waypoints.

Source

pub fn max_joint_step(&self) -> f32

Maximum per-joint deviation (L-inf norm) across any segment.

Source

pub fn sample(&self, t: f32) -> Option<RobotQ>

Linearly interpolate along the path by normalized parameter t in [0, 1]. Returns None if the path has fewer than 2 waypoints.

Source

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

Subdivide every segment so that no segment exceeds max_dist.

Source

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

Remove waypoints that are within tol of the line between their neighbors (Ramer-Douglas-Peucker in joint space).

Source

pub fn map_waypoints(&self, f: impl Fn(&RobotQ) -> RobotQ) -> Self

Apply a function to every waypoint.

Trait Implementations§

Source§

impl Clone for RobotPath

Source§

fn clone(&self) -> RobotPath

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 Debug for RobotPath

Source§

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

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

impl FromIterator<ArrayBase<OwnedRepr<f32>, Dim<[usize; 1]>>> for RobotPath

Source§

fn from_iter<I: IntoIterator<Item = RobotQ>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl Index<usize> for RobotPath

Source§

type Output = ArrayBase<OwnedRepr<f32>, Dim<[usize; 1]>>

The returned type after indexing.
Source§

fn index(&self, i: usize) -> &RobotQ

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

impl IndexMut<usize> for RobotPath

Source§

fn index_mut(&mut self, i: usize) -> &mut RobotQ

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

impl<'a> IntoIterator for &'a RobotPath

Source§

type Item = &'a ArrayBase<OwnedRepr<f32>, Dim<[usize; 1]>>

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, ArrayBase<OwnedRepr<f32>, Dim<[usize; 1]>>>

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 IntoIterator for RobotPath

Source§

type Item = ArrayBase<OwnedRepr<f32>, Dim<[usize; 1]>>

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<ArrayBase<OwnedRepr<f32>, Dim<[usize; 1]>>>

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

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

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.