Skip to content

Paradoxdruid/pyLIDAR

Repository files navigation

pyLIDAR

CodeFactor Codacy Badge CodeQL CI Code style: black GitHub

Anaconda-Server Badge

LDRobot makes a LD06 LiDAR sensor that has been widely adapted for applications such as Raspberry Pi.

This repository has some scripts to interact with the serial data from the LD06, making readings from the instrument available as well-structured dataclasses in Python, or automatically graphing input in real-time.

Install

Available as a conda package. To install, run: conda install -c paradoxdruid pylidar

If installed, use pyLIDAR instead of python -m pyLIDAR

Test pyLIDAR

In one shell, start the test server: python -m pyLIDAR.example_server

In another, start pyLIDAR, specifying the "test" port: python -m pyLIDAR -p test --save --graph

Usage with LD06 LIDAR

In a shell, start pyLIDAR with appropriate port: python -m pyLIDAR -p COM4 --save

Command Line Options

-p PORT or --port PORT specifies LD06 port (use -p test to connect to test server)

-s or --save save collected data to a timestamped JSON file

-g or --graph display live-updating graph of data

Data format

Data is saved as a list of arrays in JSON format.

Sample Output

Sample Output