19 int data_n,
long time_stamp)
27 printf(
"%ld [mm], %d [1], (%ld [msec])\n",
28 data[front_index], intensity[front_index], time_stamp);
36 printf(
"# n = %d, time_stamp = %ld\n", data_n, time_stamp);
37 for (i = 0; i < data_n; ++i) {
38 printf(
"%d, %ld, %d\n", i, data[i], intensity[i]);
44 int main(
int argc,
char *argv[])
52 unsigned short *intensity = NULL;
54 unsigned long long system_time_stamp;
64 fprintf(stderr,
"Distance Intensity not supported on %s\n",
70 data = (
long *)malloc(max_data_size *
sizeof(data[0]));
72 perror(
"urg_max_index()");
75 intensity = malloc(max_data_size *
sizeof(intensity[0]));
77 perror(
"urg_max_index()");
83 for (i = 0; i < CAPTURE_TIMES; ++i) {
86 printf(
"urg_get_distance_intensity: %s\n",
urg_error(&urg));
91 print_data(&urg, data, intensity, n, time_stamp);