Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
sl::SL_LidarDriver Class Reference

#include <sl_lidar_driver_impl.h>

Inheritance diagram for sl::SL_LidarDriver:
Inheritance graph
[legend]

Public Types

enum  { LEGACY_SAMPLE_DURATION = 476 }
 
enum  { NORMAL_CAPSULE = 0, DENSE_CAPSULE = 1 }
 
enum  { A2A3_LIDAR_MINUM_MAJOR_ID = 2, TOF_LIDAR_MINUM_MAJOR_ID = 6 }
 
- Public Types inherited from sl::ILidarDriver
enum  { DEFAULT_TIMEOUT = 2000 }
 

Public Member Functions

sl_result ascendScanData (sl_lidar_response_measurement_node_hq_t *nodebuffer, size_t count)
 
sl_result ascendScanData (sl_lidar_response_measurement_node_t *nodebuffer, size_t count)
 
sl_result checkMotorCtrlSupport (MotorCtrlSupport &support, sl_u32 timeout=DEFAULT_TIMEOUT)
 
sl_result connect (IChannel *channel)
 
 DEPRECATED (sl_result grabScanData(sl_lidar_response_measurement_node_t *nodebuffer, size_t &count, sl_u32 timeout=DEFAULT_TIMEOUT))
 
void disconnect ()
 
sl_result getAllSupportedScanModes (std::vector< LidarScanMode > &outModes, sl_u32 timeoutInMs=DEFAULT_TIMEOUT)
 Get all scan modes that supported by lidar. More...
 
sl_result getDeviceInfo (sl_lidar_response_device_info_t &info, sl_u32 timeout=DEFAULT_TIMEOUT)
 
sl_result getDeviceMacAddr (sl_u8 *macAddrArray, sl_u32 timeoutInMs)
 
sl_result getFrequency (const LidarScanMode &scanMode, const sl_lidar_response_measurement_node_hq_t *nodes, size_t count, float &frequency)
 
sl_result getHealth (sl_lidar_response_device_health_t &health, sl_u32 timeout=DEFAULT_TIMEOUT)
 
sl_result getLidarIpConf (sl_lidar_ip_conf_t &conf, sl_u32 timeout)
 
sl_result getScanDataWithIntervalHq (sl_lidar_response_measurement_node_hq_t *nodebuffer, size_t &count)
 
sl_result getTypicalScanMode (sl_u16 &outMode, sl_u32 timeoutInMs=DEFAULT_TIMEOUT)
 Get typical scan mode of lidar. More...
 
sl_result grabScanDataHq (sl_lidar_response_measurement_node_hq_t *nodebuffer, size_t &count, sl_u32 timeout=DEFAULT_TIMEOUT)
 
bool isConnected ()
 
sl_result negotiateSerialBaudRate (sl_u32 requiredBaudRate, sl_u32 *baudRateDetected=NULL)
 
sl_result reset (sl_u32 timeoutInMs=DEFAULT_TIMEOUT)
 
sl_result setLidarIpConf (const sl_lidar_ip_conf_t &conf, sl_u32 timeout)
 
sl_result setMotorSpeed (sl_u16 speed=DEFAULT_MOTOR_PWM)
 
 SL_LidarDriver ()
 
sl_result startScan (bool force, bool useTypicalScan, sl_u32 options=0, LidarScanMode *outUsedScanMode=nullptr)
 
sl_result startScanExpress (bool force, sl_u16 scanMode, sl_u32 options=0, LidarScanMode *outUsedScanMode=nullptr, sl_u32 timeout=DEFAULT_TIMEOUT)
 
sl_result startScanNormal (bool force, sl_u32 timeout=DEFAULT_TIMEOUT)
 
sl_result stop (sl_u32 timeout=DEFAULT_TIMEOUT)
 
- Public Member Functions inherited from sl::ILidarDriver
virtual LIDARMajorType getLIDARMajorType (const sl_lidar_response_device_info_t *devInfo=nullptr)=0
 
virtual LIDARTechnologyType getLIDARTechnologyType (const sl_lidar_response_device_info_t *devInfo=nullptr)=0
 
virtual sl_result getModelNameDescriptionString (std::string &out_description, bool fetchAliasName=true, const sl_lidar_response_device_info_t *devInfo=nullptr, sl_u32 timeout=DEFAULT_TIMEOUT)=0
 
virtual sl_result getMotorInfo (LidarMotorInfo &motorInfo, sl_u32 timeoutInMs=DEFAULT_TIMEOUT)=0
 
virtual sl_result grabScanDataHqWithTimeStamp (sl_lidar_response_measurement_node_hq_t *nodebuffer, size_t &count, sl_u64 &timestamp_uS, sl_u32 timeout=DEFAULT_TIMEOUT)=0
 
virtual ~ILidarDriver ()
 

Protected Member Functions

sl_result checkSupportConfigCommands (bool &outSupport, sl_u32 timeoutInMs=DEFAULT_TIMEOUT)
 
sl_result getLidarConf (sl_u32 type, std::vector< sl_u8 > &outputBuf, const std::vector< sl_u8 > &reserve=std::vector< sl_u8 >(), sl_u32 timeout=DEFAULT_TIMEOUT)
 
sl_result getLidarSampleDuration (float &sampleDurationRes, sl_u16 scanModeID, sl_u32 timeoutInMs=DEFAULT_TIMEOUT)
 
sl_result getMaxDistance (float &maxDistance, sl_u16 scanModeID, sl_u32 timeoutInMs=DEFAULT_TIMEOUT)
 
sl_result getScanModeAnsType (sl_u8 &ansType, sl_u16 scanModeID, sl_u32 timeoutInMs=DEFAULT_TIMEOUT)
 
sl_result getScanModeCount (sl_u16 &modeCount, sl_u32 timeoutInMs=DEFAULT_TIMEOUT)
 
sl_result getScanModeName (char *modeName, sl_u16 scanModeID, sl_u32 timeoutInMs=DEFAULT_TIMEOUT)
 
sl_result setLidarConf (sl_u32 type, const void *payload, size_t payloadSize, sl_u32 timeout)
 
sl_result startMotor ()
 

Private Member Functions

sl_result _cacheCapsuledScanData ()
 
sl_result _cacheHqScanData ()
 
sl_result _cacheScanData ()
 
sl_result _cacheUltraCapsuledScanData ()
 
sl_result _cacheUltraDenseCapsuledScanData ()
 
void _capsuleToNormal (const sl_lidar_response_capsule_measurement_nodes_t &capsule, sl_lidar_response_measurement_node_hq_t *nodebuffer, size_t &nodeCount)
 
sl_result _clearRxDataCache ()
 
void _dense_capsuleToNormal (const sl_lidar_response_capsule_measurement_nodes_t &capsule, sl_lidar_response_measurement_node_hq_t *nodebuffer, size_t &nodeCount)
 
void _disableDataGrabbing ()
 
void _HqToNormal (const sl_lidar_response_hq_capsule_measurement_nodes_t &node_hq, sl_lidar_response_measurement_node_hq_t *nodebuffer, size_t &nodeCount)
 
sl_result _sendCommand (sl_u16 cmd, const void *payload=NULL, size_t payloadsize=0)
 
void _ultra_dense_capsuleToNormal (const sl_lidar_response_ultra_dense_capsule_measurement_nodes_t &capslue, sl_lidar_response_measurement_node_hq_t *nodebuffer, size_t &nodeCount)
 
void _ultraCapsuleToNormal (const sl_lidar_response_ultra_capsule_measurement_nodes_t &capsule, sl_lidar_response_measurement_node_hq_t *nodebuffer, size_t &nodeCount)
 
sl_result _waitCapsuledNode (sl_lidar_response_capsule_measurement_nodes_t &node, sl_u32 timeout=DEFAULT_TIMEOUT)
 
sl_result _waitHqNode (sl_lidar_response_hq_capsule_measurement_nodes_t &node, sl_u32 timeout=DEFAULT_TIMEOUT)
 
sl_result _waitNode (sl_lidar_response_measurement_node_t *node, sl_u32 timeout=DEFAULT_TIMEOUT)
 
template<typename T >
sl_result _waitResponse (T &payload, sl_u8 ansType, sl_u32 timeout=DEFAULT_TIMEOUT)
 
sl_result _waitResponseHeader (sl_lidar_ans_header_t *header, sl_u32 timeout=DEFAULT_TIMEOUT)
 
sl_result _waitScanData (sl_lidar_response_measurement_node_t *nodebuffer, size_t &count, sl_u32 timeout=DEFAULT_TIMEOUT)
 
sl_result _waitUltraCapsuledNode (sl_lidar_response_ultra_capsule_measurement_nodes_t &node, sl_u32 timeout=DEFAULT_TIMEOUT)
 
sl_result _waitUltraDenseCapsuledNode (sl_lidar_response_ultra_dense_capsule_measurement_nodes_t &node, sl_u32 timeout=DEFAULT_TIMEOUT)
 

Private Attributes

sl_u8 _cached_capsule_flag
 
sl_lidar_response_capsule_measurement_nodes_t _cached_previous_capsuledata
 
sl_lidar_response_dense_capsule_measurement_nodes_t _cached_previous_dense_capsuledata
 
sl_lidar_response_hq_capsule_measurement_nodes_t _cached_previous_Hqdata
 
sl_lidar_response_ultra_capsule_measurement_nodes_t _cached_previous_ultracapsuledata
 
sl_u16 _cached_sampleduration_express
 
sl_u16 _cached_sampleduration_std
 
sl_lidar_response_measurement_node_hq_t _cached_scan_node_hq_buf [8192]
 
sl_lidar_response_measurement_node_hq_t _cached_scan_node_hq_buf_for_interval_retrieve [8192]
 
size_t _cached_scan_node_hq_count
 
size_t _cached_scan_node_hq_count_for_interval_retrieve
 
rp::hal::Thread _cachethread
 
IChannel_channel
 
rp::hal::Event _dataEvt
 
bool _is_previous_capsuledataRdy
 
bool _is_previous_HqdataRdy
 
bool _isConnected
 
bool _isScanning
 
MotorCtrlSupport _isSupportingMotorCtrl
 
rp::hal::Locker _lock
 

Detailed Description

Definition at line 36 of file sl_lidar_driver_impl.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
LEGACY_SAMPLE_DURATION 

Definition at line 39 of file sl_lidar_driver_impl.h.

◆ anonymous enum

anonymous enum
Enumerator
NORMAL_CAPSULE 
DENSE_CAPSULE 

Definition at line 43 of file sl_lidar_driver_impl.h.

◆ anonymous enum

anonymous enum
Enumerator
A2A3_LIDAR_MINUM_MAJOR_ID 
TOF_LIDAR_MINUM_MAJOR_ID 

Definition at line 49 of file sl_lidar_driver_impl.h.

Constructor & Destructor Documentation

◆ SL_LidarDriver()

sl::SL_LidarDriver::SL_LidarDriver ( )
inline

Definition at line 54 of file sl_lidar_driver_impl.h.

Member Function Documentation

◆ _cacheCapsuledScanData()

sl_result sl::SL_LidarDriver::_cacheCapsuledScanData ( )
private

◆ _cacheHqScanData()

sl_result sl::SL_LidarDriver::_cacheHqScanData ( )
private

◆ _cacheScanData()

sl_result sl::SL_LidarDriver::_cacheScanData ( )
private

◆ _cacheUltraCapsuledScanData()

sl_result sl::SL_LidarDriver::_cacheUltraCapsuledScanData ( )
private

◆ _cacheUltraDenseCapsuledScanData()

sl_result sl::SL_LidarDriver::_cacheUltraDenseCapsuledScanData ( )
private

◆ _capsuleToNormal()

void sl::SL_LidarDriver::_capsuleToNormal ( const sl_lidar_response_capsule_measurement_nodes_t &  capsule,
sl_lidar_response_measurement_node_hq_t nodebuffer,
size_t &  nodeCount 
)
private

◆ _clearRxDataCache()

sl_result sl::SL_LidarDriver::_clearRxDataCache ( )
private

◆ _dense_capsuleToNormal()

void sl::SL_LidarDriver::_dense_capsuleToNormal ( const sl_lidar_response_capsule_measurement_nodes_t &  capsule,
sl_lidar_response_measurement_node_hq_t nodebuffer,
size_t &  nodeCount 
)
private

◆ _disableDataGrabbing()

void sl::SL_LidarDriver::_disableDataGrabbing ( )
private

◆ _HqToNormal()

void sl::SL_LidarDriver::_HqToNormal ( const sl_lidar_response_hq_capsule_measurement_nodes_t &  node_hq,
sl_lidar_response_measurement_node_hq_t nodebuffer,
size_t &  nodeCount 
)
private

◆ _sendCommand()

sl_result sl::SL_LidarDriver::_sendCommand ( sl_u16  cmd,
const void *  payload = NULL,
size_t  payloadsize = 0 
)
private

◆ _ultra_dense_capsuleToNormal()

void sl::SL_LidarDriver::_ultra_dense_capsuleToNormal ( const sl_lidar_response_ultra_dense_capsule_measurement_nodes_t &  capslue,
sl_lidar_response_measurement_node_hq_t nodebuffer,
size_t &  nodeCount 
)
private

◆ _ultraCapsuleToNormal()

void sl::SL_LidarDriver::_ultraCapsuleToNormal ( const sl_lidar_response_ultra_capsule_measurement_nodes_t &  capsule,
sl_lidar_response_measurement_node_hq_t nodebuffer,
size_t &  nodeCount 
)
private

◆ _waitCapsuledNode()

sl_result sl::SL_LidarDriver::_waitCapsuledNode ( sl_lidar_response_capsule_measurement_nodes_t &  node,
sl_u32  timeout = DEFAULT_TIMEOUT 
)
private

◆ _waitHqNode()

sl_result sl::SL_LidarDriver::_waitHqNode ( sl_lidar_response_hq_capsule_measurement_nodes_t &  node,
sl_u32  timeout = DEFAULT_TIMEOUT 
)
private

◆ _waitNode()

sl_result sl::SL_LidarDriver::_waitNode ( sl_lidar_response_measurement_node_t *  node,
sl_u32  timeout = DEFAULT_TIMEOUT 
)
private

◆ _waitResponse()

template<typename T >
sl_result sl::SL_LidarDriver::_waitResponse ( T &  payload,
sl_u8  ansType,
sl_u32  timeout = DEFAULT_TIMEOUT 
)
private

◆ _waitResponseHeader()

sl_result sl::SL_LidarDriver::_waitResponseHeader ( sl_lidar_ans_header_t header,
sl_u32  timeout = DEFAULT_TIMEOUT 
)
private

◆ _waitScanData()

sl_result sl::SL_LidarDriver::_waitScanData ( sl_lidar_response_measurement_node_t *  nodebuffer,
size_t &  count,
sl_u32  timeout = DEFAULT_TIMEOUT 
)
private

◆ _waitUltraCapsuledNode()

sl_result sl::SL_LidarDriver::_waitUltraCapsuledNode ( sl_lidar_response_ultra_capsule_measurement_nodes_t &  node,
sl_u32  timeout = DEFAULT_TIMEOUT 
)
private

◆ _waitUltraDenseCapsuledNode()

sl_result sl::SL_LidarDriver::_waitUltraDenseCapsuledNode ( sl_lidar_response_ultra_dense_capsule_measurement_nodes_t &  node,
sl_u32  timeout = DEFAULT_TIMEOUT 
)
private

◆ ascendScanData() [1/2]

sl_result sl::SL_LidarDriver::ascendScanData ( sl_lidar_response_measurement_node_hq_t nodebuffer,
size_t  count 
)
virtual

Ascending the scan data according to the angle value in the scan.

Parameters
nodebufferBuffer provided by the caller application to do the reorder. Should be retrived from the grabScanData
countThe caller must initialize this parameter to set the max data count of the provided buffer (in unit of rplidar_response_measurement_node_t). Once the interface returns, this parameter will store the actual received data count. The interface will return SL_RESULT_OPERATION_FAIL when all the scan data is invalid.

Implements sl::ILidarDriver.

◆ ascendScanData() [2/2]

sl_result sl::SL_LidarDriver::ascendScanData ( sl_lidar_response_measurement_node_t *  nodebuffer,
size_t  count 
)

◆ checkMotorCtrlSupport()

sl_result sl::SL_LidarDriver::checkMotorCtrlSupport ( MotorCtrlSupport motorCtrlSupport,
sl_u32  timeout = DEFAULT_TIMEOUT 
)
virtual

Check whether the device support motor control Note: this API will disable grab.

Parameters
motorCtrlSupportReturn the result.
timeoutThe operation timeout value (in millisecond) for the serial port communication.

Implements sl::ILidarDriver.

◆ checkSupportConfigCommands()

sl_result sl::SL_LidarDriver::checkSupportConfigCommands ( bool &  outSupport,
sl_u32  timeoutInMs = DEFAULT_TIMEOUT 
)
protected

◆ connect()

sl_result sl::SL_LidarDriver::connect ( IChannel channel)
virtual

Connect to LIDAR via channel

Parameters
channelThe communication channel Note: you should manage the lifecycle of the channel object, make sure it is alive during lidar driver's lifecycle

Implements sl::ILidarDriver.

◆ DEPRECATED()

sl::SL_LidarDriver::DEPRECATED ( sl_result   grabScanDatasl_lidar_response_measurement_node_t *nodebuffer, size_t &count, sl_u32 timeout=DEFAULT_TIMEOUT)

◆ disconnect()

void sl::SL_LidarDriver::disconnect ( )
virtual

Disconnect from the LIDAR

Implements sl::ILidarDriver.

◆ getAllSupportedScanModes()

sl_result sl::SL_LidarDriver::getAllSupportedScanModes ( std::vector< LidarScanMode > &  outModes,
sl_u32  timeoutInMs = DEFAULT_TIMEOUT 
)
virtual

Get all scan modes that supported by lidar.

Implements sl::ILidarDriver.

◆ getDeviceInfo()

sl_result sl::SL_LidarDriver::getDeviceInfo ( sl_lidar_response_device_info_t &  info,
sl_u32  timeout = DEFAULT_TIMEOUT 
)
virtual

Get the device information of the RPLIDAR include the serial number, firmware version, device model etc.

Parameters
infoThe device information returned from the RPLIDAR
timeoutThe operation timeout value (in millisecond) for the serial port communication

Implements sl::ILidarDriver.

◆ getDeviceMacAddr()

sl_result sl::SL_LidarDriver::getDeviceMacAddr ( sl_u8 *  macAddrArray,
sl_u32  timeoutInMs 
)
virtual

Get LPX series lidar's MAC address

Parameters
macAddrArrayThe device MAC information returned from the LPX series lidar Notice: the macAddrArray must point to a valid buffer with at least 6 bytes length Otherwise, buffer overwrite will occur

Implements sl::ILidarDriver.

◆ getFrequency()

sl_result sl::SL_LidarDriver::getFrequency ( const LidarScanMode scanMode,
const sl_lidar_response_measurement_node_hq_t nodes,
size_t  count,
float &  frequency 
)
virtual

Calculate LIDAR's current scanning frequency from the given scan data Please refer to the application note doc for details Remark: the calcuation will be incorrect if the specified scan data doesn't contains enough data

Parameters
scanModeLidar's current scan mode
nodesCurrent scan's measurements
countThe number of sample nodes inside the given buffer

Implements sl::ILidarDriver.

◆ getHealth()

sl_result sl::SL_LidarDriver::getHealth ( sl_lidar_response_device_health_t &  health,
sl_u32  timeout = DEFAULT_TIMEOUT 
)
virtual

Retrieve the health status of the RPLIDAR The host system can use this operation to check whether RPLIDAR is in the self-protection mode.

Parameters
healthThe health status info returned from the RPLIDAR
timeoutThe operation timeout value (in millisecond) for the serial port communication

Implements sl::ILidarDriver.

◆ getLidarConf()

sl_result sl::SL_LidarDriver::getLidarConf ( sl_u32  type,
std::vector< sl_u8 > &  outputBuf,
const std::vector< sl_u8 > &  reserve = std::vector< sl_u8 >(),
sl_u32  timeout = DEFAULT_TIMEOUT 
)
protected

◆ getLidarIpConf()

sl_result sl::SL_LidarDriver::getLidarIpConf ( sl_lidar_ip_conf_t &  conf,
sl_u32  timeout 
)
virtual

Get LPX and S2E series lidar's static IP address

Parameters
confNetwork parameter that LPX series lidar owned
timeoutThe operation timeout value (in millisecond) for the ethernet udp communication

Implements sl::ILidarDriver.

◆ getLidarSampleDuration()

sl_result sl::SL_LidarDriver::getLidarSampleDuration ( float &  sampleDurationRes,
sl_u16  scanModeID,
sl_u32  timeoutInMs = DEFAULT_TIMEOUT 
)
protected

◆ getMaxDistance()

sl_result sl::SL_LidarDriver::getMaxDistance ( float &  maxDistance,
sl_u16  scanModeID,
sl_u32  timeoutInMs = DEFAULT_TIMEOUT 
)
protected

◆ getScanDataWithIntervalHq()

sl_result sl::SL_LidarDriver::getScanDataWithIntervalHq ( sl_lidar_response_measurement_node_hq_t nodebuffer,
size_t &  count 
)
virtual

Return received scan points even if it's not complete scan

Parameters
nodebufferBuffer provided by the caller application to store the scan data
countOnce the interface returns, this parameter will store the actual received data count.

The interface will return SL_RESULT_OPERATION_TIMEOUT to indicate that not even a single node can be retrieved since last call.

Implements sl::ILidarDriver.

◆ getScanModeAnsType()

sl_result sl::SL_LidarDriver::getScanModeAnsType ( sl_u8 &  ansType,
sl_u16  scanModeID,
sl_u32  timeoutInMs = DEFAULT_TIMEOUT 
)
protected

◆ getScanModeCount()

sl_result sl::SL_LidarDriver::getScanModeCount ( sl_u16 &  modeCount,
sl_u32  timeoutInMs = DEFAULT_TIMEOUT 
)
protected

◆ getScanModeName()

sl_result sl::SL_LidarDriver::getScanModeName ( char *  modeName,
sl_u16  scanModeID,
sl_u32  timeoutInMs = DEFAULT_TIMEOUT 
)
protected

◆ getTypicalScanMode()

sl_result sl::SL_LidarDriver::getTypicalScanMode ( sl_u16 &  outMode,
sl_u32  timeoutInMs = DEFAULT_TIMEOUT 
)
virtual

Get typical scan mode of lidar.

Implements sl::ILidarDriver.

◆ grabScanDataHq()

sl_result sl::SL_LidarDriver::grabScanDataHq ( sl_lidar_response_measurement_node_hq_t nodebuffer,
size_t &  count,
sl_u32  timeout = DEFAULT_TIMEOUT 
)
virtual

Wait and grab a complete 0-360 degree scan data previously received. The grabbed scan data returned by this interface always has the following charactistics:

1) The first node of the grabbed data array (nodebuffer[0]) must be the first sample of a scan, i.e. the start_bit == 1 2) All data nodes are belong to exactly ONE complete 360-degrees's scan 3) Note, the angle data in one scan may not be ascending. You can use API ascendScanData to reorder the nodebuffer.

Parameters
nodebufferBuffer provided by the caller application to store the scan data
countThe caller must initialize this parameter to set the max data count of the provided buffer (in unit of rplidar_response_measurement_node_t). Once the interface returns, this parameter will store the actual received data count.
timeoutMax duration allowed to wait for a complete scan data, nothing will be stored to the nodebuffer if a complete 360-degrees' scan data cannot to be ready timely.

The interface will return SL_RESULT_OPERATION_TIMEOUT to indicate that no complete 360-degrees' scan can be retrieved withing the given timeout duration.

\The caller application can set the timeout value to Zero(0) to make this interface always returns immediately to achieve non-block operation.

Implements sl::ILidarDriver.

◆ isConnected()

bool sl::SL_LidarDriver::isConnected ( )
virtual

Check if the connection is established

Implements sl::ILidarDriver.

◆ negotiateSerialBaudRate()

sl_result sl::SL_LidarDriver::negotiateSerialBaudRate ( sl_u32  requiredBaudRate,
sl_u32 *  baudRateDetected = NULL 
)
virtual

Ask the LIDAR to use a new baudrate for serial communication The target LIDAR system must support such feature to work. This function does NOT check whether the target LIDAR works with the requiredBaudRate or not. In order to verifiy the result, use getDeviceInfo or other getXXXX functions instead.

Parameters
requiredBaudRateThe new baudrate required to be used. It MUST matches with the baudrate of the binded channel.
baudRateDetectedThe actual baudrate detected by the LIDAR system

Implements sl::ILidarDriver.

◆ reset()

sl_result sl::SL_LidarDriver::reset ( sl_u32  timeoutInMs = DEFAULT_TIMEOUT)
virtual

Ask the LIDAR core system to reset it self The host system can use the Reset operation to help LIDAR escape the self-protection mode.

Parameters
timeoutThe operation timeout value (in millisecond)

Implements sl::ILidarDriver.

◆ setLidarConf()

sl_result sl::SL_LidarDriver::setLidarConf ( sl_u32  type,
const void *  payload,
size_t  payloadSize,
sl_u32  timeout 
)
protected

◆ setLidarIpConf()

sl_result sl::SL_LidarDriver::setLidarIpConf ( const sl_lidar_ip_conf_t &  conf,
sl_u32  timeout 
)
virtual

Set LPX and S2E series lidar's static IP address

Parameters
confNetwork parameter that LPX series lidar owned
timeoutThe operation timeout value (in millisecond) for the ethernet udp communication

Implements sl::ILidarDriver.

◆ setMotorSpeed()

sl_result sl::SL_LidarDriver::setMotorSpeed ( sl_u16  speed = DEFAULT_MOTOR_PWM)
virtual

Set lidar motor speed The host system can use this operation to set lidar motor speed.

Parameters
speedThe speed value set to lidar

Note: The function will stop scan if speed is DEFAULT_MOTOR_SPEED.

Implements sl::ILidarDriver.

◆ startMotor()

sl_result sl::SL_LidarDriver::startMotor ( )
protected

◆ startScan()

sl_result sl::SL_LidarDriver::startScan ( bool  force,
bool  useTypicalScan,
sl_u32  options = 0,
LidarScanMode outUsedScanMode = nullptr 
)
virtual

Start scan

Parameters
forceForce the core system to output scan data regardless whether the scanning motor is rotating or not.
useTypicalScanUse lidar's typical scan mode or use the compatibility mode (2k sps)
optionsScan options (please use 0)
outUsedScanModeThe scan mode selected by lidar

Implements sl::ILidarDriver.

◆ startScanExpress()

sl_result sl::SL_LidarDriver::startScanExpress ( bool  force,
sl_u16  scanMode,
sl_u32  options = 0,
LidarScanMode outUsedScanMode = nullptr,
sl_u32  timeout = DEFAULT_TIMEOUT 
)
virtual

Start scan in specific mode

Parameters
forceForce the core system to output scan data regardless whether the scanning motor is rotating or not.
scanModeThe scan mode id (use getAllSupportedScanModes to get supported modes)
optionsScan options (please use 0)
outUsedScanModeThe scan mode selected by lidar

Implements sl::ILidarDriver.

◆ startScanNormal()

sl_result sl::SL_LidarDriver::startScanNormal ( bool  force,
sl_u32  timeout = DEFAULT_TIMEOUT 
)

◆ stop()

sl_result sl::SL_LidarDriver::stop ( sl_u32  timeout = DEFAULT_TIMEOUT)
virtual

Ask the LIDAR core system to stop the current scan operation and enter idle state. The background thread will be terminated

Parameters
timeoutThe operation timeout value (in millisecond) for the serial port communication

Implements sl::ILidarDriver.

Member Data Documentation

◆ _cached_capsule_flag

sl_u8 sl::SL_LidarDriver::_cached_capsule_flag
private

Definition at line 144 of file sl_lidar_driver_impl.h.

◆ _cached_previous_capsuledata

sl_lidar_response_capsule_measurement_nodes_t sl::SL_LidarDriver::_cached_previous_capsuledata
private

Definition at line 149 of file sl_lidar_driver_impl.h.

◆ _cached_previous_dense_capsuledata

sl_lidar_response_dense_capsule_measurement_nodes_t sl::SL_LidarDriver::_cached_previous_dense_capsuledata
private

Definition at line 150 of file sl_lidar_driver_impl.h.

◆ _cached_previous_Hqdata

sl_lidar_response_hq_capsule_measurement_nodes_t sl::SL_LidarDriver::_cached_previous_Hqdata
private

Definition at line 152 of file sl_lidar_driver_impl.h.

◆ _cached_previous_ultracapsuledata

sl_lidar_response_ultra_capsule_measurement_nodes_t sl::SL_LidarDriver::_cached_previous_ultracapsuledata
private

Definition at line 151 of file sl_lidar_driver_impl.h.

◆ _cached_sampleduration_express

sl_u16 sl::SL_LidarDriver::_cached_sampleduration_express
private

Definition at line 140 of file sl_lidar_driver_impl.h.

◆ _cached_sampleduration_std

sl_u16 sl::SL_LidarDriver::_cached_sampleduration_std
private

Definition at line 139 of file sl_lidar_driver_impl.h.

◆ _cached_scan_node_hq_buf

sl_lidar_response_measurement_node_hq_t sl::SL_LidarDriver::_cached_scan_node_hq_buf[8192]
private

Definition at line 142 of file sl_lidar_driver_impl.h.

◆ _cached_scan_node_hq_buf_for_interval_retrieve

sl_lidar_response_measurement_node_hq_t sl::SL_LidarDriver::_cached_scan_node_hq_buf_for_interval_retrieve[8192]
private

Definition at line 146 of file sl_lidar_driver_impl.h.

◆ _cached_scan_node_hq_count

size_t sl::SL_LidarDriver::_cached_scan_node_hq_count
private

Definition at line 143 of file sl_lidar_driver_impl.h.

◆ _cached_scan_node_hq_count_for_interval_retrieve

size_t sl::SL_LidarDriver::_cached_scan_node_hq_count_for_interval_retrieve
private

Definition at line 147 of file sl_lidar_driver_impl.h.

◆ _cachethread

rp::hal::Thread sl::SL_LidarDriver::_cachethread
private

Definition at line 138 of file sl_lidar_driver_impl.h.

◆ _channel

IChannel* sl::SL_LidarDriver::_channel
private

Definition at line 131 of file sl_lidar_driver_impl.h.

◆ _dataEvt

rp::hal::Event sl::SL_LidarDriver::_dataEvt
private

Definition at line 137 of file sl_lidar_driver_impl.h.

◆ _is_previous_capsuledataRdy

bool sl::SL_LidarDriver::_is_previous_capsuledataRdy
private

Definition at line 153 of file sl_lidar_driver_impl.h.

◆ _is_previous_HqdataRdy

bool sl::SL_LidarDriver::_is_previous_HqdataRdy
private

Definition at line 154 of file sl_lidar_driver_impl.h.

◆ _isConnected

bool sl::SL_LidarDriver::_isConnected
private

Definition at line 132 of file sl_lidar_driver_impl.h.

◆ _isScanning

bool sl::SL_LidarDriver::_isScanning
private

Definition at line 133 of file sl_lidar_driver_impl.h.

◆ _isSupportingMotorCtrl

MotorCtrlSupport sl::SL_LidarDriver::_isSupportingMotorCtrl
private

Definition at line 134 of file sl_lidar_driver_impl.h.

◆ _lock

rp::hal::Locker sl::SL_LidarDriver::_lock
private

Definition at line 136 of file sl_lidar_driver_impl.h.


The documentation for this class was generated from the following file:


rplidar_ros
Author(s):
autogenerated on Fri Aug 2 2024 08:42:14