test_scans.cpp
Go to the documentation of this file.
00001 
00002 #include <stdio.h>
00003 #include <octomap/octomap.h>
00004 #include <octomap/math/Utils.h>
00005 
00006 using namespace std;
00007 using namespace octomap;
00008 
00009 
00010 
00011 int main(int argc, char** argv) {
00012 
00013 
00014   //##############################################################     
00015 
00016   OcTree tree (0.05);  
00017 
00018   point3d origin (0.01f, 0.01f, 0.02f);
00019   point3d point_on_surface (4.01f, 0.01f, 0.01f);
00020 
00021   cout << "generating spherical scan at " << origin << " ..." << endl;
00022 
00023   Pointcloud cloud;
00024 
00025   for (int i=-100; i<101; i++) {
00026     for (int j=-100; j<101; j++) {
00027       point3d rotated = point_on_surface;
00028       rotated.rotate_IP(0, DEG2RAD(i*0.5), DEG2RAD(j*0.5));
00029       cloud.push_back(rotated);
00030     }
00031   }  
00032 
00033   // insert in global coordinates:
00034   tree.insertPointCloud(cloud, origin);
00035 
00036   cout << "done." << endl;
00037   cout << "writing to spherical_scan.bt..." << endl;
00038   tree.writeBinary("spherical_scan.bt");
00039 
00040 
00041 
00042 }


octomap
Author(s): Kai M. Wurm , Armin Hornung
autogenerated on Thu Aug 27 2015 14:13:14