Generic sampling-based motion planner. More...
#include <base.h>
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_t & | sampler |
A pointer to the sampler component. | |
distance_evaluator_t & | distance_evaluator |
A pointer to the distance evaluator component. | |
extender_t & | extender |
A pointer to the extension function component. | |
collision_checker_t & | collision_checker |
A pointer to the collision checker component. | |
model_checker_t & | model_checker |
A pointer to the model checker component. |
Generic sampling-based motion planner.
The generic sampling-based motion planner encapsulates the following five components of a sampling-bsed motion planning algorithm
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.
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.
sampler_in | The sampler component |
distance_evaluator_in | The distance evaluation component |
extender_in | The extension function component |
collision_checker_in | The collision checker component |
model_checker_in | The model checker component |
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.
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.
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.
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.
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.
edge_in | Edge that will be deleted. |
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.
vertex_in | Vertex that will be deleted. |
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
int smp::planner< typeparams >::init_collision_checker | ( | collision_checker_t & | collision_checker_in | ) |
An initializer function for the collision checker component.
collision_checker_in | The collision checker component. |
int smp::planner< typeparams >::init_distance_evaluator | ( | distance_evaluator_t & | distance_evaluator_in | ) |
An initializer function for the distance evaluator component.
distance_evaluator_in | The distance evaluator component |
int smp::planner< typeparams >::init_extender | ( | extender_t & | extender_in | ) |
An initializer function for the extension function component.
extender_in | The extension function component. |
int smp::planner< typeparams >::init_model_checker | ( | model_checker_t & | model_checker_in | ) |
An initializer function for the model checker component.
model_checker_in | The model checker component. |
int smp::planner< typeparams >::init_sampler | ( | sampler_t & | sampler_in | ) |
An initializer function for the sampler component.
sampler_in | The sampler component. |
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.
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.
vertex_src_in | Source vertex. |
edge_in | New edge from the source vertex to the destination vertex. |
vertex_dst_in | Destination vertex. |
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.
vertex_src_in | The source vertex. |
list_trajectories_in | The list of trajectories extending the source vertex. |
vertex_dst_in | The 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. |
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.
vertex_src_in | The source vertex. |
trajectory_in | The trajectory extending the source vertex. |
intermediate_vertices_in | A 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_in | The 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. |
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.
vertex_in | New vertex. |
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.
edge_update_func_in | A pointer to the function that will be added to the list. |
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.
edge_update_func_in | A pointer to the function that will be added to the list. |
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.
vertex_update_func_in | A pointer to the function that will be added to the list. |
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.
vertex_update_func_in | A pointer to the function that will be added to the list. |
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.
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.
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.
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.
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.
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.