pub trait LidarController: Controller {
type Scan: Send + Sync;
// Required methods
fn get_scan<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Self::Scan, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn info(&self) -> LidarInfo;
fn field_of_view(&self) -> FieldOfView;
// Provided methods
fn set_motor_speed<'life0, 'async_trait>(
&'life0 mut self,
_rpm: u16,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self::Error: From<ControllerError>,
Self: Send + 'async_trait,
'life0: 'async_trait { ... }
fn get_motor_speed<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u16, Self::Error>> + Send + 'async_trait>>
where Self::Error: From<ControllerError>,
Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn is_3d(&self) -> bool { ... }
fn has_intensity(&self) -> bool { ... }
}Expand description
LiDAR controller trait
Provides a unified interface for different LiDAR types:
- 2D scanning LiDARs (RPLidar, SICK TiM/LMS)
- 3D spinning LiDARs (Velodyne, Ouster)
- Solid-state LiDARs
Required Associated Types§
Required Methods§
Sourcefn get_scan<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Self::Scan, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_scan<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Self::Scan, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the next scan from the LiDAR
This will block until a complete scan is available or an error occurs.
Sourcefn field_of_view(&self) -> FieldOfView
fn field_of_view(&self) -> FieldOfView
Get field of view
Provided Methods§
Sourcefn set_motor_speed<'life0, 'async_trait>(
&'life0 mut self,
_rpm: u16,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
fn set_motor_speed<'life0, 'async_trait>( &'life0 mut self, _rpm: u16, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
Set motor speed (for spinning LiDARs)
Sets the rotation speed in RPM. Not all LiDARs support variable speed.
Sourcefn get_motor_speed<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u16, Self::Error>> + Send + 'async_trait>>
fn get_motor_speed<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u16, Self::Error>> + Send + 'async_trait>>
Get current motor speed (for spinning LiDARs)
Sourcefn has_intensity(&self) -> bool
fn has_intensity(&self) -> bool
Check if this LiDAR provides intensity data