Hyun-je / pyrplidar

Full-featured python library for Slamtec RPLIDAR series
MIT License
55 stars 24 forks source link

RPLIDAR S1 doesn't work #3

Open MegaraSoftware opened 4 years ago

MegaraSoftware commented 4 years ago

Hello, why does the RPLIDAR S1 not work? the protocol is the same?

PyRPlidar Info : device is connected
Traceback (most recent call last):
  File "lara.py", line 31, in <module>
    simple_scan()
  File "lara.py", line 17, in simple_scan
    scan_generator = lidar.force_scan()
  File "/usr/local/lib/python3.7/dist-packages/pyrplidar.py", line 170, in force_scan
    discriptor = self.receive_discriptor()
  File "/usr/local/lib/python3.7/dist-packages/pyrplidar.py", line 42, in receive_discriptor
    discriptor = PyRPlidarResponse(self.lidar_serial.receive_data(RPLIDAR_DESCRIPTOR_LEN))
  File "/usr/local/lib/python3.7/dist-packages/pyrplidar_protocol.py", line 110, in __init__
    self.sync_byte1 = raw_bytes[0]
IndexError: index out of range
PyRPlidar Info : device is disconnected
JTDeve commented 3 years ago

Hello, have you solved this problem?

MegaraSoftware commented 3 years ago

no sorry.

Mit freundlichen Grüßen

Rene Schönfelder

Am Mi., 25. Nov. 2020 um 07:37 Uhr schrieb JTDeve <notifications@github.com

:

Hello, have you solved this problem?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Hyun-je/pyrplidar/issues/3#issuecomment-733500281, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH3N4UYZABM3CWEVJMMNCELSRSQ37ANCNFSM4MLLHU5Q .

neolu commented 3 years ago

Pi4 + S1

PyRPlidar Info : device is connected Traceback (most recent call last): File "simple_scan.py", line 30, in simple_scan() File "simple_scan.py", line 16, in simple_scan scan_generator = lidar.force_scan() File "/home/pi/.local/lib/python3.7/site-packages/pyrplidar.py", line 170, in force_scan discriptor = self.receive_discriptor() File "/home/pi/.local/lib/python3.7/site-packages/pyrplidar.py", line 42, in receive_discriptor discriptor = PyRPlidarResponse(self.lidar_serial.receive_data(RPLIDAR_DESCRIPTOR_LEN)) File "/home/pi/.local/lib/python3.7/site-packages/pyrplidar_protocol.py", line 110, in init self.sync_byte1 = raw_bytes[0] IndexError: index out of range PyRPlidar Info : device is disconnected pi@raspberrypi:~/work/pyrplidar/examples $

kamil52512 commented 2 years ago

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)"