smp::rrtstar< typeparams > Class Template Reference

RRT* algorithm. More...

#include <rrtstar.h>

Inheritance diagram for smp::rrtstar< typeparams >:
smp::planner_incremental< typeparams > smp::planner< typeparams >

List of all members.

Public Member Functions

 rrtstar (sampler_t &sampler_in, distance_evaluator_t &distance_evaluator_in, extender_t &extender_in, collision_checker_t &collision_checker_in, model_checker_t &model_checker_in, cost_evaluator_t &cost_evaluator_in)
 A constructor that initializes all components.
int initialize (state_t *initial_state_in=0)
 A function call to initialize the incremental sampling-based planner.
double get_ball_radius_last ()
 Returns the radius of the ball that the connections are sought within.
int iteration ()
 Initiate one iteration of the RRT* algorithm.
Component initializer functions
int init_cost_evaluator (cost_evaluator_t &cost_evaluator_in)
 Initializes the cost evaluator component.

Public Attributes

parameters_t parameters
 Algorithm parameters.

Protected Member Functions

int propagate_cost (vertex_t *vertex_in, double total_cost_new)
 A function call the propagate the new cost down the edges of the tree structure.

Protected Attributes

Components
cost_evaluator_tcost_evaluator
 A pointer to the cost evaluator component.

Detailed Description


Constructor & Destructor Documentation

template<class typeparams >
smp::rrtstar< typeparams >::rrtstar ( sampler_t sampler_in,
distance_evaluator_t distance_evaluator_in,
extender_t extender_in,
collision_checker_t collision_checker_in,
model_checker_t model_checker_in,
cost_evaluator_t cost_evaluator_in 
)

A constructor that initializes all components.

This is the recommended constructor that initializes all components all at once. It calls the corresponding constructor of the base class planner_incremental<typeparams> with its first five arguments. The last argument, i.e., cost_evaluator_in, is the new cost evaluator component, a reference to which is stored in this class (not the base class planner_incremental<typeparams>).

Parameters:
sampler_inNew sampler component.
distance_evaluator_inNew distance evaluator component.
extender_inNew extension function component.
collision_checker_inNew collision checker component.
model_checker_inNew model checker component.
cost_evaluator_inNew cost evaluator component.

Member Function Documentation

template<class typeparams >
double smp::rrtstar< typeparams >::get_ball_radius_last ( ) [inline]

Returns the radius of the ball that the connections are sought within.

Returns:
Returns the radius of the ball that the connections are sought within.
template<class typeparams >
int smp::rrtstar< typeparams >::init_cost_evaluator ( cost_evaluator_t cost_evaluator_in)

Initializes the cost evaluator component.

Parameters:
cost_evaluator_inThe cost evalutor component.
Returns:
Returns 1 for success, a non-positive number for failure (see the source code for failure modes).
template<class typeparams >
int smp::rrtstar< typeparams >::initialize ( state_t *  initial_state_in = 0)

A function call to initialize the incremental sampling-based planner.

First it calls the planner_incremental::itinialize function, which deletes the current graph stored by the planner, and If the initial_state_in argument is non-NULL, creates a new vertex that with the state stored in the initial_state_in argument. x *

Parameters:
initial_state_inThe state that the root_vertex will include. If this argument is NULL, then no root vertex is created (But, the graph stored in the planner is deleted.
Returns:
Returns 1 for success, and a non-positive number for failure.

Reimplemented from smp::planner_incremental< typeparams >.

template<class typeparams >
int smp::rrtstar< typeparams >::iteration ( ) [virtual]

Initiate one iteration of the RRT* algorithm.

Runs one iteration of the RRT* algorithm which includes the following steps:

  • get one sample state (using the sampler component)
  • find the vertex in the graph that is nearest to the sample state (using the distance evaluator component)
  • generate a trajectory that starts from the state stored in the nearest vertex and reaches exactly or approximately to the sample state (using the extension function component)
  • check whether the new trajectory satsifies the conditions for being collision free (using the collision checker component).
  • if the new trajectory is collision free, then
    • set the minimum cost vertex to the nearest vertex and the minimum cost trajectory to the current trajectory.
    • compute the set of near vertices (using the distance evaluator component).
    • for all vertecies in the near set
      • generate a new trajectory from the near vertex to the extended vertex (using the extension function component).
      • if the new trajectory is collision free (check using the collision checker component) and exactly connects the two vertices, then compute the cost of the new trajectory (using the cost evaluator component).
      • if the cost to get to the near node plus the cost of the new trajectory is less than the mininimum cost solution, then
        • set the minimum cost vertex to the current near vertex and set the minimum cost trajectory to the current trajectory.
    • add the new vertex to the graph and add an edge from the min cost vertex to the new vertex connecting them with the minimum cost trajectory.
    • for all vertecies in the near set (// rewiring step)
      • generate a new trajectory from the extended vertex to the near vertex (using the extension function component).
      • if the new trajectory is collision free (check using the collision checker component) and exactly connects the two vertices, then add the new trajectory to the graph as an edge from the extended vertex to the near vertex.
      • incrementally check whether the graph includes a trajectory that satisfies the termination requirement (using the model checker component).
Returns:
Returns 1 for success, and a non-positive number for failure.

Implements smp::planner_incremental< typeparams >.

template<class typeparams >
int smp::rrtstar< typeparams >::propagate_cost ( vertex_t vertex_in,
double  total_cost_new 
) [protected]

A function call the propagate the new cost down the edges of the tree structure.

Modifies the cost of the vertex stored in the vertex_in argument to the cost stored in the total_cost_new argument. And propagates the new cost along the outgoing edges of vertex_in.

Parameters:
vertex_inThe vertex the cost of which will be modified.
total_cost_newThe new cost of the vertex_in variable.
Returns:
Returns 1 for success, and a non-positive number for failure.

Member Data Documentation

template<class typeparams >
cost_evaluator_t& smp::rrtstar< typeparams >::cost_evaluator [protected]

A pointer to the cost evaluator component.

The cost evaluator component evaluates the cost of a given trajectory.

template<class typeparams >
parameters_t smp::rrtstar< typeparams >::parameters

Algorithm parameters.

This class stores the parameters used by the algorithm. These parameters can be modified by the user using the methods provided by the class planner_parameters.


The documentation for this class was generated from the following file: