Skip to main content

LidarController

Trait LidarController 

Source
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§

Source

type Scan: Send + Sync

Scan type produced by this LiDAR

Required Methods§

Source

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.

Source

fn info(&self) -> LidarInfo

Get LiDAR information

Source

fn field_of_view(&self) -> FieldOfView

Get field of view

Provided Methods§

Source

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,

Set motor speed (for spinning LiDARs)

Sets the rotation speed in RPM. Not all LiDARs support variable speed.

Source

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,

Get current motor speed (for spinning LiDARs)

Source

fn is_3d(&self) -> bool

Check if this is a 3D LiDAR

Source

fn has_intensity(&self) -> bool

Check if this LiDAR provides intensity data

Implementors§