Struct rplidar_driver::RplidarDevice
source · [−]pub struct RplidarDevice<T: SerialPort> { /* private fields */ }Expand description
Rplidar device driver
Implementations
sourceimpl RplidarDevice<TTYPort>
impl RplidarDevice<TTYPort>
sourcepub fn open_native_port(port_name: &str) -> Result<Self>
pub fn open_native_port(port_name: &str) -> Result<Self>
Construct a new RplidarDevice from a serial port address
You should use the open_port method if you want this boxed
sourceimpl<T> RplidarDevice<T> where
T: SerialPort,
impl<T> RplidarDevice<T> where
T: SerialPort,
sourcepub fn new(channel: Channel<RplidarHostProtocol, T>) -> Self
pub fn new(channel: Channel<RplidarHostProtocol, T>) -> Self
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(port: T) -> Self
pub fn with_stream(port: T) -> Self
Construct a new RplidarDevice with stream
Example
let mut serial_port = serialport::open(serial_port_name)?;
let rplidar_device = RplidarDevice::with_stream(serial_port);Trait Implementations
sourceimpl<T: SerialPort> Drop for RplidarDevice<T>
impl<T: SerialPort> Drop for RplidarDevice<T>
sourceimpl<T> RplidarDriver for RplidarDevice<T> where
T: SerialPort,
impl<T> RplidarDriver for RplidarDevice<T> where
T: SerialPort,
sourcefn get_device_info(&mut self) -> Result<RplidarResponseDeviceInfo>
fn get_device_info(&mut self) -> Result<RplidarResponseDeviceInfo>
get device info of the RPLIDAR
sourcefn get_device_info_with_timeout(
&mut self,
timeout: Duration
) -> Result<RplidarResponseDeviceInfo>
fn get_device_info_with_timeout(
&mut self,
timeout: Duration
) -> Result<RplidarResponseDeviceInfo>
get device info of the RPLIDAR with timeout
sourcefn core_reset(&mut self) -> Result<()>
fn core_reset(&mut self) -> Result<()>
Reset RPLIDAR core
sourcefn set_motor_pwm(&mut self, pwm: u16) -> Result<()>
fn set_motor_pwm(&mut self, pwm: u16) -> Result<()>
Set motor PWM (via accessory board)
sourcefn stop_motor(&mut self) -> Result<()>
fn stop_motor(&mut self) -> Result<()>
Stop motor
sourcefn start_motor(&mut self) -> Result<()>
fn start_motor(&mut self) -> Result<()>
Start motor
sourcefn get_typical_scan_mode(&mut self) -> Result<u16>
fn get_typical_scan_mode(&mut self) -> Result<u16>
get typical scan mode of target LIDAR
sourcefn get_typical_scan_mode_with_timeout(
&mut self,
timeout: Duration
) -> Result<u16>
fn get_typical_scan_mode_with_timeout(
&mut self,
timeout: Duration
) -> Result<u16>
get typical scan mode of target LIDAR with timeout
sourcefn get_all_supported_scan_modes(&mut self) -> Result<Vec<ScanMode>>
fn get_all_supported_scan_modes(&mut self) -> Result<Vec<ScanMode>>
get all supported scan modes supported by the LIDAR
sourcefn get_all_supported_scan_modes_with_timeout(
&mut self,
timeout: Duration
) -> Result<Vec<ScanMode>>
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
sourcefn start_scan(&mut self) -> Result<ScanMode>
fn start_scan(&mut self) -> Result<ScanMode>
start scan
sourcefn start_scan_with_timeout(&mut self, timeout: Duration) -> Result<ScanMode>
fn start_scan_with_timeout(&mut self, timeout: Duration) -> Result<ScanMode>
start scan with timeout
sourcefn start_scan_with_options(&mut self, options: &ScanOptions) -> Result<ScanMode>
fn start_scan_with_options(&mut self, options: &ScanOptions) -> Result<ScanMode>
start scan with options
sourcefn start_scan_with_options_and_timeout(
&mut self,
options: &ScanOptions,
timeout: Duration
) -> Result<ScanMode>
fn start_scan_with_options_and_timeout(
&mut self,
options: &ScanOptions,
timeout: Duration
) -> Result<ScanMode>
start scan with options and non-default timeout
sourcefn grab_scan_point(&mut self) -> Result<ScanPoint>
fn grab_scan_point(&mut self) -> Result<ScanPoint>
read scan point
sourcefn grab_scan_point_with_timeout(
&mut self,
timeout: Duration
) -> Result<ScanPoint>
fn grab_scan_point_with_timeout(
&mut self,
timeout: Duration
) -> Result<ScanPoint>
read scan point with timeout
sourcefn grab_scan_with_timeout(
&mut self,
timeout: Duration
) -> Result<Vec<ScanPoint>>
fn grab_scan_with_timeout(
&mut self,
timeout: Duration
) -> Result<Vec<ScanPoint>>
read scan frame
sourcefn get_device_health(&mut self) -> Result<Health>
fn get_device_health(&mut self) -> Result<Health>
Get LIDAR health information
sourcefn get_device_health_with_timeout(
&mut self,
timeout: Duration
) -> Result<Health>
fn get_device_health_with_timeout(
&mut self,
timeout: Duration
) -> Result<Health>
Get LIDAR health information
sourcefn check_motor_ctrl_support(&mut self) -> Result<bool>
fn check_motor_ctrl_support(&mut self) -> Result<bool>
Check if the connected LIDAR supports motor control
sourcefn check_motor_ctrl_support_with_timeout(
&mut self,
timeout: Duration
) -> Result<bool>
fn check_motor_ctrl_support_with_timeout(
&mut self,
timeout: Duration
) -> Result<bool>
Check if the connected LIDAR supports motor control with timeout
Auto Trait Implementations
impl<T> RefUnwindSafe for RplidarDevice<T> where
T: RefUnwindSafe,
impl<T> Send for RplidarDevice<T>
impl<T> Sync for RplidarDevice<T> where
T: Sync,
impl<T> Unpin for RplidarDevice<T> where
T: Unpin,
impl<T> UnwindSafe for RplidarDevice<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more