|
|
|
@ -127,6 +127,13 @@ LightwareLaserSerial::init()
@@ -127,6 +127,13 @@ LightwareLaserSerial::init()
|
|
|
|
|
_simple_serial = true; |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case 8: |
|
|
|
|
/* LW20/c (100M 20Hz) */ |
|
|
|
|
_px4_rangefinder.set_min_distance(0.2f); |
|
|
|
|
_px4_rangefinder.set_max_distance(100.0f); |
|
|
|
|
_interval = 50000; |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
PX4_ERR("invalid HW model %" PRIi32 ".", hw_model); |
|
|
|
|
return -1; |
|
|
|
@ -297,6 +304,12 @@ void LightwareLaserSerial::Run()
@@ -297,6 +304,12 @@ void LightwareLaserSerial::Run()
|
|
|
|
|
if ((termios_state = tcsetattr(_fd, TCSANOW, &uart_config)) < 0) { |
|
|
|
|
PX4_ERR("baud %d ATTR", termios_state); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// LW20: Enable serial mode by sending some characters
|
|
|
|
|
if (hw_model == 8) { |
|
|
|
|
const char *data = "www\r\n"; |
|
|
|
|
(void)!::write(_fd, &data, strlen(data)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* collection phase? */ |
|
|
|
|