18 #if defined(URG_WINDOWS_OS)
40 printf(
"URG simple data viewer\n"
45 " -h, --help display this help and exit\n"
46 " -i, intensity mode\n"
47 " -m, multiecho mode\n"
63 for (i = 1; i < argc; ++i) {
64 const char *token = argv[i];
66 if (!strcmp(token,
"-h") || !strcmp(token,
"--help")) {
69 }
else if (!strcmp(token,
"-e")) {
74 }
else if (!strcmp(token,
"-m")) {
76 }
else if (!strcmp(token,
"-i")) {
92 int data_n,
bool is_multiecho,
int offset)
96 const double radian_offset = M_PI / 2.0;
97 int step = (is_multiecho) ? 3 : 1;
102 for (i = 0; i < data_n; ++i) {
103 int index = (step * i) + offset;
104 long l = (data) ? data[index] : intensity[index];
109 if ((l <= min_distance) || (l >= max_distance)) {
122 long data[],
unsigned short intensity[],
int data_n,
157 int main(
int argc,
char *argv[])
162 unsigned short *intensity = NULL;
174 printf(
"urg_open: %s\n",
urg_error(&urg));
183 data = malloc(data_size *
sizeof(data[0]));
185 intensity = malloc(data_size *
sizeof(intensity[0]));
221 printf(
"urg_get_function: %s\n",
urg_error(&urg));