simuPosUse.cpp
00001
00002
00003
00004
00005
00006
00007 #include "mRunCtrl.h"
00008 #include "mURGCtrl.h"
00009 #include "vutils.h"
00010 #include "drawCaptures.h"
00011
00012 using namespace VXV;
00013
00014
00015 int main(int argc, char *argv[]) {
00016 try {
00017 mRunCtrl run;
00018 mURGCtrl urg;
00019 if ((initConnection(&run, argc, argv) < 0) ||
00020 (initConnection(&urg, argc, argv, true) < 0)) {
00021 exit(1);
00022 }
00023 urg.setOwnCrdToObject(&run);
00024 run.adjustSubTreeTicks(0);
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 urg.capture();
00035 int times = urg.getCaptureTimes();
00036 if (times != pre_times) {
00037 pre_times = times;
00038 urg.convert(run.ticksPos);
00039 drawCaptures(urg);
00040
00041 ++capture_times;
00042 }
00043 }
00044
00045
00046 printf("captures: %d\n", capture_times);
00047
00048 run.rotateToDirection(deg(0));
00049 VXV::waitStable(run, 100);
00050 VXV::Delay(1000);
00051
00052 } catch (std::exception& e) {
00053 printf("exception: %s\n", e.what());
00054 }
00055 return 0;
00056 }
00057