#include <sl_lidar_driver.h>
Public Types | |
enum | { DEFAULT_TIMEOUT = 2000 } |
Public Member Functions | |
virtual sl_result | ascendScanData (sl_lidar_response_measurement_node_hq_t *nodebuffer, size_t count)=0 |
virtual sl_result | checkMotorCtrlSupport (MotorCtrlSupport &motorCtrlSupport, sl_u32 timeout=DEFAULT_TIMEOUT)=0 |
virtual sl_result | connect (IChannel *channel)=0 |
virtual void | disconnect ()=0 |
virtual sl_result | getAllSupportedScanModes (std::vector< LidarScanMode > &outModes, sl_u32 timeoutInMs=DEFAULT_TIMEOUT)=0 |
Get all scan modes that supported by lidar. More... | |
virtual sl_result | getDeviceInfo (sl_lidar_response_device_info_t &info, sl_u32 timeout=DEFAULT_TIMEOUT)=0 |
virtual sl_result | getDeviceMacAddr (sl_u8 *macAddrArray, sl_u32 timeoutInMs=DEFAULT_TIMEOUT)=0 |
virtual sl_result | getFrequency (const LidarScanMode &scanMode, const sl_lidar_response_measurement_node_hq_t *nodes, size_t count, float &frequency)=0 |
virtual sl_result | getHealth (sl_lidar_response_device_health_t &health, sl_u32 timeout=DEFAULT_TIMEOUT)=0 |
virtual sl_result | getLidarIpConf (sl_lidar_ip_conf_t &conf, sl_u32 timeout=DEFAULT_TIMEOUT)=0 |
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 | getScanDataWithIntervalHq (sl_lidar_response_measurement_node_hq_t *nodebuffer, size_t &count)=0 |
virtual sl_result | getTypicalScanMode (sl_u16 &outMode, sl_u32 timeoutInMs=DEFAULT_TIMEOUT)=0 |
Get typical scan mode of lidar. More... | |
virtual sl_result | grabScanDataHq (sl_lidar_response_measurement_node_hq_t *nodebuffer, size_t &count, sl_u32 timeout=DEFAULT_TIMEOUT)=0 |
virtual sl_result | grabScanDataHqWithTimeStamp (sl_lidar_response_measurement_node_hq_t *nodebuffer, size_t &count, sl_u64 ×tamp_uS, sl_u32 timeout=DEFAULT_TIMEOUT)=0 |
virtual bool | isConnected ()=0 |
virtual sl_result | negotiateSerialBaudRate (sl_u32 requiredBaudRate, sl_u32 *baudRateDetected=NULL)=0 |
virtual sl_result | reset (sl_u32 timeoutInMs=DEFAULT_TIMEOUT)=0 |
virtual sl_result | setLidarIpConf (const sl_lidar_ip_conf_t &conf, sl_u32 timeout=DEFAULT_TIMEOUT)=0 |
virtual sl_result | setMotorSpeed (sl_u16 speed=DEFAULT_MOTOR_SPEED)=0 |
virtual sl_result | startScan (bool force, bool useTypicalScan, sl_u32 options=0, LidarScanMode *outUsedScanMode=nullptr)=0 |
virtual sl_result | startScanExpress (bool force, sl_u16 scanMode, sl_u32 options=0, LidarScanMode *outUsedScanMode=nullptr, sl_u32 timeout=DEFAULT_TIMEOUT)=0 |
virtual sl_result | stop (sl_u32 timeout=DEFAULT_TIMEOUT)=0 |
virtual | ~ILidarDriver () |
Definition at line 306 of file sl_lidar_driver.h.
anonymous enum |
Enumerator | |
---|---|
DEFAULT_TIMEOUT |
Definition at line 330 of file sl_lidar_driver.h.
|
inlinevirtual |
Definition at line 309 of file sl_lidar_driver.h.
|
pure virtual |
Ascending the scan data according to the angle value in the scan.
nodebuffer | Buffer provided by the caller application to do the reorder. Should be retrived from the grabScanData |
count | The 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. |
Implemented in sl::SlamtecLidarDriver, and sl::SL_LidarDriver.
|
pure virtual |
Check whether the device support motor control Note: this API will disable grab.
motorCtrlSupport | Return the result. |
timeout | The operation timeout value (in millisecond) for the serial port communication. |
Implemented in sl::SlamtecLidarDriver, and sl::SL_LidarDriver.
Connect to LIDAR via channel
channel | The communication channel Note: you should manage the lifecycle of the channel object, make sure it is alive during lidar driver's lifecycle |
Implemented in sl::SlamtecLidarDriver, and sl::SL_LidarDriver.
|
pure virtual |
Disconnect from the LIDAR
Implemented in sl::SlamtecLidarDriver, and sl::SL_LidarDriver.
|
pure virtual |
Get all scan modes that supported by lidar.
Implemented in sl::SlamtecLidarDriver, and sl::SL_LidarDriver.
|
pure virtual |
Get the device information of the RPLIDAR include the serial number, firmware version, device model etc.
info | The device information returned from the RPLIDAR |
timeout | The operation timeout value (in millisecond) for the serial port communication |
Implemented in sl::SlamtecLidarDriver, and sl::SL_LidarDriver.
|
pure virtual |
Get LPX series lidar's MAC address
macAddrArray | The 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 |
Implemented in sl::SlamtecLidarDriver, and sl::SL_LidarDriver.
|
pure 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
scanMode | Lidar's current scan mode |
nodes | Current scan's measurements |
count | The number of sample nodes inside the given buffer |
Implemented in sl::SlamtecLidarDriver, and sl::SL_LidarDriver.
|
pure 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.
health | The health status info returned from the RPLIDAR |
timeout | The operation timeout value (in millisecond) for the serial port communication |
Implemented in sl::SlamtecLidarDriver, and sl::SL_LidarDriver.
|
pure virtual |
Get LPX and S2E series lidar's static IP address
conf | Network parameter that LPX series lidar owned |
timeout | The operation timeout value (in millisecond) for the ethernet udp communication |
Implemented in sl::SlamtecLidarDriver, and sl::SL_LidarDriver.
|
pure virtual |
Get the Major Type (Series Info) of the LIDAR
devInfo | The device info used to deduct the result If NULL is specified, a driver cached version of the connected LIDAR will be used |
Implemented in sl::SlamtecLidarDriver.
|
pure virtual |
Get the technology of the LIDAR's measurement system
devInfo | The device info used to deduct the result If NULL is specified, a driver cached version of the connected LIDAR will be used |
Implemented in sl::SlamtecLidarDriver.
|
pure virtual |
Get the Model Name of the LIDAR The result will be somthing like: "A1M8" or "S1M1" or "A3M1-R1"
out_description | The output string that contains the generated model name |
fetchAliasName | If set to true, a communication will be taken to ask if there is any Alias name availabe |
devInfo | The device info used to deduct the result If NULL is specified, a driver cached version of the connected LIDAR will be used |
timeout | The timeout value used by potential data communication |
Implemented in sl::SlamtecLidarDriver.
|
pure virtual |
Get the motor information of the RPLIDAR include the max speed, min speed, desired speed.
motorInfo | The motor information returned from the RPLIDAR |
Implemented in sl::SlamtecLidarDriver.
|
pure virtual |
Return received scan points even if it's not complete scan
nodebuffer | Buffer provided by the caller application to store the scan data |
count | Once 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.
Implemented in sl::SlamtecLidarDriver, and sl::SL_LidarDriver.
|
pure virtual |
Get typical scan mode of lidar.
Implemented in sl::SlamtecLidarDriver, and sl::SL_LidarDriver.
|
pure 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.
nodebuffer | Buffer provided by the caller application to store the scan data |
count | The 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. |
timeout | Max 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.
Implemented in sl::SlamtecLidarDriver, and sl::SL_LidarDriver.
|
pure virtual |
Wait and grab a complete 0-360 degree scan data previously received with timestamp support.
The returned timestamp belongs to the first data point of the scan data (begining of the scan). Its value is represented based on the current machine's time domain with the unit of microseconds (uS).
If the currently connected LIDAR supports hardware timestamp mechanism, this timestamp will use the actual data emitted by the LIDAR device and remap it to the current machine's time domain.
For other models that do not support hardware timestamps, this data will be deducted through estimation, and there may be a slight deviation from the actual situation.
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.
nodebuffer | Buffer provided by the caller application to store the scan data |
count | The 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. |
timestamp_uS | The reference used to store the timestamp value. |
timeout | Max 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.
Implemented in sl::SlamtecLidarDriver.
|
pure virtual |
Check if the connection is established
Implemented in sl::SlamtecLidarDriver, and sl::SL_LidarDriver.
|
pure 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.
requiredBaudRate | The new baudrate required to be used. It MUST matches with the baudrate of the binded channel. |
baudRateDetected | The actual baudrate detected by the LIDAR system |
Implemented in sl::SL_LidarDriver, and sl::SlamtecLidarDriver.
|
pure 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.
timeout | The operation timeout value (in millisecond) |
Implemented in sl::SlamtecLidarDriver, and sl::SL_LidarDriver.
|
pure virtual |
Set LPX and S2E series lidar's static IP address
conf | Network parameter that LPX series lidar owned |
timeout | The operation timeout value (in millisecond) for the ethernet udp communication |
Implemented in sl::SlamtecLidarDriver, and sl::SL_LidarDriver.
|
pure virtual |
Set lidar motor speed The host system can use this operation to set lidar motor speed.
speed | The speed value set to lidar |
Note: The function will stop scan if speed is DEFAULT_MOTOR_SPEED.
Implemented in sl::SlamtecLidarDriver, and sl::SL_LidarDriver.
|
pure virtual |
Start scan
force | Force the core system to output scan data regardless whether the scanning motor is rotating or not. |
useTypicalScan | Use lidar's typical scan mode or use the compatibility mode (2k sps) |
options | Scan options (please use 0) |
outUsedScanMode | The scan mode selected by lidar |
Implemented in sl::SlamtecLidarDriver, and sl::SL_LidarDriver.
|
pure virtual |
Start scan in specific mode
force | Force the core system to output scan data regardless whether the scanning motor is rotating or not. |
scanMode | The scan mode id (use getAllSupportedScanModes to get supported modes) |
options | Scan options (please use 0) |
outUsedScanMode | The scan mode selected by lidar |
Implemented in sl::SlamtecLidarDriver, and sl::SL_LidarDriver.
|
pure virtual |
Ask the LIDAR core system to stop the current scan operation and enter idle state. The background thread will be terminated
timeout | The operation timeout value (in millisecond) for the serial port communication |
Implemented in sl::SlamtecLidarDriver, and sl::SL_LidarDriver.