In sdk/app/ultra_simple/main.cpp, there is this text.
// enable the following code if you want rplidar to be reboot by software
// drv->reset();
And in some cases in won't work as expected, because at the start sequence a lidar can send a plain text, e.g.
RP LIDAR System.
Firmware Ver 1.25 - rc2, HW Ver 5
Model: 18
That lead to garbage in read buffer and any following command won't work. Workaround is to wait a bit and call clearNetSerialRxCache(). One second delay is what we used, but about 20ms should be enough, and 2ms won't be, we checked.
In sdk/app/ultra_simple/main.cpp, there is this text.
And in some cases in won't work as expected, because at the start sequence a lidar can send a plain text, e.g.
That lead to garbage in read buffer and any following command won't work. Workaround is to wait a bit and call
clearNetSerialRxCache()
. One second delay is what we used, but about 20ms should be enough, and 2ms won't be, we checked.