pub trait PathPlanner<X, CS, OS, const N: usize>: Sized{
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§
Sourcefn new(
init: SVector<X, N>,
goal: SVector<X, N>,
robot_specs: RobotSpecs<X>,
cspace: CS,
obs_space: OS,
params: Self::Params,
) -> Result<Self>
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.
Sourcefn create_node(&mut self) -> &Self::State
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
Sourcefn sample_node(&mut self) -> Option<&Self::State>
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
Sourcefn check_sensors(&mut self)
fn check_sensors(&mut self)
Checks the sensor on the robot for obstacles updates within robot_specs.sensor_range
Sourcefn get_obs_space(&self) -> &OS
fn get_obs_space(&self) -> &OS
Returns reference to the currently used obstacle space
Sourcefn get_obs_space_mut(&mut self) -> &mut OS
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
Sourcefn get_cspace(&self) -> &CS
fn get_cspace(&self) -> &CS
Returns reference to the currently used cspace
Sourcefn get_cspace_mut(&mut self) -> &mut CS
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
Sourcefn check_nodes(&mut self, obs_space: bool, cspace: bool)
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
Sourcefn update_pose(
&mut self,
pose: SVector<X, N>,
nearest: bool,
) -> Option<MoveGoal<X, N>>
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
Sourcefn get_tree(&self) -> Vec<FullTrajRefOwned<'_, X, CS::Traj, N>> ⓘ
fn get_tree(&self) -> Vec<FullTrajRefOwned<'_, X, CS::Traj, N>> ⓘ
Get the search tree as a list of edges
Sourcefn get_current_path(&self) -> Option<FullTrajOwned<X, CS::Traj, N>>
fn get_current_path(&self) -> Option<FullTrajOwned<X, CS::Traj, N>>
Returns Some trajectory the next move goal if the global goal is reachable
Sourcefn get_path_to_goal(&self) -> Option<Vec<SVector<X, N>>>
fn get_path_to_goal(&self) -> Option<Vec<SVector<X, N>>>
Returns Some path to the goal if the global goal is reachable
Sourcefn get_last_pose(&self) -> &SVector<X, N>
fn get_last_pose(&self) -> &SVector<X, N>
Get the last known pose of the system
Provided Methods§
Sourcefn get_cost_to_goal(&self) -> Option<X>
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
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.