pub struct RobotPath { /* private fields */ }Expand description
An ordered sequence of joint configurations representing a robot path.
Implementations§
Source§impl RobotPath
impl RobotPath
pub fn new(waypoints: Vec<RobotQ>) -> DekeResult<Self>
pub fn empty() -> Self
pub fn with_capacity(cap: usize) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get(&self, index: usize) -> Option<&RobotQ>
pub fn first(&self) -> Option<&RobotQ>
pub fn last(&self) -> Option<&RobotQ>
pub fn iter(&self) -> Iter<'_, RobotQ>
pub fn iter_mut(&mut self) -> IterMut<'_, RobotQ>
Sourcepub fn segments(&self) -> impl Iterator<Item = (&RobotQ, &RobotQ)>
pub fn segments(&self) -> impl Iterator<Item = (&RobotQ, &RobotQ)>
Iterator over consecutive pairs of waypoints.
pub fn push(&mut self, q: RobotQ) -> DekeResult<()>
pub fn pop(&mut self) -> Option<RobotQ>
pub fn clear(&mut self)
pub fn truncate(&mut self, len: usize)
pub fn reverse(&mut self)
pub fn reversed(&self) -> Self
Sourcepub fn arc_length(&self) -> f32
pub fn arc_length(&self) -> f32
Total arc length (sum of Euclidean distances between consecutive waypoints).
Sourcepub fn segment_lengths(&self) -> Vec<f32>
pub fn segment_lengths(&self) -> Vec<f32>
Euclidean distance of each segment.
Sourcepub fn cumulative_lengths(&self) -> Vec<f32>
pub fn cumulative_lengths(&self) -> Vec<f32>
Cumulative arc length at each waypoint, starting at 0.0.
Sourcepub fn max_segment_length(&self) -> f32
pub fn max_segment_length(&self) -> f32
Maximum Euclidean distance between any two consecutive waypoints.
Sourcepub fn max_joint_step(&self) -> f32
pub fn max_joint_step(&self) -> f32
Maximum per-joint deviation (L-inf norm) across any segment.
Sourcepub fn sample(&self, t: f32) -> Option<RobotQ>
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.
Sourcepub fn densify(&self, max_dist: f32) -> Self
pub fn densify(&self, max_dist: f32) -> Self
Subdivide every segment so that no segment exceeds max_dist.
Sourcepub fn simplify(&self, tol: f32) -> Self
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).
Sourcepub fn map_waypoints(&self, f: impl Fn(&RobotQ) -> RobotQ) -> Self
pub fn map_waypoints(&self, f: impl Fn(&RobotQ) -> RobotQ) -> Self
Apply a function to every waypoint.
Trait Implementations§
Source§impl<'a> IntoIterator for &'a RobotPath
impl<'a> IntoIterator for &'a RobotPath
Auto Trait Implementations§
impl Freeze for RobotPath
impl RefUnwindSafe for RobotPath
impl Send for RobotPath
impl Sync for RobotPath
impl Unpin for RobotPath
impl UnsafeUnpin for RobotPath
impl UnwindSafe for RobotPath
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