so I was working on a slam project and using the Breezyslam repo link, I am always getting this error, I don't know where I am getting it wrong, can someone help?

File "/home/robopi/Slam/py_slam/lib/python3.9/site-packages/rplidar.py", line 214, in _read_descriptor

raise RPLidarException('Descriptor length mismatch')

rplidar.RPLidarException: Descriptor length mismatch

I am running the examples from breezyslam - rpslam.py

I am using raspberry pi 4 and rplidar A1

i have tried another repo which uses breezyslam then i am getting this error

File "/home/robopi/Slam/py_slam/lib/python3.9/site-packages/adafruit_rplidar.py", line 280, in _read_response
    raise RPLidarException("Wrong body size")
adafruit_rplidar.RPLidarException: Wrong body size

that repo is link

i am just trying to build a slam using python

  • $\begingroup$ Welcome to Robotics, Pedakolimi Harish. When I search your first repo I don't see rplidar.py, and when I search the second repo I don't find adafruit_rplidar.py. I actually don't find either term in either repo. The folder structure says /robopi/Slam/py_slam/ - are you sure you've linked the correct repos? Or, are you sure you're working in the projects you think you're working in? $\endgroup$
    – Chuck
    Nov 1, 2022 at 18:56
  • $\begingroup$ @Chuck rplidar.py is from the package that is required to run this, this is the link for that github.com/Roboticia/RPLidar, and the second one is the same it is a package github.com/adafruit/Adafruit_CircuitPython_RPLIDAR using these when I run github.com/simondlevy/BreezySLAM/blob/master/examples/rpslam.py this I am getting this error. $\endgroup$ Nov 2, 2022 at 4:58
  • $\begingroup$ Have you verified the port used by the RP Lidar is correct and the lidar is on? That's the only thing really that I'm seeing that seems questionable. Otherwise I'd try copy/pasting the sample code exactly as given in the rplidar.py file and see if you still get the error. $\endgroup$
    – Chuck
    Nov 3, 2022 at 15:13
  • $\begingroup$ @Chuck yes lidar is connected correctly and it is rotating, I can also see a green light, and when I try that sample code it shows the same error $\endgroup$ Nov 5, 2022 at 16:27
  • $\begingroup$ Are you sure it's on the correct port? Your code and the example both use USB0. $\endgroup$
    – Chuck
    Nov 5, 2022 at 17:26


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.