generate_graph.cpp
Go to the documentation of this file.
00001 
00039 #include <iostream>
00040 #include <string>
00041 
00042 #include <opencv2/core/core.hpp>
00043 #include <opencv2/highgui/highgui.hpp>
00044 
00045 #include <bwi_mapper/topological_mapper.h>
00046 
00047 int main(int argc, char** argv) {
00048 
00049   if (argc < 3) {
00050     std::cerr << "USAGE: " << argv[0] 
00051         << " <yaml-map-file> <yaml-graph-file>" << std::endl;
00052     return -1;
00053   }
00054 
00055   bwi_mapper::TopologicalMapper mapper(argv[1]);
00056   mapper.computeTopologicalGraph(0.3, 0.5, 3.0);
00057   
00058   cv::Mat image;
00059   mapper.drawMap(image);
00060   mapper.drawPointGraph(image);
00061   std::string filename(argv[2]);
00062   mapper.writePointGraphToFile(filename);
00063 
00064   cv::namedWindow("Display window", CV_WINDOW_AUTOSIZE);
00065   cv::imshow("Display window", image);                
00066 
00067   cv::waitKey(0); // Wait for a keystroke in the window
00068   return 0;
00069 }
00070 
00071 


bwi_mapper
Author(s): Piyush Khandelwal
autogenerated on Thu Jun 6 2019 17:57:21