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.
Available as a conda package. To install, run: conda install -c paradoxdruid pylidar
If installed, use pyLIDAR
instead of python -m 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
In a shell, start pyLIDAR with appropriate port: python -m pyLIDAR -p COM4 --save
-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 is saved as a list of arrays in JSON format.