Go to the documentation of this file.00001
00002 #include "simple_occupancy_grid/occupancy_grid.h"
00003
00004 #include "hrl_msgs/FloatArrayBare.h"
00005
00006 #include <ros/ros.h>
00007 #include <ros/console.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 int main(int argc, char *argv[])
00025 {
00026 ros::init(argc, argv, "occupancy_grid_node");
00027 ROS_INFO("Hello World");
00028
00029 occupancy_grid::OccupancyGrid og(0.5, 0., 1.0,
00030 0.5, 0.5, 0.5,
00031 0.02, 0.02, 0.02);
00032
00033 hrl_msgs::FloatArrayBare fa;
00034
00035 fa.data.push_back(0.5);
00036 fa.data.push_back(0.);
00037 fa.data.push_back(1.);
00038
00039 fa.data.push_back(0.6);
00040 fa.data.push_back(0.);
00041 fa.data.push_back(1.);
00042
00043 fa.data.push_back(0.4);
00044 fa.data.push_back(0.);
00045 fa.data.push_back(1.);
00046
00047 fa.data.push_back(0.5);
00048 fa.data.push_back(0.1);
00049 fa.data.push_back(1.);
00050
00051 fa.data.push_back(0.5);
00052 fa.data.push_back(-0.1);
00053 fa.data.push_back(1.);
00054
00055 fa.data.push_back(0.5);
00056 fa.data.push_back(0.);
00057 fa.data.push_back(1.1);
00058
00059 fa.data.push_back(0.5);
00060 fa.data.push_back(0.);
00061 fa.data.push_back(0.9);
00062
00063 og.addPointsUnstamped(fa);
00064
00065
00066 ros::Rate loop_rate(1);
00067
00068 while(ros::ok())
00069 {
00070 og.publishMarkerArray_simple();
00071 loop_rate.sleep();
00072 }
00073
00074 }
00075
00076