PathPlanner

Trait PathPlanner 

Source
pub trait PathPlanner<X, CS, OS, const N: usize>: Sized
where X: Scalar, CS: CSpace<X, N>, OS: ObstacleSpace<X, CS, N>,
{ type Params: Clone; type State: Clone;
Show 19 methods // Required methods fn new( init: SVector<X, N>, goal: SVector<X, N>, robot_specs: RobotSpecs<X>, cspace: CS, obs_space: OS, params: Self::Params, ) -> Result<Self>; fn create_node(&mut self) -> &Self::State; fn sample_node(&mut self) -> Option<&Self::State>; fn check_sensors(&mut self); fn get_obs_space(&self) -> &OS; fn get_obs_space_mut(&mut self) -> &mut OS; fn get_cspace(&self) -> &CS; fn get_cspace_mut(&mut self) -> &mut CS; fn check_nodes(&mut self, obs_space: bool, cspace: bool); fn update_pose( &mut self, pose: SVector<X, N>, nearest: bool, ) -> Option<MoveGoal<X, N>>; fn get_tree(&self) -> Vec<FullTrajRefOwned<'_, X, CS::Traj, N>> ; fn get_current_path(&self) -> Option<FullTrajOwned<X, CS::Traj, N>>; fn get_path_to_goal(&self) -> Option<Vec<SVector<X, N>>>; fn get_last_pose(&self) -> &SVector<X, N>; fn get_state(&self) -> &Self::State; fn get_goal(&self) -> &SVector<X, N>; fn count(&self) -> usize; // Provided methods fn get_cost_to_goal(&self) -> Option<X> { ... } fn get_cost_to_move_goal(&self) -> Option<X> { ... }
}
Expand description

A sampling-based path path_planner

Required Associated Types§

Required Methods§

Source

fn new( init: SVector<X, N>, goal: SVector<X, N>, robot_specs: RobotSpecs<X>, cspace: CS, obs_space: OS, params: Self::Params, ) -> Result<Self>

Define a new Path Planner with an initial set of obstacles in the space.

init: The inital pose, must be in free space.

goal: The goal pose, must be in free space, the root of the search tree.

robot_specs: Information about the robot sizing.

cspace: Describes the constant configuration space to plan within.

obs_space: The obstacle space to plan around.

params: Algorithm specific parameters.

Source

fn create_node(&mut self) -> &Self::State

Samples nodes until one is added to the search graph.

Returns updated state reference once node is successfully added to the graph

Source

fn sample_node(&mut self) -> Option<&Self::State>

Sample once to add a node to the graph

Optionally returns updated state if node was successfully added

Source

fn check_sensors(&mut self)

Checks the sensor on the robot for obstacles updates within robot_specs.sensor_range

Source

fn get_obs_space(&self) -> &OS

Returns reference to the currently used obstacle space

Source

fn get_obs_space_mut(&mut self) -> &mut OS

Returns mutable reference to the currently used obstacle space

Make sure to call Self::check_nodes with obs_space = true if the modifications might make some nodes invalid

Source

fn get_cspace(&self) -> &CS

Returns reference to the currently used cspace

Source

fn get_cspace_mut(&mut self) -> &mut CS

Returns mutable reference to the currently used cspace

Make sure to call Self::check_nodes with cspace = true if the modifications might make some nodes invalid

Source

fn check_nodes(&mut self, obs_space: bool, cspace: bool)

Checks the spaces specified that all nodes are still valid in that space

Make sure to call after modifying the obs_space or cspace such that some nodes might be invalid

Source

fn update_pose( &mut self, pose: SVector<X, N>, nearest: bool, ) -> Option<MoveGoal<X, N>>

Updates the pose of the system, possibly changing the move goal

Returns Some coordinates the next move goal if the global goal is reachable

if nearest is true, will select a move goal that is the closest to the given pose

Specifies wether the returned move goal is new or the same as before

Source

fn get_tree(&self) -> Vec<FullTrajRefOwned<'_, X, CS::Traj, N>>

Get the search tree as a list of edges

Source

fn get_current_path(&self) -> Option<FullTrajOwned<X, CS::Traj, N>>

Returns Some trajectory the next move goal if the global goal is reachable

Source

fn get_path_to_goal(&self) -> Option<Vec<SVector<X, N>>>

Returns Some path to the goal if the global goal is reachable

Source

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

Get the last known pose of the system

Source

fn get_state(&self) -> &Self::State

Get a reference to the current serializable state information

Source

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

Returns the coordinates of the goal node

Source

fn count(&self) -> usize

Returns the number of nodes in the graph plus the initial node (which is technically never added to the graph)

Provided Methods§

Source

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

Returns the total cost to reach the goal from the most recent pose given in update_pose

Source

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

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, CS, OS, const N: usize> PathPlanner<X, CS, OS, N> for Rrt<X, CS, OS, N>
where X: Scalar, CS: CSpace<X, N> + Send + Sync, CS::Traj: Send + Sync, OS: ObstacleSpace<X, CS, N> + Send + Sync, OS::Obs: Send + Sync,

Source§

type Params = RrtParams<X>

Source§

type State = RrtState<X, CS, OS, N>

Source§

impl<X, CS, OS, const N: usize> PathPlanner<X, CS, OS, N> for RrtStar<X, CS, OS, N>
where X: Scalar, CS: CSpace<X, N> + Send + Sync, CS::Traj: Send + Sync, OS: ObstacleSpace<X, CS, N> + Send + Sync, OS::Obs: Send + Sync,

Source§

impl<X, CS, OS, const N: usize> PathPlanner<X, CS, OS, N> for Rrtx<X, CS, OS, N>
where X: Scalar, CS: CSpace<X, N> + Send + Sync, CS::Traj: Send + Sync, OS: ObstacleSpace<X, CS, N> + Send + Sync, OS::Obs: Send + Sync,

Source§

type Params = RrtxParams<X>

Source§

type State = RrtxState<X, CS, OS, N>