Open Mytre opened 4 years ago
same problem
I was having this same problem when I stopped my script without properly closing my serial connection/disconnecting from the lidar. I solved it by catching any RPLidarException
and then executing
lidar.stop_motor()
lidar.stop()
lidar.disconnect()
lidar = RPLidar(port)
Not all of these lines may be necessary, but in general, I found disconnecting and reconnecting solved my problem.
I can confirm the above - happens when you don't have a clean shutdown - catch the error and restart the device:
def collect_data(client):
try:
lidar = RPLidar(None, PORT_NAME)
for scan in lidar.iter_scans():
post(client, scan)
except RPLidarException:
lidar.stop()
lidar.disconnect()
collect_data(client)
Hello, i am using an A3 lidar, I already changed the rplidar.py baudrate , now I am getting errors in rplidar line 211: dsize, is _single, dtype = self._read_descriptor()
and in line 189 in _read_descriptor raise RPLidarException('Incorrect descriptor starting bytes') rplidar.RPLidarException: Incorrect descriptor starting bytes
anyone has any idea how to fix this?