sensor_parameter.c
Go to the documentation of this file.
1 
10 #include "urg_c/urg_sensor.h"
11 #include "urg_c/urg_utils.h"
12 #include "open_urg_sensor.h"
13 #include <stdio.h>
14 
15 
16 int main(int argc, char *argv[])
17 {
18  urg_t urg;
19  int min_step;
20  int max_step;
21  long min_distance;
22  long max_distance;
23 
24  if (open_urg_sensor(&urg, argc, argv) < 0) {
25  return 1;
26  }
27 
28  printf("Sensor product type: %s\n", urg_sensor_product_type(&urg));
29  printf("Sensor firmware version: %s\n", urg_sensor_firmware_version(&urg));
30  printf("Sensor serial ID: %s\n", urg_sensor_serial_id(&urg));
31  printf("Sensor status: %s\n", urg_sensor_status(&urg));
32  printf("Sensor state: %s\n", urg_sensor_state(&urg));
33 
34  urg_step_min_max(&urg, &min_step, &max_step);
35  printf("step: [%d, %d]\n", min_step, max_step);
36 
37  urg_distance_min_max(&urg, &min_distance, &max_distance);
38  printf("distance: [%ld, %ld)\n", min_distance, max_distance);
39 
40  printf("scan interval: %ld [usec]\n", urg_scan_usec(&urg));
41  printf("sensor data size: %d\n", urg_max_data_size(&urg));
42 
43  urg_close(&urg);
44 
45 #if defined(URG_MSC)
46  getchar();
47 #endif
48  return 0;
49 }
urg_sensor_product_type
const char * urg_sensor_product_type(urg_t *urg)
Definition: urg_sensor.c:1180
urg_t
URG sensor.
Definition: urg_sensor.h:72
urg_sensor_state
const char * urg_sensor_state(urg_t *urg)
Definition: urg_sensor.c:1350
urg_sensor.h
URG sensor.
urg_step_min_max
void urg_step_min_max(const urg_t *urg, int *min_step, int *max_step)
Definition: urg_utils.c:91
open_urg_sensor.h
urg_distance_min_max
void urg_distance_min_max(const urg_t *urg, long *min_distance, long *max_distance)
Definition: urg_utils.c:73
urg_close
void urg_close(urg_t *urg)
Definition: urg_sensor.c:745
urg_utils.h
URG sensor utility.
urg_sensor_serial_id
const char * urg_sensor_serial_id(urg_t *urg)
Definition: urg_sensor.c:1201
main
int main(int argc, char *argv[])
Definition: sensor_parameter.c:16
urg_sensor_firmware_version
const char * urg_sensor_firmware_version(urg_t *urg)
Definition: urg_sensor.c:1244
urg_scan_usec
long urg_scan_usec(const urg_t *urg)
Definition: urg_utils.c:104
urg_sensor_status
const char * urg_sensor_status(urg_t *urg)
Definition: urg_sensor.c:1325
open_urg_sensor
int open_urg_sensor(urg_t *urg, int argc, char *argv[])
Definition: open_urg_sensor.c:18
urg_max_data_size
int urg_max_data_size(const urg_t *urg)
Definition: urg_utils.c:114


urg_c
Author(s): Satofumi Kamimura , Katsumi Kimoto, Adrian Boeing
autogenerated on Wed Mar 2 2022 01:08:11