Crates.io | hls_lfcd_lds_driver |
lib.rs | hls_lfcd_lds_driver |
version | 0.1.7 |
source | src |
created_at | 2022-05-07 10:32:15.864499 |
updated_at | 2022-10-03 07:32:55.379501 |
description | Rust driver for ROBOTIS HLDS HLS-LFCD-LDS (LDS-01) |
homepage | https://github.com/gabrik/hls_lfcd_lds_rs |
repository | https://github.com/gabrik/hls_lfcd_lds_rs |
max_upload_size | |
id | 582048 |
size | 76,866 |
This is a rust version of ROBOTIS HLDS HLS-LFCD-LDS (LDS-01) driver. Please refer to the ROBOTIS repository for more information.
Reading data from the lidar.
use clap::Parser;
use hls_lfcd_lds_driver::{LFCDLaser, DEFAULT_BAUD_RATE, DEFAULT_PORT};
#[derive(Parser, Debug)]
struct Args {
#[clap(short, long, default_value = DEFAULT_PORT)]
port: String,
#[clap(short, long, default_value = DEFAULT_BAUD_RATE)]
baud_rate: u32,
}
#[tokio::main]
async fn main() -> tokio_serial::Result<()> {
let args = Args::parse();
println!(
"Going to open LDS01 on {} with {}",
args.port, args.baud_rate
);
let mut port = LFCDLaser::new(args.port, args.baud_rate)?;
loop {
let reading = port.read().await?;
println!("Reading: {reading:?}")
}
}