24 printf(
"%ld, ", data[(URG_MAX_ECHO * index) + i]);
29 printf(
"%d, ", intensity[(URG_MAX_ECHO * index) + i]);
36 unsigned short intensity[],
int data_n,
long time_stamp)
46 printf(
"%ld\n", time_stamp);
53 printf(
"# n = %d, time_stamp = %ld\n", data_n, time_stamp);
54 for (i = 0; i < data_n; ++i) {
62 int main(
int argc,
char *argv[])
70 unsigned short *intensity = NULL;
72 unsigned long long system_time_stamp;
81 data = (
long *)malloc(max_data_size * 3 *
sizeof(data[0]));
82 intensity = (
unsigned short *)malloc(max_data_size * 3 *
83 sizeof(intensity[0]));
86 perror(
"urg_max_index()");
92 for (i = 0; i < CAPTURE_TIMES; ++i) {
95 printf(
"urg_get_multiecho_intensity: %s\n",
urg_error(&urg));
101 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_echo_data(long data[], unsigned short intensity[], int index)
int main(int argc, char *argv[])
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 urg_get_multiecho_intensity(urg_t *urg, long data_multi[], unsigned short intensity_multi[], long *time_stamp, unsigned long long *system_time_stamp)
int urg_max_data_size(const urg_t *urg)
static void print_data(urg_t *urg, long data[], unsigned short intensity[], int data_n, long time_stamp)