1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! # YDLidar Driver
//!
//! rust implementation of the YDLidar
//! ## Quick Start
//!
//! ```no_run
//! use ydlidar::{Lidar, TMiniPlus};
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // 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);
//! }
//! }
//! # }
//! ```
/// Command definitions for LIDAR models.
/// Error types and implementations.
/// Main LIDAR driver implementation.
/// Core types and traits.
// Re-export main types for convenience
pub use crateLidarError;
pub use crate;
pub use crate;