Expand description
§YDLidar Driver
rust implementation of the YDLidar
§Quick Start
use ydlidar::{Lidar, TMiniPlus};
// Create a new LIDAR instance (auto-detects USB port)
let mut lidar = Lidar::<TMiniPlus>::new()?;
// Get device information
let (model, firmware, hardware) = lidar.get_device_info()?;
println!("Model: {}, Firmware: {}, Hardware: {}", model, firmware, hardware);
// Start scanning
lidar.start_scan()?;
// Read scan data
loop {
let points = lidar.get_scan_points()?;
for point in points {
println!("Angle: {:.2}°, Distance: {}mm, Quality: {}",
point.angle, point.distance, point.quality);
}
}Re-exports§
pub use crate::error::LidarError;pub use crate::lidar::Lidar;pub use crate::lidar::ScanPoint;pub use crate::types::LidarCommands;pub use crate::types::TMiniPlus;