smp::collision_checker_standard< typeparams, NUM_DIMENSIONS > Class Template Reference

Standard collision checker. More...

#include <standard.h>

Inheritance diagram for smp::collision_checker_standard< typeparams, NUM_DIMENSIONS >:
smp::collision_checker_base< typeparams >

List of all members.

Public Member Functions

int cc_update_insert_vertex (vertex_t *vertex_in)
 Update function for vertex insertion.
int cc_update_insert_edge (edge_t *edge_in)
 Update function for edge insertion.
int cc_update_delete_vertex (vertex_t *vertex_in)
 Update function for vertex deletion.
int cc_update_delete_edge (edge_t *edge_in)
 Update function for edge insertion.
int check_collision_state (state_t *state_in)
 Checks whether a given state is collision free.
int check_collision_trajectory (trajectory_t *trajectory_in)
 Checks whether a given trajectory is collision free.
int set_discretization_steps (int num_discretization_steps_in)
 Sets the number of discretization steps.
int set_discretization_length (double discretization_length_in)
 Sets the length for the discretization.
int add_obstacle (region_t &obstacle_in)
 Adds a new obstacle to the list of obstacles.

Detailed Description

template<class typeparams, int NUM_DIMENSIONS>
class smp::collision_checker_standard< typeparams, NUM_DIMENSIONS >

Standard collision checker.

This class implements the standard collision checker. Standard collision checking procedure discretizes the trajectories connecting consecutive states. The said trajectory is obtained by a linear interpolation between the said states. Each interpolated state is, then, checked for collisioon with all the obstacles. This procedure is continued for all the states in the trajectory. A single states is checked for collision by merely going through the list of obstacles to check whether the query state resides inside any of the obstacles.

Examples:

libbot_rrg_double_integrator.cpp, libbot_rrg_dubins_car.cpp, libbot_rrg_dubins_double_integrator_airplane.cpp, libbot_rrg_single_integrator.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_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.


Member Function Documentation

template<class typeparams , int NUM_DIMENSIONS>
int smp::collision_checker_standard< typeparams, NUM_DIMENSIONS >::add_obstacle ( region_t obstacle_in)

Adds a new obstacle to the list of obstacles.

This function adds a new obstacle to the list of obstacle, which must be a type of region<NUM_DIMENSIONS>. Note that the NUM_DIMENSIONS template argument of the region and this class must match. Otherwise, compuilation errors will occur.

Parameters:
obstacle_inThe pointer to the new obstacle
Returns:
Returns 1 for success, a non-positive value to indicate error.
template<class typeparams , int NUM_DIMENSIONS>
int smp::collision_checker_standard< typeparams, NUM_DIMENSIONS >::cc_update_delete_edge ( edge_t edge_in) [virtual]

Update function for edge insertion.

This function is called by the planner whenever an edge is delete from the graph. A pointer to the edge is given as an argument.

Parameters:
edge_inA pointer to deleted edge.
Returns:
Return 1 for success, a non-positive value to indiacate error.

Implements smp::collision_checker_base< typeparams >.

template<class typeparams , int NUM_DIMENSIONS>
int smp::collision_checker_standard< typeparams, NUM_DIMENSIONS >::cc_update_delete_vertex ( vertex_t vertex_in) [virtual]

Update function for vertex deletion.

This function is called by the planner whenever a vertex is deleted from the graph. A pointer to the vertex is given as an argument.

Parameters:
vertex_inA pointer to deleted vertex.
Returns:
Return 1 if success, a non-positive value to indiacate error.

Implements smp::collision_checker_base< typeparams >.

template<class typeparams , int NUM_DIMENSIONS>
int smp::collision_checker_standard< typeparams, NUM_DIMENSIONS >::cc_update_insert_edge ( edge_t edge_in) [virtual]

Update function for edge insertion.

This function is called by the planner whenever a new edge is added to the graph. A pointer to the new edge is given as an argument.

Parameters:
edge_inA pointer to the new edge.
Returns:
Return 1 for success, a non-positive value to indiacate error.

Implements smp::collision_checker_base< typeparams >.

template<class typeparams , int NUM_DIMENSIONS>
int smp::collision_checker_standard< typeparams, NUM_DIMENSIONS >::cc_update_insert_vertex ( vertex_t vertex_in) [virtual]

Update function for vertex insertion.

This function is called by the planner whenever a new vertex is added to the graph. A pointer to the new vertex is given as an argument.

Parameters:
vertex_inA pointer to the new vertex.
Returns:
Return 1 if success, a non-positive value to indiacate error.

Implements smp::collision_checker_base< typeparams >.

template<class typeparams , int NUM_DIMENSIONS>
int smp::collision_checker_standard< typeparams, NUM_DIMENSIONS >::check_collision_state ( state_t *  state_in) [virtual]

Checks whether a given state is collision free.

Parameters:
state_inThe state that will be checked for collision.
Returns:
Returns 1 if the trajectory is collision-free, 0 if the trajectory collides with an obstacle, and a non-positive if error.

Implements smp::collision_checker_base< typeparams >.

template<class typeparams , int NUM_DIMENSIONS>
int smp::collision_checker_standard< typeparams, NUM_DIMENSIONS >::check_collision_trajectory ( trajectory_t trajectory_in) [virtual]

Checks whether a given trajectory is collision free.

Parameters:
trajectory_inThe trajectory that will be checked for collision.
Returns:
Returns 1 if the trajectory is collision-free, 0 if the trajectory collides with an obstacle, and a non-positive if error.

Implements smp::collision_checker_base< typeparams >.

template<class typeparams , int NUM_DIMENSIONS>
int smp::collision_checker_standard< typeparams, NUM_DIMENSIONS >::set_discretization_length ( double  discretization_length_in)

Sets the length for the discretization.

This function can be used to set the length of the discretization. In this case, the trajectory between two states is approximated by a line connecting them, and discretized in such a way that the maximum length of any segment is at most the parameter provided to this function.

Parameters:
discretization_length_inLength of the discretization.
Returns:
Returns 1 for success, a non-positive value to indicate error.
template<class typeparams , int NUM_DIMENSIONS>
int smp::collision_checker_standard< typeparams, NUM_DIMENSIONS >::set_discretization_steps ( int  num_discretization_steps_in)

Sets the number of discretization steps.

This function can be used to set the number of intermediate states in the discretization process. In this case, the trajectory between two consecutive states is approximated by a straight line. And this line is discretized in such a way that the line includes number of states exactly equal to that provided to this function.

Parameters:
num_discretization_steps_inNumber of discretization steps.
Returns:
Returns 1 for success, a non-positive value to indicate error.

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