noAdjust.cpp

00001 /*
00002   URG センサからのデータ処理
00003   Satofumi KAMIMURA
00004   $Id$
00005 */
00006 
00007 #include "mRunCtrl.h"
00008 #include "mURGCtrl.h"
00009 #include "vutils.h"
00010 #include "drawCaptures.h"
00011 #include "dumpPlotData.h"
00012 
00013 using namespace VXV;
00014 
00015 
00016 int main(int argc, char *argv[]) {
00017   try {
00018     mRunCtrl run;
00019     mURGCtrl urg;
00020     if ((initConnection(&run, argc, argv) < 0) ||
00021         (initConnection(&urg, argc, argv, true) < 0)) {
00022       exit(1);
00023     }
00024     urg.setOwnCrdToObject(&run);
00025 
00026     vmonitor::show();
00027 
00028     int capture_times = 0;
00029     int pre_times = urg.getCaptureTimes() - 1;
00030 
00031     run.rotateToDirection(deg(-90));
00032     while (!run.isStable()) {
00033       // 周囲の情報を取得
00034       int n = urg.capture();
00035       int times = urg.getCaptureTimes();
00036       if ((n > 0) && (times != pre_times)) {
00037         pre_times = times;
00038         urg.convert();
00039         drawCaptures(urg);
00040         outputPlotData(urg, argv[0]);
00041 
00042         ++capture_times;
00043       }
00044     }
00045     printf("captures: %d\n", capture_times);
00046 
00047     run.rotateToDirection(deg(0));
00048     VXV::waitStable(run, 100);
00049     VXV::Delay(1000);
00050 
00051     outputPlotFile(argv[0]);
00052 
00053   } catch (std::exception& e) {
00054     printf("exception: %s\n", e.what());
00055   }
00056   return 0;
00057 }
00058 

Generated on Mon Apr 13 22:52:02 2009 by  doxygen 1.5.7.1