bounded_explore_layer.h
Go to the documentation of this file.
1 #ifndef BOUNDED_EXPLORE_LAYER_H_
2 #define BOUNDED_EXPLORE_LAYER_H_
3 
4 #include <ros/ros.h>
5 #include <costmap_2d/layer.h>
6 #include <costmap_2d/GenericPluginConfig.h>
7 #include <dynamic_reconfigure/server.h>
8 
9 #include <geometry_msgs/Polygon.h>
10 #include <frontier_exploration/Frontier.h>
11 #include <frontier_exploration/UpdateBoundaryPolygon.h>
12 #include <frontier_exploration/GetNextFrontier.h>
13 
15 {
16 
23 {
24 public:
27 
31  virtual void onInitialize();
32 
36  virtual void updateBounds(double origin_x, double origin_y, double origin_yaw, double* polygon_min_x, double* polygon_min_y, double* polygon_max_x,
37  double* polygon_max_y);
38 
42  virtual void updateCosts(costmap_2d::Costmap2D& master_grid, int min_i, int min_j, int max_i, int max_j);
44  {
45  return true;
46  }
47 
51  virtual void matchSize();
52 
56  virtual void reset();
57 
58 protected:
59 
66  bool updateBoundaryPolygonService(frontier_exploration::UpdateBoundaryPolygon::Request &req, frontier_exploration::UpdateBoundaryPolygon::Response &res);
67 
73  bool updateBoundaryPolygon(geometry_msgs::PolygonStamped polygon_stamped);
74 
81  bool getNextFrontierService(frontier_exploration::GetNextFrontier::Request &req, frontier_exploration::GetNextFrontier::Response &res);
82 
89  bool getNextFrontier(geometry_msgs::PoseStamped start_pose, geometry_msgs::PoseStamped &next_frontier);
90 
91 private:
92 
97  void mapUpdateKeepObstacles(costmap_2d::Costmap2D& master_grid, int min_i, int min_j, int max_i, int max_j);
98 
99  void reconfigureCB(costmap_2d::GenericPluginConfig &config, uint32_t level);
100 
101  dynamic_reconfigure::Server<costmap_2d::GenericPluginConfig> *dsrv_;
104  geometry_msgs::Polygon polygon_;
106 
108 
110 
113 
114 };
115 
116 }
117 #endif
virtual void reset()
Reset exploration progress.
bool getNextFrontierService(frontier_exploration::GetNextFrontier::Request &req, frontier_exploration::GetNextFrontier::Response &res)
ROS Service wrapper for getNextFrontier.
bool updateBoundaryPolygon(geometry_msgs::PolygonStamped polygon_stamped)
Load polygon boundary to draw on map with each update.
void mapUpdateKeepObstacles(costmap_2d::Costmap2D &master_grid, int min_i, int min_j, int max_i, int max_j)
Update the map with exploration boundary data.
virtual void updateCosts(costmap_2d::Costmap2D &master_grid, int min_i, int min_j, int max_i, int max_j)
Update requested costmap window.
costmap_2d layer plugin that holds the state for a bounded frontier exploration task. Manages the boundary polygon, superimposes the polygon on the overall exploration costmap, and processes costmap to find next frontier to explore.
virtual void updateBounds(double origin_x, double origin_y, double origin_yaw, double *polygon_min_x, double *polygon_min_y, double *polygon_max_x, double *polygon_max_y)
Calculate bounds of costmap window to update.
bool getNextFrontier(geometry_msgs::PoseStamped start_pose, geometry_msgs::PoseStamped &next_frontier)
Search the costmap for next reachable frontier to explore.
bool updateBoundaryPolygonService(frontier_exploration::UpdateBoundaryPolygon::Request &req, frontier_exploration::UpdateBoundaryPolygon::Response &res)
ROS Service wrapper for updateBoundaryPolygon.
virtual void matchSize()
Match dimensions and origin of parent costmap.
virtual void onInitialize()
Loads default values and initialize exploration costmap.
void reconfigureCB(costmap_2d::GenericPluginConfig &config, uint32_t level)
dynamic_reconfigure::Server< costmap_2d::GenericPluginConfig > * dsrv_


frontier_exploration
Author(s): Paul Bovbel
autogenerated on Mon Jun 10 2019 13:25:00