Go to the documentation of this file.00001 #include "urg_sensor.h"
00002 #include "urg_utils.h"
00003 #include <stdio.h>
00004 #include <math.h>
00005
00006 int main(void)
00007 {
00008 urg_t urg;
00009 long *length_data = NULL;
00010 int length_data_size;
00011 int i;
00012
00013
00014 length_data_size = urg_get_distance(&urg, length_data, NULL);
00015 for (i = 0; i < length_data_size; ++i) {
00016
00017 double radian;
00018 long length;
00019 long x;
00020 long y;
00021
00022 radian = urg_index2rad(&urg, i);
00023 length = length_data[i];
00024
00025
00026 x = (long)(length * cos(radian));
00027 y = (long)(length * sin(radian));
00028 printf("(%ld, %ld), ", x, y);
00029 }
00030 printf("\n");
00031 return 0;
00032 }