one_scan.c

00001 /*
00002   URG センサによる1回測定
00003   Satofumi KAMIMURA
00004   $Id$
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 

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