#driver #lidar #hls #baud-rate #lds-01 #robotis #hlds

hls_lfcd_lds_driver

Rust driver for ROBOTIS HLDS HLS-LFCD-LDS (LDS-01)

7 releases

0.1.7 Oct 3, 2022
0.1.6 Jun 7, 2022
0.1.5 May 9, 2022

#811 in Asynchronous

28 downloads per month

EPL-2.0 OR Apache-2.0

23KB
309 lines

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

Dependencies

~0–14MB
~133K SLoC