Skip to content

Incorrect descriptor starting bytes #34

Open
Mytre opened this issue Aug 17, 2020 · 3 comments
Open

Incorrect descriptor starting bytes #34

Mytre opened this issue Aug 17, 2020 · 3 comments

Comments

@Mytre
Copy link

Mytre commented Aug 17, 2020

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?

@gzchenjiajun
Copy link

same problem

@claymaks
Copy link

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.

@bsautner
Copy link

bsautner commented Jan 7, 2022

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants