Namespaces | |
crc32 | |
Classes | |
class | IChannel |
class | ILidarDriver |
class | ISerialPortChannel |
struct | LidarMotorInfo |
struct | LidarScanMode |
struct | Result |
class | SerialPortChannel |
class | SL_LidarDriver |
class | SlamtecLidarDriver |
class | TcpChannel |
class | UdpChannel |
Enumerations | |
enum | ChannelType { CHANNEL_TYPE_SERIALPORT = 0x0, CHANNEL_TYPE_TCP = 0x1, CHANNEL_TYPE_UDP = 0x2 } |
enum | MotorCtrlSupport { MotorCtrlSupportNone = 0, MotorCtrlSupportPwm = 1, MotorCtrlSupportRpm = 2 } |
Functions | |
static sl_u32 | _varbitscale_decode (sl_u32 scaled, sl_u32 &scaleLevel) |
template<class TNode > | |
static bool | angleLessThan (const TNode &a, const TNode &b) |
template<class TNode > | |
static sl_result | ascendScanData_ (TNode *nodebuffer, size_t count) |
static void | convert (const sl_lidar_response_measurement_node_t &from, sl_lidar_response_measurement_node_hq_t &to) |
static void | convert (const sl_lidar_response_measurement_node_hq_t &from, sl_lidar_response_measurement_node_t &to) |
Result< ILidarDriver * > | createLidarDriver () |
Result< IChannel * > | createSerialPortChannel (const std::string &device, int baudrate) |
Result< IChannel * > | createTcpChannel (const std::string &ip, int port) |
Result< IChannel * > | createUdpChannel (const std::string &ip, int port) |
static float | getAngle (const sl_lidar_response_measurement_node_t &node) |
static float | getAngle (const sl_lidar_response_measurement_node_hq_t &node) |
static sl_u16 | getDistanceQ2 (const sl_lidar_response_measurement_node_t &node) |
static sl_u32 | getDistanceQ2 (const sl_lidar_response_measurement_node_hq_t &node) |
static void | printDeprecationWarn (const char *fn, const char *replacement) |
static void | setAngle (sl_lidar_response_measurement_node_t &node, float v) |
static void | setAngle (sl_lidar_response_measurement_node_hq_t &node, float v) |
Variables | |
struct sl::LidarScanMode | __attribute__ |
enum sl::ChannelType |
Enumerator | |
---|---|
CHANNEL_TYPE_SERIALPORT | |
CHANNEL_TYPE_TCP | |
CHANNEL_TYPE_UDP |
Definition at line 230 of file sl_lidar_driver.h.
enum sl::MotorCtrlSupport |
Enumerator | |
---|---|
MotorCtrlSupportNone | |
MotorCtrlSupportPwm | |
MotorCtrlSupportRpm |
Definition at line 223 of file sl_lidar_driver.h.
|
static |
Definition at line 79 of file sl_lidar_driver.cpp.
|
static |
Definition at line 147 of file sl_lidar_driver.cpp.
|
static |
Definition at line 153 of file sl_lidar_driver.cpp.
|
static |
Definition at line 64 of file sl_lidar_driver.cpp.
|
static |
Definition at line 72 of file sl_lidar_driver.cpp.
Result< ILidarDriver * > sl::createLidarDriver | ( | ) |
Create a LIDAR driver instance
Example Result<ISerialChannel*> channel = createSerialPortChannel("/dev/ttyUSB0", 115200); assert((bool)channel); assert(*channel);
auto lidar = createLidarDriver(); assert((bool)lidar); assert(*lidar);
auto res = (*lidar)->connect(*channel); assert(SL_IS_OK(res));
sl_lidar_response_device_info_t deviceInfo; res = (*lidar)->getDeviceInfo(deviceInfo); assert(SL_IS_OK(res));
printf("Model: %d, Firmware Version: %d.%d, Hardware Version: %d\n", deviceInfo.model, deviceInfo.firmware_version >> 8, deviceInfo.firmware_version & 0xffu, deviceInfo.hardware_version);
delete *lidar; delete *channel;
Definition at line 1983 of file sl_lidar_driver.cpp.
Create a serial channel
device | Serial port device e.g. on Windows, it may be com3 or \. on Unix-Like OS, it may be /dev/ttyS1, /dev/ttyUSB2, etc |
baudrate | Baudrate Please refer to the datasheet for the baudrate (maybe 115200 or 256000) |
Definition at line 115 of file sl_serial_channel.cpp.
Create a TCP channel
ip | IP address of the device |
port | TCP port |
Definition at line 101 of file sl_tcp_channel.cpp.
Create a UDP channel
ip | IP address of the device |
port | UDP port |
Definition at line 111 of file sl_udp_channel.cpp.
|
inlinestatic |
Definition at line 115 of file sl_lidar_driver.cpp.
|
inlinestatic |
Definition at line 126 of file sl_lidar_driver.cpp.
|
inlinestatic |
Definition at line 136 of file sl_lidar_driver.cpp.
|
inlinestatic |
Definition at line 141 of file sl_lidar_driver.cpp.
|
static |
Definition at line 59 of file sl_lidar_driver.cpp.
|
inlinestatic |
Definition at line 120 of file sl_lidar_driver.cpp.
|
inlinestatic |
Definition at line 131 of file sl_lidar_driver.cpp.
struct sl::LidarScanMode sl::__attribute__ |