00001
00011 #include "UrgDevice.h"
00012 #include <iostream>
00013 #include <cstdlib>
00014 #include <cstdio>
00015
00016 using namespace qrk;
00017 using namespace std;
00018
00019
00021 int main(int argc, char *argv[])
00022 {
00023 #ifdef WINDOWS_OS
00024 const char device[] = "COM3";
00025 #else
00026 const char device[] = "/dev/ttyACM0";
00027 #endif
00028
00029 UrgDevice urg;
00030 if (! urg.connect(device)) {
00031 printf("UrgDevice::connect: %s\n", urg.what());
00032 exit(1);
00033 }
00034
00035 vector<string> lines;
00036
00037
00038 urg.versionLines(lines);
00039 if (lines.empty()) {
00040 cerr << "UrgDevice::versionLines: " << urg.what() << endl;
00041 exit(1);
00042 }
00043
00044
00045 for (vector<string>::iterator it = lines.begin();
00046 it != lines.end(); ++it) {
00047 cout << *it << endl;
00048 }
00049
00050 #ifdef MSC
00051 getchar();
00052 #endif
00053
00054 return 0;
00055 }