src/smp/components/collision_checkers/standard.h

Go to the documentation of this file.
00001 
00008 #ifndef _SMP_COLLISION_CHECKER_STANDARD_H_
00009 #define _SMP_COLLISION_CHECKER_STANDARD_H_
00010 
00011 #include <smp/components/collision_checkers/base.h>
00012 
00013 #include <smp/common/region.h>
00014 
00015 #include <list>
00016 
00017 
00018 namespace smp {
00019 
00021 
00033     template< class typeparams, int NUM_DIMENSIONS >
00034     class collision_checker_standard : public collision_checker_base<typeparams> {
00035         
00036         
00037         
00038         typedef typename typeparams::state state_t;
00039         typedef typename typeparams::input input_t;
00040         typedef typename typeparams::vertex_data vertex_data_t;
00041         typedef typename typeparams::edge_data edge_data_t;
00042 
00043         typedef vertex<typeparams> vertex_t;
00044         typedef edge<typeparams> edge_t;    
00045         typedef trajectory<typeparams> trajectory_t;
00046 
00047         typedef region<NUM_DIMENSIONS> region_t;
00048 
00049         int num_discretization_steps;
00050         double discretization_length;
00051 
00052         // 0: no discretization
00053         // 1: use steps discretization
00054         // 2: use length discretization 
00055         int discretization_method;     
00056 
00057         list< region_t* > list_obstacles;
00058 
00059 
00060     public:
00061         collision_checker_standard ();
00062         ~collision_checker_standard ();
00063 
00064 
00065         int cc_update_insert_vertex (vertex_t *vertex_in);
00066     
00067 
00068         int cc_update_insert_edge (edge_t *edge_in);  
00069 
00070 
00071         int cc_update_delete_vertex (vertex_t *vertex_in);
00072     
00073     
00074         int cc_update_delete_edge (edge_t *edge_in);
00075 
00076 
00077         int check_collision_state (state_t *state_in);
00078 
00079 
00080         int check_collision_trajectory (trajectory_t *trajectory_in);
00081     
00082 
00096         int set_discretization_steps (int num_discretization_steps_in);
00097 
00098 
00111         int set_discretization_length (double discretization_length_in);
00112 
00113 
00126         int add_obstacle (region_t &obstacle_in);
00127 
00128     };
00129 
00130 
00131 }
00132 
00133 #endif