Skip to main content

PRM

Struct PRM 

Source
pub struct PRM<S: State, SP: StateSpace<StateType = S>, G: Goal<S>> {
    pub timeout: f64,
    pub connection_radius: f64,
    /* private fields */
}
Expand description

An implementation of the Probabilistic Roadmap (PRM) algorithm.

PRM is a multi-query, sampling-based algorithm that is particularly effective in static environments. It works by first constructing a “roadmap” graph of valid states and then querying this graph to find paths.

§Algorithm Overview

  1. Construction Phase: a. Sample a number of states randomly from the state space. b. For each valid sample, find all nearby nodes already in the roadmap. c. If a valid, collision-free motion exists between the new sample and a neighbor, add an edge connecting them in the roadmap.
  2. Query Phase: a. Connect the start and goal states to the roadmap. b. Use a graph search algorithm (in this case, Breadth-First Search) to find a path on the roadmap from the start to the goal.

Fields§

§timeout: f64

The time allocated for roadmap construction, in seconds.

§connection_radius: f64

The radius within which to search for neighbors to connect to a new sample.

Implementations§

Source§

impl<S, SP, G> PRM<S, SP, G>
where S: State + Clone, SP: StateSpace<StateType = S>, G: Goal<S>,

Source

pub fn new(timeout: f64, connection_radius: f64, config: &PlannerConfig) -> Self

Creates a new PRM planner with the specified parameters.

§Parameters
  • timeout - The time in seconds to spend building the roadmap.
  • connection_radius - The radius for connecting new nodes to the roadmap.
  • config - The planner configuration, for planner-specific parameters.
Source

pub fn get_roadmap(&self) -> Vec<Node<S>>

Get private variable roadmap as a clone. TODO: Determine if this needs to be obtainable.

Source

pub fn set_problem_definition(&mut self, pd: Arc<ProblemDefinition<S, SP, G>>)

Update ProblemDefinition. This is so that you can use an already sampled roadmap but just change the start and goal states.

Source

pub fn construct_roadmap(&mut self) -> Result<(), PlanningError>

Constructs the probabilistic roadmap.

This method populates the roadmap by sampling states and connecting them until the specified timeout is reached.

Trait Implementations§

Source§

impl<S, SP, G> Planner<S, SP, G> for PRM<S, SP, G>
where S: State + Clone, SP: StateSpace<StateType = S>, G: Goal<S> + GoalSampleableRegion<S>,

Source§

fn setup( &mut self, problem_def: Arc<ProblemDefinition<S, SP, G>>, validity_checker: Arc<dyn StateValidityChecker<S>>, )

Configures the planner for a specific motion planning problem. Read more
Source§

fn solve(&mut self, timeout: Duration) -> Result<Path<S>, PlanningError>

Attempt to find a solution to the planning problem. Read more

Auto Trait Implementations§

§

impl<S, SP, G> !RefUnwindSafe for PRM<S, SP, G>

§

impl<S, SP, G> !Send for PRM<S, SP, G>

§

impl<S, SP, G> !Sync for PRM<S, SP, G>

§

impl<S, SP, G> !UnwindSafe for PRM<S, SP, G>

§

impl<S, SP, G> Freeze for PRM<S, SP, G>

§

impl<S, SP, G> Unpin for PRM<S, SP, G>
where S: Unpin,

§

impl<S, SP, G> UnsafeUnpin for PRM<S, SP, G>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V