Go to the documentation of this file.00001 #ifndef OCCUPANCY_GRID_OCCUPANCY_GRID_
00002 #define OCCUPANCY_GRID_OCCUPANCY_GRID_
00003
00004
00005 #include <stdint.h>
00006
00007 #include <ros/ros.h>
00008 #include <ros/console.h>
00009 #include <std_msgs/Empty.h>
00010
00011 #include "hrl_msgs/FloatArrayBare.h"
00012 #include "hrl_srvs/FloatArray_None.h"
00013
00014
00022 namespace occupancy_grid
00023 {
00024 class OccupancyGrid
00025 {
00026 public:
00033 OccupancyGrid(float center_x, float center_y, float center_z,
00034 float size_x, float size_y, float size_z,
00035 float res_x, float res_y, float res_z);
00036
00037 ~OccupancyGrid();
00038
00039 unsigned int nX();
00040 unsigned int nY();
00041 unsigned int nZ();
00042
00043
00044
00045 uint32_t* getOccupancyCountArray();
00046
00053 void addPointsUnstamped(const hrl_msgs::FloatArrayBare pts_fab);
00054
00060 void addPointsUnstamped(const std::vector<double> pts_vec);
00061
00065 void publishMarkerArray_simple();
00066
00067
00068 private:
00069 unsigned int nx_, ny_, nz_;
00070 float size_x_, size_y_, size_z_;
00071 float center_x_, center_y_, center_z_;
00072 float res_x_, res_y_, res_z_;
00073 uint32_t *occupancy_count_array_;
00074
00075
00076 ros::NodeHandle nh_;
00077 ros::Subscriber sub_cmd_viz_simple_;
00078 ros::ServiceServer srv_add_points_unstamped_;
00079 ros::Publisher marker_pub_;
00080
00081 void publishMarkerArray_simple_cb(const std_msgs::Empty::ConstPtr& msg);
00082
00083 bool addPointsUnstamped_srv(hrl_srvs::FloatArray_None::Request &req,
00084 hrl_srvs::FloatArray_None::Response &res);
00085 };
00086 };
00087
00088 #endif
00089
00090