32 #include "nav_msgs/GetMap.h" 33 #include "geometry_msgs/Quaternion.h" 35 #include <Eigen/Geometry> 37 #include <QtGui/QApplication> 57 map_sub_ = n.
subscribe(
"map", 1, &MapGenerator::mapCallback,
this);
64 geotiff_writer.setMapFileName(mapname_);
65 geotiff_writer.setupTransforms(*map);
66 geotiff_writer.drawBackgroundCheckerboard();
67 geotiff_writer.drawMap(*map);
68 geotiff_writer.drawCoords();
70 geotiff_writer.writeGeotiffImage();
73 ROS_INFO(
"GeoTiff created in %f seconds", elapsed_time.
toSec());
84 #define USAGE "Usage: \n" \ 85 " geotiff_saver -h\n"\ 86 " geotiff_saver [-f <mapname>] [ROS remapping args]" 88 int main(
int argc,
char** argv)
91 std::string mapname =
"map";
93 for(
int i=1; i<argc; i++)
95 if(!strcmp(argv[i],
"-h"))
100 else if(!strcmp(argv[i],
"-f"))
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void mapCallback(const nav_msgs::OccupancyGridConstPtr &map)
GeotiffWriter geotiff_writer
int main(int argc, char **argv)
MapGenerator(const std::string &mapname)