Crates.io | delta_2a_lidar |
lib.rs | delta_2a_lidar |
version | 0.1.1 |
source | src |
created_at | 2021-08-02 19:05:05.091394 |
updated_at | 2021-08-02 20:13:40.772857 |
description | A driver implementation for the 3irobotix delta-2A lidar sensor |
homepage | https://github.com/jeroenvervaeke/delta_2a_lidar |
repository | https://github.com/jeroenvervaeke/delta_2a_lidar |
max_upload_size | |
id | 430579 |
size | 1,130,244 |
This crate contains a rust driver implementation for the 3irobotix delta-2A Lidar Sensor.
file
feature)This library uses the serialport
crate which requires libudev-dev
to be installed on your system.
On Ubuntu:
sudo apt-get update && sudo apt-get install -y libudev-dev
This simple example prints all found lidar sensors.
use delta_2a_lidar::Lidar;
for sensor in Lidar::enumerate().unwrap() {
println!("Found lidar sensor: {}", sensor);
}
This simple example prints all incoming packages from the first lidar sensor we find
use delta_2a_lidar::Lidar;
// Get all lidars
let mut lidar_names = Lidar::enumerate().unwrap();
// Take the first lidar
let lidar_name = lidar_names.next().unwrap();
// Open the lidar
let mut lidar = Lidar::open(lidar_name).unwrap();
// Read packages as long as the lidar produces packages
while let Some(package) = lidar.next().await {
println!("Received package: {:?}", package);
}