-
Notifications
You must be signed in to change notification settings - Fork 17
Latest RPLidar firmware has broken this library #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@zlite is there a document with the protocol output for 1.29 |
Yes, it's here. I don't think that the protocol has changed, but rather the default mode has changed from standard to boost. |
doesn't look like there's that much different, wanna take a poke at adding a scan mode query check |
Is it that or because something changed in the return and this check now fails: Adafruit_CircuitPython_RPLIDAR/adafruit_rplidar.py Lines 224 to 225 in 9f4bb20
Try enabling logging which should print the actual |
Looks like another Python library solved it this way: |
Hi, do you have any idea where to download firmware 1.29? It looks like the latest on their website is 1.27.0 (https://www.slamtec.com/en/Support#rplidar-a-series). |
I don't. It ships built into all the new RP Lidars, but I don't see any way
to download it from their site.
CC'ing Slamtec support who may be able to help
…On Fri, Mar 5, 2021 at 3:32 PM Melissa LeBlanc-Williams < ***@***.***> wrote:
Hi, do you have any idea where to download firmware 1.29? It looks like
the latest on their website is 1.27.0 (
https://www.slamtec.com/en/Support#rplidar-a-series).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAENF772XJG46CCA7YKWMLTCFSZTANCNFSM4YNAL37A>
.
--
◤ CHRIS ANDERSON
3DR | CEO
website <https://www.3dr.com/> | linkedin
<https://www.linkedin.com/company/3d-robotics> | twitter
<https://www.twitter.com/3drobotics>
|
Do you have one of the ones with 1.29 you could test if I were to make changes? I can test that it still works on the old ones at least. |
Yep!
…On Fri, Mar 5, 2021, 4:41 PM Melissa LeBlanc-Williams < ***@***.***> wrote:
Do you have one of the ones with 1.29 you could test if I were to make
changes? I can test that it still works on the old ones at least.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAENFZ7CN5IWRQAR7NWWJDTCF235ANCNFSM4YNAL37A>
.
|
Ok, want to test out #16? |
With the attached unit test, I'm still getting this error (I did pull in
your change and ran python setup.py install again):
PS C:\Users\chris> & C:/Python38/python.exe
c:/Users/chris/Documents/GitHub/Adafruit_CircuitPython_RPLIDAR/examples/lidartest.py
Recording measurments... Press Crl+C to stop.
Traceback (most recent call last):
File
"c:/Users/chris/Documents/GitHub/Adafruit_CircuitPython_RPLIDAR/examples/lidartest.py",
line 27, in <module>
run()
File
"c:/Users/chris/Documents/GitHub/Adafruit_CircuitPython_RPLIDAR/examples/lidartest.py",
line 18, in run
for scan in lidar.iter_scans():
File
"C:\Python38\lib\site-packages\adafruit_circuitpython_rplidar-1.1.7.dev0+g3bb1c7d.d20210309-py3.8.egg\adafruit_rplidar.py",
line 513, in iter_scans
File
"C:\Python38\lib\site-packages\adafruit_circuitpython_rplidar-1.1.7.dev0+g3bb1c7d.d20210309-py3.8.egg\adafruit_rplidar.py",
line 424, in iter_measurements
File
"C:\Python38\lib\site-packages\adafruit_circuitpython_rplidar-1.1.7.dev0+g3bb1c7d.d20210309-py3.8.egg\adafruit_rplidar.py",
line 344, in start
File
"C:\Python38\lib\site-packages\adafruit_circuitpython_rplidar-1.1.7.dev0+g3bb1c7d.d20210309-py3.8.egg\adafruit_rplidar.py",
line 314, in health
File
"C:\Python38\lib\site-packages\adafruit_circuitpython_rplidar-1.1.7.dev0+g3bb1c7d.d20210309-py3.8.egg\adafruit_rplidar.py",
line 254, in _read_descriptor
adafruit_rplidar.RPLidarException: Descriptor length mismatch
…On Mon, Mar 8, 2021 at 5:19 PM Melissa LeBlanc-Williams < ***@***.***> wrote:
Ok, want to test out #16
<#16>?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAENF65GWBMUKA2GYYTZHTTCVZQ7ANCNFSM4YNAL37A>
.
--
◤ CHRIS ANDERSON
3DR | CEO
website <https://www.3dr.com/> | linkedin
<https://www.linkedin.com/company/3d-robotics> | twitter
<https://www.twitter.com/3drobotics>
#!/usr/bin/env python3
'''Records scans to a given file in the form of numpy array.
Usage example:
$ ./record_scans.py out.npy'''
import sys
import numpy as np
from adafruit_rplidar import RPLidar
def run():
'''Main function'''
PORT_NAME = 'COM7'
lidar = RPLidar(None, PORT_NAME)
data = []
try:
print('Recording measurments... Press Crl+C to stop.')
for scan in lidar.iter_scans():
data.append(np.array(scan))
except KeyboardInterrupt:
print('Stopping.')
lidar.stop()
lidar.disconnect()
np.save(path, np.array(data))
if __name__ == '__main__':
run()
|
Ok, I'll probably need to get one with 1.29 firmware then as there's probably a bunch of differences. |
I've got 1.28, which works, but is getting 2k scans/second, when it could be getting 8k using boost. I'm looking at the c++ sdk here: https://github.com/Slamtec/rplidar_sdk/blob/master/sdk/sdk/include/rplidar_cmd.h#L59 Also, the protocol document talks about boost mode (hq mode in the c++ code) but doesn't give the hex value (0x83). I'd love to see boost mode implemented as the solution to this! Also, get lidar conf (0x84) could be used to ensure backward compatibility. |
Thank you @benlbroussard, The feedback was very helpful. It sounds like the changes I made were in the right direction and I just need to add boost mode handling. I'll give that a try and update my PR as soon as I finish up with another task. |
A little update. I can get the Robotica library to work with the 1.29 firmware, at least as far as the below example goes:
Output:
But your library still generates a "Descriptor length mismatch" |
This also works with the Robotica library:
Output:
|
Thanks, that's actually pretty helpful as I was referencing it for my update. |
@zlite I updated the PR a bit. Want to try that out? I think that's about the best I can do without a 1.29 firmware model in hand to actually work with. |
Still getting "wrong body size" I'm afraid. Sorry! The RPLidars sold by Seeed on Amazon are using the new 1.29 firmware Also the import in the repo's readme of |
Oh, ok. Wrong body size is a different error, so that's progress. |
Actually, the first time you run it the error is "wrong body size". The second time it's "Incorrect descriptor starting bytes". Then back to "wrong body size" and so on forever |
Debugging and debugging and debugging... timeout=3... huh everything's working... |
As in "lidar = RPLidar(None, PORT_NAME, timeout=3)"? Cool! I'll give it a try |
Also Express needs a payload now if scan_type == "express":
print(cmd)
self._send_payload_cmd(cmd, b"\x??\x00\x00\x00\x00") |
@satiowadahc It works! That's so crazy, but timeout=3 was the secret. Will submit a PR with a corrected example. I've tested it with both old and new RPLidar firmware @makermelissa This is good news. I think you've cracked it. Bravo |
Fixed via #17 |
Starting in 2021, all RPLidar hardware is shipping with firmware 1.29, which breaks this library (error shown is "Incorrect descriptor starting bytes", but that just means that it got no data). Slamtec says that this may be due to the default scan mode being changed to boost mode. They say that they do not support Python(!) and are not intending to fix these libraries. They say it's up to us to fix them ourselves :-(
AFAIK there is no way to downgrade the firmware to a previous version (last known good was 1.27), so I think that until distributors can get Slamtec to help fix these libraries, we have to now consider the RPLidar devices unsupported in Python
The text was updated successfully, but these errors were encountered: