pyrplidar
pyrplidar copied to clipboard
Rplidar 3 descriptor length mismatch
I am having this issue right now with a3 trying to do a scan. anybody knows how to solve this issue?
same problem
This seems to be an issue with newer firmware versions? an example using start_scan_express, depending on the value i can have pyrplidarprotocolerror from line 54 on pyrplidar.py, and also an error on line 151 on pyrplidar.py data =self.receive_data(discriptor) .
changing start_scan_Express(3) to 4 gives me this, using 2 or one I get sync bytes are mismatched and no idea how to fix this.
This error alongside bytes mismatch happen if you try to run any type of scan while the LiDAR has the motor on , disconnecting the lidar and stopping motor and reconnecting will make this error go away as long as you had set up the A3 by editing libraries to adjust for the baudrate.
I solve this issue by adding baudrate=256000 argument into RPLidar class and the lidar just spins. (reconnection still required)
On Windows 10, modifying a file the pyrplidar_serial.py from library helps. In line 13 replace: "self._serial = serial.Serial(port, baudrate, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=timeout, dsrdtr=True)" to " self._serial = serial.Serial(port, baudrate, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=timeout, dsrdtr=False)"
I'm using an A2-M12, and get: File "usr/local/lib/python3.7/dist-packages/pyrplidar.py", line 156, in scan_generator data = self.receive_data(discriptor) File "usr/local/lib/python3.7/dist-packages/pyrplidar.py", line 54, in receive_data raise PyRPlidarProtocolError() pyrplidar_protocol.PyRPlidarProtocolError
Any hint on handling this problem that happens randomly?
Very long frustrating story short: the slamtec LiDARs are very touchy about their baudrate. I have a slamtec C1 unit. Chased down its baudrate in the documentation - once that was set, it connected well; am not getting the "descriptor length mismatch" error anymore. Check your lidar's document for the baudrate.