20 int main(
int argc,
char *argv[])
27 unsigned long long system_time_stamp;
37 perror(
"urg_max_index()");
45 printf(
"urg_get_distance: %s\n",
urg_error(&urg));
52 for (i = 0; i < n; ++i) {
53 long distance = data[i];
58 if ((distance < min_distance) || (distance > max_distance)) {
63 x = (long)(distance * cos(radian));
64 y = (long)(distance * sin(radian));
66 printf(
"%ld, %ld\n", x, y);
int urg_start_measurement(urg_t *urg, urg_measurement_type_t type, int scan_times, int skip_scan)
double urg_index2rad(const urg_t *urg, int index)
void urg_distance_min_max(const urg_t *urg, long *min_distance, long *max_distance)
const char * urg_error(const urg_t *urg)
void urg_close(urg_t *urg)
int open_urg_sensor(urg_t *urg, int argc, char *argv[])
int urg_get_distance(urg_t *urg, long data[], long *time_stamp, unsigned long long *system_time_stamp)
int main(int argc, char *argv[])
int urg_max_data_size(const urg_t *urg)