20 #if defined(URG_WINDOWS_OS) 21 const char *device =
"COM4";
22 #elif defined(URG_LINUX_OS) 23 const char *device =
"/dev/ttyACM0";
26 const char *device =
"/dev/tty.usbmodemfa131";
29 long baudrate_or_port = 115200;
31 const char *ip_address =
"192.168.0.10";
35 for (i = 1; i < argc; ++i) {
36 if (!strcmp(argv[i],
"-e")) {
38 baudrate_or_port = 10940;
44 if (
urg_open(urg, connection_type, device, baudrate_or_port) < 0) {
45 printf(
"urg_open: %s, %ld: %s\n",
46 device, baudrate_or_port,
urg_error(urg));
const char * urg_error(const urg_t *urg)
urg_connection_type_t
通信タイプ
int open_urg_sensor(urg_t *urg, int argc, char *argv[])
int urg_open(urg_t *urg, urg_connection_type_t connection_type, const char *device_or_address, long baudrate_or_port)