27 printf(
"%ld [mm], (%ld [msec])\n", data[front_index], time_stamp);
38 for (i = 0; i < data_n; ++i) {
44 if ((l <= min_distance) || (l >= max_distance)) {
48 x = (long)(l * cos(radian));
49 y = (long)(l * sin(radian));
50 printf(
"(%ld, %ld), ", x, y);
57 int main(
int argc,
char *argv[])
65 unsigned long long system_time_stamp;
75 perror(
"urg_max_index()");
88 for (i = 0; i < CAPTURE_TIMES; ++i) {
91 printf(
"urg_get_distance: %s\n",
urg_error(&urg));
int urg_deg2step(const urg_t *urg, double degree)
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 urg_set_scanning_parameter(urg_t *urg, int first_step, int last_step, int skip_step)
int urg_step2index(const urg_t *urg, int step)
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)
static void print_data(urg_t *urg, long data[], int data_n, long time_stamp)
int main(int argc, char *argv[])
int urg_max_data_size(const urg_t *urg)