Skip to main content

SRobotTraj

Struct SRobotTraj 

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

Source

pub fn new(dt: Duration, path: SRobotPath<N, T>) -> Self

Source

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

Source

pub fn dt(&self) -> Duration

Source

pub fn set_dt(&mut self, dt: Duration)

Source

pub fn path(&self) -> &SRobotPath<N, T>

Source

pub fn path_mut(&mut self) -> &mut SRobotPath<N, T>

Source

pub fn into_path(self) -> SRobotPath<N, T>

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn dof(&self) -> usize

Source

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

Source

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

Source

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

Source

pub fn duration(&self) -> Duration

Source

pub fn time_at(&self, index: usize) -> Duration

Source

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

Source

pub fn iter_timed( &self, ) -> impl Iterator<Item = (Duration, &SRobotQ<N, T>)> + '_

Source

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.

Source

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.

Source

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

Finite-difference acceleration at sample index i, in joint-units per second^2.

Source

pub fn max_joint_velocity(&self) -> T

Source

pub fn max_joint_acceleration(&self) -> T

Source

pub fn reverse(&mut self)

Reverses the trajectory in place (swaps start and end, preserves dt).

Source

pub fn reversed(&self) -> Self

Source

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.

Source

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>

Source§

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>

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl<const N: usize, T: Debug + Float> Debug for SRobotTraj<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<SRobotTraj<N, T>> for RobotTraj<T>

Source§

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>

Source§

fn from(traj: SRobotTraj<N, T>) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize, T: Float> Index<usize> for SRobotTraj<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<'a, const N: usize, T: Float> IntoIterator for &'a SRobotTraj<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> TryFrom<RobotTraj<T>> for SRobotTraj<N, T>

Source§

type Error = DekeError

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

fn try_from(traj: RobotTraj<T>) -> Result<Self, Self::Error>

Performs the conversion.

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