跳转到主要内容

RPLidar支持

项目描述

简介

Documentation Status Discord Build Status Code Style: Black

依赖关系

使用PyPy安装: pip install Adafruit_CircuitPython_RPLIDAR 此驱动程序依赖于

请确保所有依赖项都可在CircuitPython文件系统中使用。这可以通过下载Adafruit库和驱动程序包轻松实现。

使用示例

import os
from math import floor
from adafruit_rplidar import RPLidar


# Setup the RPLidar
PORT_NAME = '/dev/ttyUSB0'
lidar = RPLidar(None, PORT_NAME, timeout=3)

# used to scale data to fit on the screen
max_distance = 0

def process_data(data):
    print(data)

scan_data = [0]*360

try:
#    print(lidar.get_info())
    for scan in lidar.iter_scans():
        for (_, angle, distance) in scan:
            scan_data[min([359, floor(angle)])] = distance
        process_data(scan_data)

except KeyboardInterrupt:
    print('Stopping.')
lidar.stop()
lidar.disconnect()

文档

此库的API文档可以在Read the Docs上找到。

有关构建库文档的信息,请参阅本指南

贡献

欢迎贡献!在贡献之前,请阅读我们的行为准则,以帮助本项目保持开放。

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分发

adafruit-circuitpython-rplidar-1.2.14.tar.gz (30.5 kB 查看散列值)

上传时间

构建分发

adafruit_circuitpython_rplidar-1.2.14-py3-none-any.whl (9.3 kB 查看散列值)

上传时间 Python 3

由支持