Created
February 25, 2019 18:03
-
-
Save codebudo/288d466e7b1f9cde4584aeb994332e02 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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