hls_lfcd_lds_driver

Crates.iohls_lfcd_lds_driver
lib.rshls_lfcd_lds_driver
version0.1.7
sourcesrc
created_at2022-05-07 10:32:15.864499
updated_at2022-10-03 07:32:55.379501
descriptionRust driver for ROBOTIS HLDS HLS-LFCD-LDS (LDS-01)
homepagehttps://github.com/gabrik/hls_lfcd_lds_rs
repositoryhttps://github.com/gabrik/hls_lfcd_lds_rs
max_upload_size
id582048
size76,866
Gabriele Baldoni (gabrik)

documentation

README

Rust HLDS HLS-LFCD-LDS (LDS-01)

Crates docs.rs

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:?}")
    }
}
Commit count: 20

cargo fmt