CSpace

Trait CSpace 

Source
pub trait CSpace<X, const N: usize>: FromParams + Sized {
    type Traj: Trajectory<X, N>;

    // Required methods
    fn volume(&self) -> X;
    fn cost<R1, R2, S1, S2>(
        &self,
        start: &Vector<X, R1, S1>,
        end: &Vector<X, R2, S2>,
    ) -> X
       where X: SimdRealField,
             R1: Dim,
             R2: Dim,
             S1: Storage<X, R1>,
             S2: Storage<X, R2>,
             ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfRows<R1, Const<N>> + SameNumberOfRows<R2, Const<N>>;
    fn trajectory<S1, S2>(
        &self,
        start: Vector<X, Const<N>, S1>,
        end: Vector<X, Const<N>, S2>,
    ) -> Option<FullTraj<X, Self::Traj, S1, S2, N>>
       where X: Scalar,
             S1: Storage<X, Const<N>>,
             S2: Storage<X, Const<N>>;
    fn is_free<S>(&self, state: &Vector<X, Const<N>, S>) -> bool
       where S: Storage<X, Const<N>>;
    fn saturate(&self, a: &mut SVector<X, N>, b: &SVector<X, N>, delta: X);
    fn sample(&mut self) -> SVector<X, N>;
}
Expand description

A generic configuration space for sampling-based problems

Descibes the state space of the system that a path is being planned for

Required Associated Types§

Required Methods§

Source

fn volume(&self) -> X

An overestimate of the volume of the space (should remain constant)

Source

fn cost<R1, R2, S1, S2>( &self, start: &Vector<X, R1, S1>, end: &Vector<X, R2, S2>, ) -> X
where X: SimdRealField, R1: Dim, R2: Dim, S1: Storage<X, R1>, S2: Storage<X, R2>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfRows<R1, Const<N>> + SameNumberOfRows<R2, Const<N>>,

Cost function between two arbitrary points within the space Always returns a value

Must satisfy the triangle inequality

Source

fn trajectory<S1, S2>( &self, start: Vector<X, Const<N>, S1>, end: Vector<X, Const<N>, S2>, ) -> Option<FullTraj<X, Self::Traj, S1, S2, N>>
where X: Scalar, S1: Storage<X, Const<N>>, S2: Storage<X, Const<N>>,

Calculate the trajectory data between the given start and end points for the system

Returns None if trajectory isn’t possible due to system dynamics

Source

fn is_free<S>(&self, state: &Vector<X, Const<N>, S>) -> bool
where S: Storage<X, Const<N>>,

Determines if the given point is a valid state in the space

Source

fn saturate(&self, a: &mut SVector<X, N>, b: &SVector<X, N>, delta: X)

Modify a such that the cost from a -> b is no more than delta away while moving a as little as possible

Source

fn sample(&mut self) -> SVector<X, N>

Sample a point in the configuration space

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> CSpace<X, N> for LeaderFollowerPolarSpace<X>
where X: Scalar + SampleUniform,

Source§

impl<X> CSpace<X, N> for LeaderFollowerSphericalSpace<X>
where X: Scalar + SampleUniform,

Source§

impl<X, const D: usize, const N: usize> CSpace<X, N> for LeaderFollowerSpace<X, D, N>

Source§

type Traj = LinearTrajectory<X, NormCost, N>

Source§

impl<X, const N: usize> CSpace<X, N> for EuclideanSpace<X, N>
where X: Scalar + SampleUniform,

Source§

impl<X, const N: usize> CSpace<X, N> for LinearSpace<X, N>
where X: Scalar + SampleUniform,

Source§

type Traj = LinearTrajectory<X, NormCost, N>