Struct rplidar_drv::RplidarDevice
source · pub struct RplidarDevice<T: ?Sized> { /* private fields */ }
Expand description
Rplidar device driver
Implementations
sourceimpl<T: ?Sized> RplidarDevice<T>where
T: Read + Write,
impl<T: ?Sized> RplidarDevice<T>where
T: Read + Write,
sourcepub fn new(channel: Channel<RplidarHostProtocol, T>) -> RplidarDevice<T>
pub fn new(channel: Channel<RplidarHostProtocol, T>) -> RplidarDevice<T>
Construct a new RplidarDevice with channel
Example
let mut serial_port = serialport::open(serial_port_name)?;
let channel = Channel::new(RplidarHostProtocol::new(), serial_port);
let rplidar_device = RplidarDevice::new(channel);
sourcepub fn with_stream(stream: Box<T>) -> RplidarDevice<T>
pub fn with_stream(stream: Box<T>) -> RplidarDevice<T>
Construct a new RplidarDevice with stream
Example
let mut serial_port = serialport::open(serial_port_name)?;
let rplidar_device = RplidarDevice::with_stream(serial_port);
sourcepub fn get_device_info(&mut self) -> Result<RplidarResponseDeviceInfo>
pub fn get_device_info(&mut self) -> Result<RplidarResponseDeviceInfo>
get device info of the RPLIDAR
sourcepub fn get_device_info_with_timeout(
&mut self,
timeout: Duration
) -> Result<RplidarResponseDeviceInfo>
pub fn get_device_info_with_timeout(
&mut self,
timeout: Duration
) -> Result<RplidarResponseDeviceInfo>
get device info of the RPLIDAR with timeout
sourcepub fn core_reset(&mut self) -> Result<()>
pub fn core_reset(&mut self) -> Result<()>
Reset RPLIDAR core
sourcepub fn set_motor_pwm(&mut self, pwm: u16) -> Result<()>
pub fn set_motor_pwm(&mut self, pwm: u16) -> Result<()>
Set motor PWM (via accessory board)
sourcepub fn stop_motor(&mut self) -> Result<()>
pub fn stop_motor(&mut self) -> Result<()>
Stop motor
sourcepub fn start_motor(&mut self) -> Result<()>
pub fn start_motor(&mut self) -> Result<()>
Start motor
sourcepub fn get_typical_scan_mode(&mut self) -> Result<u16>
pub fn get_typical_scan_mode(&mut self) -> Result<u16>
get typical scan mode of target LIDAR
sourcepub fn get_typical_scan_mode_with_timeout(
&mut self,
timeout: Duration
) -> Result<u16>
pub fn get_typical_scan_mode_with_timeout(
&mut self,
timeout: Duration
) -> Result<u16>
get typical scan mode of target LIDAR with timeout
sourcepub fn get_all_supported_scan_modes(&mut self) -> Result<Vec<ScanMode>>
pub fn get_all_supported_scan_modes(&mut self) -> Result<Vec<ScanMode>>
get all supported scan modes supported by the LIDAR
sourcepub fn get_all_supported_scan_modes_with_timeout(
&mut self,
timeout: Duration
) -> Result<Vec<ScanMode>>
pub fn get_all_supported_scan_modes_with_timeout(
&mut self,
timeout: Duration
) -> Result<Vec<ScanMode>>
get all supported scan modes supported by the LIDAR with timeout
sourcepub fn start_scan(&mut self) -> Result<ScanMode>
pub fn start_scan(&mut self) -> Result<ScanMode>
start scan
sourcepub fn start_scan_with_timeout(&mut self, timeout: Duration) -> Result<ScanMode>
pub fn start_scan_with_timeout(&mut self, timeout: Duration) -> Result<ScanMode>
start scan with timeout
sourcepub fn start_scan_with_options(
&mut self,
options: &ScanOptions
) -> Result<ScanMode>
pub fn start_scan_with_options(
&mut self,
options: &ScanOptions
) -> Result<ScanMode>
start scan with options
sourcepub fn start_scan_with_options_and_timeout(
&mut self,
options: &ScanOptions,
timeout: Duration
) -> Result<ScanMode>
pub fn start_scan_with_options_and_timeout(
&mut self,
options: &ScanOptions,
timeout: Duration
) -> Result<ScanMode>
start scan with options and non-default timeout
sourcepub fn grab_scan_point(&mut self) -> Result<ScanPoint>
pub fn grab_scan_point(&mut self) -> Result<ScanPoint>
read scan point
sourcepub fn grab_scan_point_with_timeout(
&mut self,
timeout: Duration
) -> Result<ScanPoint>
pub fn grab_scan_point_with_timeout(
&mut self,
timeout: Duration
) -> Result<ScanPoint>
read scan point with timeout
sourcepub fn grab_scan_with_timeout(
&mut self,
timeout: Duration
) -> Result<Vec<ScanPoint>>
pub fn grab_scan_with_timeout(
&mut self,
timeout: Duration
) -> Result<Vec<ScanPoint>>
read scan frame
sourcepub fn get_device_health(&mut self) -> Result<Health>
pub fn get_device_health(&mut self) -> Result<Health>
Get LIDAR health information
sourcepub fn get_device_health_with_timeout(
&mut self,
timeout: Duration
) -> Result<Health>
pub fn get_device_health_with_timeout(
&mut self,
timeout: Duration
) -> Result<Health>
Get LIDAR health information
sourcepub fn check_motor_ctrl_support(&mut self) -> Result<bool>
pub fn check_motor_ctrl_support(&mut self) -> Result<bool>
Check if the connected LIDAR supports motor control
sourcepub fn check_motor_ctrl_support_with_timeout(
&mut self,
timeout: Duration
) -> Result<bool>
pub fn check_motor_ctrl_support_with_timeout(
&mut self,
timeout: Duration
) -> Result<bool>
Check if the connected LIDAR supports motor control with timeout