Template Class LidarDriver
Defined in File lidar_driver.hpp
Class Documentation
-
template<typename T_PointCloud>
class LidarDriver This is the RoboSense LiDAR driver interface class.
Public Functions
-
inline LidarDriver()
Constructor, instanciate the driver pointer.
Register the lidar point cloud callback function to driver. When point cloud is ready, this function will be called.
- Parameters:
callback – The callback function
Register the imu data callback function to driver. When imu data is ready, this function will be called.
- Parameters:
callback – The callback function
-
inline void regPacketCallback(const std::function<void(const Packet&)> &cb_put_pkt)
Register the lidar difop packet message callback function to driver. When lidar difop packet message is ready, this function will be called.
- Parameters:
callback – The callback function
-
inline void regExceptionCallback(const std::function<void(const Error&)> &cb_excep)
Register the exception message callback function to driver. When error occurs, this function will be called.
- Parameters:
callback – The callback function
-
inline bool init(const RSDriverParam ¶m)
The initialization function, used to set up parameters and instance objects, used when get packets from online lidar or pcap.
- Parameters:
param – The custom struct RSDriverParam
- Returns:
If successful, return true; else return false
-
inline bool start()
Start the thread to receive and decode packets.
- Returns:
If successful, return true; else return false
-
inline void decodePacket(const Packet &pkt)
Decode lidar msop/difop messages.
- Parameters:
pkt_msg – The lidar msop/difop packet
-
inline bool getTemperature(float &temp)
Get the current lidar temperature.
- Parameters:
temp – The variable to store lidar temperature
- Returns:
if get temperature successfully, return true; else return false
-
inline bool getDeviceInfo(DeviceInfo &info)
Get device info.
- Parameters:
info – The variable to store device info
- Returns:
if get device info successfully, return true; else return false
-
inline bool getDeviceStatus(DeviceStatus &status)
Get device status.
- Parameters:
info – The variable to store device status
- Returns:
if get device info successfully, return true; else return false
-
inline void stop()
Stop all threads.
-
inline LidarDriver()