Skip to content

Instantly share code, notes, and snippets.

@codebudo
Created February 25, 2019 18:03
Show Gist options
  • Save codebudo/288d466e7b1f9cde4584aeb994332e02 to your computer and use it in GitHub Desktop.
Save codebudo/288d466e7b1f9cde4584aeb994332e02 to your computer and use it in GitHub Desktop.
from rplidar import RPLidar
lidar = RPLidar('/dev/tty.SLAB_USBtoUART')
info = lidar.get_info()
print(info)
health = lidar.get_health()
print(health)
for i, scan in enumerate(lidar.iter_scans()):
if i > 10:
break
for j in scan:
quality, angle, distance = j
print(angle, distance)
lidar.stop()
lidar.stop_motor()
lidar.disconnect()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment