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);
int urg_start_measurement(urg_t *urg, urg_measurement_type_t type, int scan_times, int skip_scan)
static void print_data(urg_t *urg, long data[], unsigned short intensity[], int data_n, long time_stamp)
const char * urg_error(const urg_t *urg)
void urg_close(urg_t *urg)
int urg_step2index(const urg_t *urg, int step)
int open_urg_sensor(urg_t *urg, int argc, char *argv[])
int main(int argc, char *argv[])
const char * urg_sensor_product_type(urg_t *urg)
int urg_get_distance_intensity(urg_t *urg, long data[], unsigned short intensity[], long *time_stamp, unsigned long long *system_time_stamp)
int urg_max_data_size(const urg_t *urg)