7 releases
0.1.7 | Oct 3, 2022 |
---|---|
0.1.6 | Jun 7, 2022 |
0.1.5 | May 9, 2022 |
#692 in Asynchronous
23KB
309 lines
Rust HLDS HLS-LFCD-LDS (LDS-01)
This is a rust version of ROBOTIS HLDS HLS-LFCD-LDS (LDS-01) driver. Please refer to the ROBOTIS repository for more information.
Example
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:?}")
}
}
Dependencies
~0–14MB
~138K SLoC