smp::planner< typeparams > Class Template Reference

Generic sampling-based motion planner. More...

#include <base.h>

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

List of all members.

Public Member Functions

 planner (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)
 A constructor that can initialize all the components.
int get_num_vertices ()
 Returns the number of vertices currently present in the graph maintained by the planner algorithm.
Vertex and edge handlers
int insert_vertex (vertex_t *vertex_in)
 A function call to insert an edge into the graph.
int insert_edge (vertex_t *vertex_src_in, edge_t *edge_in, vertex_t *vertex_dst_in)
 A function call to insert an edge into the graph.
int delete_vertex (vertex_t *vertex_in)
 A function call to delete a vertex from the graph.
int delete_edge (edge_t *edge_in)
 A function call to delete an edge from the graph.
Trajectory handlers
int insert_trajectory (vertex_t *vertex_src_in, trajectory_t *trajectory_in, list< state_t * > *intermediate_vertices_in, vertex_t *vertex_dst_in=0)
 Inserts a trajectory into the graph.
int insert_trajectories (vertex_t *vertex_src_in, list< trajectory_t * > *list_trajectories_in, vertex_t *vertex_dst_in=0)
 Inserts a list of trajectories into the graph.
Component initializer functions
int init_sampler (sampler_t &sampler_in)
 An initializer function for the sampler component.
int init_distance_evaluator (distance_evaluator_t &distance_evaluator_in)
 An initializer function for the distance evaluator component.
int init_extender (extender_t &extender_in)
 An initializer function for the extension function component.
int init_collision_checker (collision_checker_t &collision_checker_in)
 An initializer function for the collision checker component.
int init_model_checker (model_checker_t &model_checker_in)
 An initializer function for the model checker component.
Update function handlers
int clear_update_function_list_vertex_insert ()
 Clears the update function list for vertex insertion.
int register_new_update_function_vertex_insert (vertex_update_func_t *vertex_update_func_in)
 Adds a new function to the list of update functions for vertex insertion.
int clear_update_function_list_vertex_delete ()
 Clears the update function list for vertex deletion.
int register_new_update_function_vertex_delete (vertex_update_func_t *vertex_update_func_in)
 Adds a new function to the list of update functions for vertex deletion.
int clear_update_function_list_edge_insert ()
 Clears the update function list for edge insertion.
int register_new_update_function_edge_insert (edge_update_func_t *edge_update_func_in)
 Adds a new function to the list of update functions for edge insertion.
int clear_update_function_list_edge_delete ()
 Clears the update function list for edge deletion.
int register_new_update_function_edge_delete (edge_update_func_t *edge_update_func_in)
 Adds a new function to the list of update functions for edge deletion.

Public Attributes

list< vertex_t * > list_vertices
 A list of all the vertices.

Protected Member Functions

int initialize ()
 An initializer function that deletes the graph.

Protected Attributes

Components
sampler_tsampler
 A pointer to the sampler component.
distance_evaluator_tdistance_evaluator
 A pointer to the distance evaluator component.
extender_textender
 A pointer to the extension function component.
collision_checker_tcollision_checker
 A pointer to the collision checker component.
model_checker_tmodel_checker
 A pointer to the model checker component.

Detailed Description

template<class typeparams>
class smp::planner< typeparams >

Generic sampling-based motion planner.

The generic sampling-based motion planner encapsulates the following five components of a sampling-bsed motion planning algorithm

  • a sampler,
  • a distance evaluator
  • an extender
  • a collision checker
  • a model checker
Examples:

libbot_rrg_double_integrator.cpp, libbot_rrg_dubins_car.cpp, libbot_rrg_dubins_double_integrator_airplane.cpp, libbot_rrg_single_integrator.cpp, libbot_rrg_single_integrator_mu_calculus.cpp, libbot_rrt_double_integrator.cpp, libbot_rrt_dubins_car.cpp, libbot_rrt_dubins_double_integrator_airplane.cpp, libbot_rrt_single_integrator.cpp, libbot_rrtstar_double_integrator.cpp, libbot_rrtstar_dubins_car.cpp, libbot_rrtstar_dubins_double_integrator_airplane.cpp, libbot_rrtstar_single_integrator.cpp, libbot_rrtstar_single_integrator_halton.cpp, libbot_rrtstar_single_integrator_trajectory_biasing.cpp, libbot_rrtstar_single_integrator_trajectory_biasing_and_bnb.cpp, standalone_rrg_double_integrator.cpp, standalone_rrg_dubins_car.cpp, standalone_rrg_dubins_double_integrator_airplane.cpp, standalone_rrg_single_integrator.cpp, standalone_rrg_single_integrator_mu_calculus.cpp, standalone_rrt_double_integrator.cpp, standalone_rrt_dubins_car.cpp, standalone_rrt_dubins_double_integrator_airplane.cpp, standalone_rrt_single_integrator.cpp, standalone_rrtstar_double_integrator.cpp, standalone_rrtstar_dubins_car.cpp, standalone_rrtstar_dubins_double_integrator_airplane.cpp, standalone_rrtstar_single_integrator.cpp, standalone_rrtstar_single_integrator_halton.cpp, standalone_rrtstar_single_integrator_trajectory_biasing.cpp, and standalone_rrtstar_single_integrator_trajectory_biasing_and_bnb.cpp.


Constructor & Destructor Documentation

template<class typeparams >
smp::planner< typeparams >::planner ( 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 
)

A constructor that can initialize all the components.

Parameters:
sampler_inThe sampler component
distance_evaluator_inThe distance evaluation component
extender_inThe extension function component
collision_checker_inThe collision checker component
model_checker_inThe model checker component

Member Function Documentation

template<class typeparams >
int smp::planner< typeparams >::clear_update_function_list_edge_delete ( )

Clears the update function list for edge deletion.

This function will empty the list of functions that will be called whenever an edge is deleted from the graph.

Returns:
Returns 1 for success, and a non-positive number to indicate error.
template<class typeparams >
int smp::planner< typeparams >::clear_update_function_list_edge_insert ( )

Clears the update function list for edge insertion.

This function will empty the list of functions that will be called whenever a new edge is inserted into the graph.

Returns:
Returns 1 for success, and a non-positive number to indicate error.
template<class typeparams >
int smp::planner< typeparams >::clear_update_function_list_vertex_delete ( )

Clears the update function list for vertex deletion.

This function will empty the list of functions that will be called whenever a vertex is deleted from the graph.

Returns:
Returns 1 for success, and a non-positive number to indicate error.
template<class typeparams >
int smp::planner< typeparams >::clear_update_function_list_vertex_insert ( )

Clears the update function list for vertex insertion.

This function will empty the list of functions that will be called whenever a new vertex is inserted into the graph.

Returns:
Returns 1 for success, and a non-positive number to indicate error.
template<class typeparams >
int smp::planner< typeparams >::delete_edge ( edge_t edge_in)

A function call to delete an edge from the graph.

Deletes the input edge from the graph. Calls the update function for all the components, if appropriate.

Parameters:
edge_inEdge that will be deleted.
Returns:
Returns 1 for success, a non-positive number for failure.
template<class typeparams >
int smp::planner< typeparams >::delete_vertex ( vertex_t vertex_in)

A function call to delete a vertex from the graph.

Deletes the input vertex from the graph. Calls the update function for all the components, if appropriate.

Parameters:
vertex_inVertex that will be deleted.
Returns:
Returns 1 for success, a non-positive number for failure.
template<class typeparams >
int smp::planner< typeparams >::get_num_vertices ( ) [inline]

Returns the number of vertices currently present in the graph maintained by the planner algorithm.

The planner<typeparams> class maintains the number of vertices currently present in the graph. Calling this method to get the number of vertices present in the graph is usually much faster than directly querying the planner<typeparams>::list_vertices variable

Returns:
Returns the number of vertices present in the graph
template<class typeparams >
int smp::planner< typeparams >::init_collision_checker ( collision_checker_t collision_checker_in)

An initializer function for the collision checker component.

Parameters:
collision_checker_inThe collision checker component.
Returns:
Returns 1 for success, a non-positive number for failure (see the source code for failure modes).
Examples:
libbot_rrt_dubins_car.cpp, and standalone_rrt_dubins_car.cpp.
template<class typeparams >
int smp::planner< typeparams >::init_distance_evaluator ( distance_evaluator_t distance_evaluator_in)

An initializer function for the distance evaluator component.

Parameters:
distance_evaluator_inThe distance evaluator component
Returns:
Returns 1 for success, a non-positive number for failure (see the source code for failure modes)
template<class typeparams >
int smp::planner< typeparams >::init_extender ( extender_t extender_in)

An initializer function for the extension function component.

Parameters:
extender_inThe extension function component.
Returns:
Returns 1 for success, a non-positive number for failure (see the source code for failure modes).
template<class typeparams >
int smp::planner< typeparams >::init_model_checker ( model_checker_t model_checker_in)

An initializer function for the model checker component.

Parameters:
model_checker_inThe model checker component.
Returns:
Returns 1 for success, a non-positive number for failure (see the source code for failure modes).
Examples:
libbot_rrg_dubins_car.cpp, and standalone_rrg_dubins_car.cpp.
template<class typeparams >
int smp::planner< typeparams >::init_sampler ( sampler_t sampler_in)

An initializer function for the sampler component.

Parameters:
sampler_inThe sampler component.
Returns:
Returns 1 for success, a non-positive number for failure (see the source code for failure modes).
template<class typeparams >
int smp::planner< typeparams >::initialize ( ) [protected]

An initializer function that deletes the graph.

This function deletes all the vertices and edges, empties the list of vertices. That is, it deletes all vertices in list_vertices, and clears the list.

Returns:
Returns 1 for success, a non-positive number for failure.
Examples:
libbot_rrg_double_integrator.cpp, libbot_rrg_dubins_car.cpp, libbot_rrg_dubins_double_integrator_airplane.cpp, libbot_rrg_single_integrator.cpp, libbot_rrg_single_integrator_mu_calculus.cpp, libbot_rrt_double_integrator.cpp, libbot_rrt_dubins_car.cpp, libbot_rrt_dubins_double_integrator_airplane.cpp, libbot_rrt_single_integrator.cpp, libbot_rrtstar_double_integrator.cpp, libbot_rrtstar_dubins_car.cpp, libbot_rrtstar_dubins_double_integrator_airplane.cpp, libbot_rrtstar_single_integrator.cpp, libbot_rrtstar_single_integrator_halton.cpp, libbot_rrtstar_single_integrator_trajectory_biasing.cpp, libbot_rrtstar_single_integrator_trajectory_biasing_and_bnb.cpp, standalone_rrg_double_integrator.cpp, standalone_rrg_dubins_car.cpp, standalone_rrg_dubins_double_integrator_airplane.cpp, standalone_rrg_single_integrator.cpp, standalone_rrg_single_integrator_mu_calculus.cpp, standalone_rrt_double_integrator.cpp, standalone_rrt_dubins_car.cpp, standalone_rrt_dubins_double_integrator_airplane.cpp, standalone_rrt_single_integrator.cpp, standalone_rrtstar_double_integrator.cpp, standalone_rrtstar_dubins_car.cpp, standalone_rrtstar_dubins_double_integrator_airplane.cpp, standalone_rrtstar_single_integrator.cpp, standalone_rrtstar_single_integrator_halton.cpp, standalone_rrtstar_single_integrator_trajectory_biasing.cpp, and standalone_rrtstar_single_integrator_trajectory_biasing_and_bnb.cpp.
template<class typeparams >
int smp::planner< typeparams >::insert_edge ( vertex_t vertex_src_in,
edge_t edge_in,
vertex_t vertex_dst_in 
)

A function call to insert an edge into the graph.

Inserts the given edge, stored in the edge_in argument, between the two vertices stored in the variables vertex_src_in and vertex_dst_in. Calls the update function for all the components, if appropriate.

Parameters:
vertex_src_inSource vertex.
edge_inNew edge from the source vertex to the destination vertex.
vertex_dst_inDestination vertex.
Returns:
Returns 1 for success, a non-positive number for failure.
template<class typeparams >
int smp::planner< typeparams >::insert_trajectories ( vertex_t vertex_src_in,
list< trajectory_t * > *  list_trajectories_in,
vertex_t vertex_dst_in = 0 
)

Inserts a list of trajectories into the graph.

Inserts a list of trajectories into the graph such that each trajectory is a new edge connecting a sequence of vertices starting from the vertex stored in the vertex_src_in argument. If the vertex_dst_in argument is non-NULL, then the final vertex is the vertex stored in the vertex_dst_in argument. The final state of each trajectory is made the state of a new vertex that is added to the graph. The consecutive edges in the list list_trajectories_in are connected as a chain in the same order.

Parameters:
vertex_src_inThe source vertex.
list_trajectories_inThe list of trajectories extending the source vertex.
vertex_dst_inThe destination vertex. If set to NULL, then a new destination vertex is created by this function. The state for this vertex is the final state in the final trajectory stored in the list_trajectories_in argument.
Returns:
Returns 1 for success, a non-positive number for failure.
template<class typeparams >
int smp::planner< typeparams >::insert_trajectory ( vertex_t vertex_src_in,
trajectory_t trajectory_in,
list< state_t * > *  intermediate_vertices_in,
vertex_t vertex_dst_in = 0 
)

Inserts a trajectory into the graph.

Inserts a new trajectory into the graph. The new trajectory is added to the graph either as and edge between two vertices stored in the variables vertex_src_in and vertex_dst_in, or as an edge between vertex_src_in and a new vertex created by this function. The latter case will be invoked if vertex_dst_in argument is set to NULL by the caller. The caller can also specify a designated set of states that will become an individual vertex in the graph. This set of states is given as a list in the intermediate_vertices_in argument.

Parameters:
vertex_src_inThe source vertex.
trajectory_inThe trajectory extending the source vertex.
intermediate_vertices_inA list of states that are all present in the trajectory_in argument, and represent those states that should become individual vertices in the graph.
vertex_dst_inThe destination vertex. If set to NULL, then a new destination vertex is created by this function. The state for this vertex is the final state in the trajectory stored in the trajectory_in argument.
Returns:
Returns 1 for success, a non-positive number for failure.
template<class typeparams >
int smp::planner< typeparams >::insert_vertex ( vertex_t vertex_in)

A function call to insert an edge into the graph.

Inserts the given vertex to the graph. It will insert the vertex into list_vertices. Calls the update function for all the components, if appropriate.

Parameters:
vertex_inNew vertex.
Returns:
Returns 1 for success, a non-positive number for failure.
template<class typeparams >
int smp::planner< typeparams >::register_new_update_function_edge_delete ( edge_update_func_t *  edge_update_func_in)

Adds a new function to the list of update functions for edge deletion.

This function will add its argument to the list of functions that will be called whenever an edge is deleted from the graph.

Parameters:
edge_update_func_inA pointer to the function that will be added to the list.
Returns:
Returns 1 for success, and a non-positive number to indicate error.
template<class typeparams >
int smp::planner< typeparams >::register_new_update_function_edge_insert ( edge_update_func_t *  edge_update_func_in)

Adds a new function to the list of update functions for edge insertion.

This function will add its argument to the list of functions that will be called whenever a new edge is inserted into the graph.

Parameters:
edge_update_func_inA pointer to the function that will be added to the list.
Returns:
Returns 1 for success, and a non-positive number to indicate error.
template<class typeparams >
int smp::planner< typeparams >::register_new_update_function_vertex_delete ( vertex_update_func_t *  vertex_update_func_in)

Adds a new function to the list of update functions for vertex deletion.

This function will add its argument to the list of functions that will be called whenever a vertex is deleted from the graph.

Parameters:
vertex_update_func_inA pointer to the function that will be added to the list.
Returns:
Returns 1 for success, and a non-positive number to indicate error.
template<class typeparams >
int smp::planner< typeparams >::register_new_update_function_vertex_insert ( vertex_update_func_t *  vertex_update_func_in)

Adds a new function to the list of update functions for vertex insertion.

This function will add its argument to the list of functions that will be called whenever a new vertex is inserted into the graph.

Parameters:
vertex_update_func_inA pointer to the function that will be added to the list.
Returns:
Returns 1 for success, and a non-positive number to indicate error.

Member Data Documentation

template<class typeparams >
collision_checker_t& smp::planner< typeparams >::collision_checker [protected]

A pointer to the collision checker component.

The collision checker component checks whether a given state or a given trajectory is appropriate for being included in the graph.

template<class typeparams >
distance_evaluator_t& smp::planner< typeparams >::distance_evaluator [protected]

A pointer to the distance evaluator component.

The distance evaluator is used for evaluating either the nearest neighbor of a given state, or the set of near nodes. The set of near nodes is computed as either the set of all states that lie within a ball of given radius centered at the given state or the set of all nodes that are the k-nearest neighbors of a given state for some given number k.

template<class typeparams >
extender_t& smp::planner< typeparams >::extender [protected]

A pointer to the extension function component.

The extender component is used for finding a trajectory that connects (either exactly or approximately) two given states.

template<class typeparams >
list< vertex_t* > smp::planner< typeparams >::list_vertices

A list of all the vertices.

This variable stores the list of vertices of the graph that is maintained by planning algorithm. A new vertex is added to the list of vertices using the insert_vertex function and an existing vertex is removed using the delete_vertex function.

template<class typeparams >
model_checker_t& smp::planner< typeparams >::model_checker [protected]

A pointer to the model checker component.

The model checker decides whether or not there exists a trajectory in the graph that solves the problem, e.g., reaches the goal region. In some problems, the problem specification can be much more general than merely reaching the goal region. The model checker component provides this generality while preserving simplicity.

template<class typeparams >
sampler_t& smp::planner< typeparams >::sampler [protected]

A pointer to the sampler component.

The sampler component provides random (or quasi-random) states to the planning function.


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