one_scan.c
00001
00002
00003
00004
00005
00006
00007 #include "urg_ctrl.h"
00008 #include <stdio.h>
00009 #include <stdlib.h>
00010
00011
00012 int main(int argc, char *argv[]) {
00013 long length[URG_DATA_SIZE];
00014 int n;
00015 int i;
00016
00017 if (initURGCtrl(argc, argv) < 0) {
00018 printf("initURGCtrl: %s\n", urg_getError());
00019 exit(1);
00020 }
00021
00022 n = urg_capture(length, 0, URG_DATA_SIZE -1, 1);
00023 printf("urg_capture: %d\n", n);
00024 if (n <= 0) {
00025 exit(1);
00026 }
00027
00028 for (i = 0; i < URG_DATA_SIZE; ++i) {
00029 printf("%d: %ld, ", i, length[i]);
00030 }
00031
00032 return 0;
00033 }
00034