coordinate.cpp
00001
00002
00003
00004
00005
00006
00007 #if !MONITOR
00008 #include <runCtrl.h>
00009 #else
00010 #include <mRunCtrl.h>
00011 #endif
00012 #include <typePrint.h>
00013 #include <stdio.h>
00014 #include <stdlib.h>
00015
00016 using namespace VXV;
00017
00018
00019
00020 static void printCrdPosition(RunCtrl& run) {
00021 Position crdPos = run.getCrdPosition();
00022 Position runPos = run.getRunPosition();
00023 Position localPos = run.getLocalPosition();
00024 std::cout << "Crd: " << crdPos << ",\t"
00025 << "Local: " << localPos << ",\t"
00026 << "Run: " << runPos << std::endl;
00027 }
00028
00029
00030 int main(int argc, char *argv[]) {
00031 try {
00032 #if !MONITOR
00033 RunCtrl run;
00034 #else
00035 mRunCtrl run;
00036 #endif
00037 if (run.connect(argc, argv) < 0) {
00038 printf("RunCtrl::connect: %s\n", run.what());
00039 exit(1);
00040 }
00041 #if MONITOR
00042 vmonitor::show();
00043 #endif
00044
00045
00046 printCrdPosition(run);
00047
00048
00049 run.adjustCrdPosition(Position(100, 0, deg(0)));
00050 printCrdPosition(run);
00051 #if MONITOR
00052 VXV::Delay(1000);
00053 #endif
00054
00055
00056 run.adjustRunPosition(Position(200, 0, deg(0)));
00057 printCrdPosition(run);
00058 #if MONITOR
00059 VXV::Delay(1000);
00060 #endif
00061
00062
00063
00064
00065
00066 } catch (std::exception& e) {
00067 printf("exception: %s\n", e.what());
00068 }
00069 return 0;
00070 }
00071