00001 00010 #ifndef _SMP_INTERFACE_LIBBOT_H_ 00011 #define _SMP_INTERFACE_LIBBOT_H_ 00012 00013 #include <smp/planners/base.h> 00014 00015 #include <smp/interfaces/base.h> 00016 #include <smp/common/region.h> 00017 00018 #include <common/globals.h> 00019 #include "../../../../libbot/src/lcmtypes/lcmtypes.h" 00020 00021 00022 namespace smp { 00023 00024 template< class typeparams > class interface_libbot; 00025 00027 00035 class interface_libbot_environment { 00036 00037 template< class typeparams > friend class interface_libbot; 00038 00039 typedef region<3> region_t; 00040 00041 region_t operating; 00042 region_t goal; 00043 list<region_t*> obstacles; 00044 00045 00046 public: 00047 00048 interface_libbot_environment (); 00049 ~interface_libbot_environment (); 00050 00064 int set_operating_region (const region_t ®ion_in); 00065 00080 int set_goal_region (const region_t ®ion_in); 00081 00093 int clear_obstacle_list (); 00094 00108 int add_obstacle (const region_t ®ion_in); 00109 00110 }; 00111 00112 00113 00115 00121 template< class typeparams > 00122 class interface_libbot : public interface_base<typeparams> { 00123 00124 00125 typedef typename typeparams::state state_t; 00126 typedef typename typeparams::input input_t; 00127 typedef typename typeparams::vertex_data vertex_data_t; 00128 typedef typename typeparams::edge_data edge_data_t; 00129 00130 typedef vertex<typeparams> vertex_t; 00131 typedef edge<typeparams> edge_t; 00132 00133 typedef trajectory<typeparams> trajectory_t; 00134 00135 typedef planner<typeparams> planner_t; 00136 00137 typedef interface_libbot_environment environment_t; 00138 00139 typedef region<3> region_t; 00140 00141 lcm_t *lcm; 00142 00143 int visualize_3d_on; 00144 00146 00151 planner_t *planner_int; 00152 00153 public: 00154 00155 interface_libbot (); 00156 ~interface_libbot (); 00157 00168 int set_planner (planner_t *planner_in); 00169 00170 00180 int visualize_2d (); 00181 00182 00193 int visualize_3d (); 00194 00206 int publish_environment (const environment_t &environment_in); 00207 00208 00209 int publish_data (); 00210 00211 00212 int publish_trajectory (trajectory_t &trajectory_in); 00213 00214 }; 00215 00216 00217 } 00218 00219 #endif