Trajectory

Trait Trajectory 

Source
pub trait Trajectory<X, const N: usize>: Clone {
    // Required methods
    fn cost(&self) -> Option<X>;
    fn calc_cost<S1, S2>(
        &self,
        start: &Vector<X, Const<N>, S1>,
        end: &Vector<X, Const<N>, S2>,
    ) -> X
       where S1: Storage<X, Const<N>>,
             S2: Storage<X, Const<N>>;
    fn interpolate<S1, S2>(
        &self,
        start: &Vector<X, Const<N>, S1>,
        end: &Vector<X, Const<N>, S2>,
        t: X,
    ) -> SVector<X, N>
       where S1: Storage<X, Const<N>>,
             S2: Storage<X, Const<N>>;
}
Expand description

The data saved on the edge in the graph need to support the cost and interpolate functions

Required Methods§

Source

fn cost(&self) -> Option<X>

The cached cost to move along the trajectory

Doesn’t required endpoints

Source

fn calc_cost<S1, S2>( &self, start: &Vector<X, Const<N>, S1>, end: &Vector<X, Const<N>, S2>, ) -> X
where S1: Storage<X, Const<N>>, S2: Storage<X, Const<N>>,

Calculate the cost from start to end across this trajectory

Start and end points must the same as the ones used when the original trajectory was created to get the sensible output. Implementations are free to panic if start and end points differ.

Source

fn interpolate<S1, S2>( &self, start: &Vector<X, Const<N>, S1>, end: &Vector<X, Const<N>, S2>, t: X, ) -> SVector<X, N>
where S1: Storage<X, Const<N>>, S2: Storage<X, Const<N>>,

Interpolate a coordinate between the start and end points

Start point is assumed to be at t = 0.0 and end point at t = 1.0

Start and end points must the same as the ones used when the original trajectory was created to get the sensible output. Implementations are free to panic if start and end points differ.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<X, NORM, const N: usize> Trajectory<X, N> for LinearTrajectory<X, NORM, N>
where X: SimdRealField, NORM: Norm<X> + Clone,

Source§

impl<X, const N: usize> Trajectory<X, N> for EuclideanTrajectory<X, N>
where X: SimdRealField,