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§
Sourcefn cost(&self) -> Option<X>
fn cost(&self) -> Option<X>
The cached cost to move along the trajectory
Doesn’t required endpoints
Sourcefn calc_cost<S1, S2>(
&self,
start: &Vector<X, Const<N>, S1>,
end: &Vector<X, Const<N>, S2>,
) -> X
fn calc_cost<S1, S2>( &self, start: &Vector<X, Const<N>, S1>, end: &Vector<X, Const<N>, S2>, ) -> X
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.
Sourcefn interpolate<S1, S2>(
&self,
start: &Vector<X, Const<N>, S1>,
end: &Vector<X, Const<N>, S2>,
t: X,
) -> SVector<X, N>
fn interpolate<S1, S2>( &self, start: &Vector<X, Const<N>, S1>, end: &Vector<X, Const<N>, S2>, t: X, ) -> SVector<X, 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.