arci/traits/
laser_scan.rs

1use auto_impl::auto_impl;
2
3use crate::error::Error;
4
5#[derive(Clone, Debug, Default, PartialEq)]
6pub struct Scan2D {
7    /// The angle (in radians) where the scan starts, typically 0 for positive X-axis.
8    pub angle_min: f64,
9    /// The angle (in radians) where the scan ends, typically positive for CCW scans.
10    pub angle_max: f64,
11    /// The angular difference (in radians) between consecutive scans.
12    pub angle_increment: f64,
13    /// The time difference (in seconds) between consecutive measurements.
14    pub time_increment: f64,
15    /// The time (in seconds) it takes for the laser to complete one scan.
16    pub scan_time: f64,
17    /// The minimum range (in meters) of valid distance measurements.
18    pub range_min: f64,
19    /// The maximum range (in meters) of valid distance measurements.
20    pub range_max: f64,
21    /// An array of distance measurements (in meters) for each angle.
22    pub ranges: Vec<f64>,
23    /// (Optional) An array of intensity values for each angle, not supported by all LIDAR sensors.
24    pub intensities: Vec<f64>,
25}
26
27#[auto_impl(Box, Arc)]
28pub trait LaserScan2D: Send + Sync {
29    fn current_scan(&self) -> Result<Scan2D, Error>;
30}