27 #ifndef LIVOX_ROS_DRIVER_LDS_HUB_H_ 28 #define LIVOX_ROS_DRIVER_LDS_HUB_H_ 34 #include "livox_sdk.h" 44 static LdsHub lds_hub(interval_ms);
48 int InitLdsHub(std::vector<std::string> &broadcast_code_strs,
49 const char *user_config_path);
60 uint32_t data_num,
void *client_data);
62 static void OnDeviceChange(
const DeviceInfo *info, DeviceEvent type);
64 uint8_t response,
void *clent_data);
66 uint8_t response,
void *clent_data);
68 HubQueryLidarInformationResponse *response,
71 uint8_t response,
void *clent_data);
73 livox_status status,
uint8_t handle,
74 HubSetPointCloudReturnModeResponse *response,
void *clent_data);
76 uint8_t response,
void *clent_data);
78 livox_status status,
uint8_t handle,
79 HubSetImuPushFrequencyResponse *response,
void *clent_data);
81 ErrorMessage *message);
100 for (
int i = 0; i < kMaxLidarCount; i++) {
101 if (
lidars_[i].config.set_bits) {
int AddRawUserConfig(UserRawConfig &config)
static void HubQueryLidarInfoCb(livox_status status, uint8_t handle, HubQueryLidarInformationResponse *response, void *client_data)
char broadcast_code_whitelist_[kMaxLidarCount][kBroadcastCodeSize]
static void SetCoordinateCb(livox_status status, uint8_t handle, uint8_t response, void *clent_data)
static void OnDeviceChange(const DeviceInfo *info, DeviceEvent type)
LdsHub & operator=(const LdsHub &)=delete
static void HubSetImuRatePushFrequencyCb(livox_status status, uint8_t handle, HubSetImuPushFrequencyResponse *response, void *clent_data)
static void ControlFanCb(livox_status status, uint8_t handle, uint8_t response, void *clent_data)
static void HubSetPointCloudReturnModeCb(livox_status status, uint8_t handle, HubSetPointCloudReturnModeResponse *response, void *clent_data)
static void OnDeviceBroadcast(const BroadcastDeviceInfo *info)
volatile bool is_initialized_
int AddBroadcastCodeToWhitelist(const char *broadcast_code)
bool IsExistInRawConfig(const char *broadcast_code)
UserRawConfig hub_raw_config_
static void OnHubDataCb(uint8_t hub_handle, LivoxEthPacket *data, uint32_t data_num, void *client_data)
void EnableAutoConnectMode(void)
static void StopSampleCb(livox_status status, uint8_t handle, uint8_t response, void *clent_data)
void DisableAutoConnectMode(void)
int InitLdsHub(std::vector< std::string > &broadcast_code_strs, const char *user_config_path)
int ParseConfigFile(const char *pathname)
static void ConfigPointCloudReturnMode(LdsHub *lds_hub)
uint32_t whitelist_count_
static void ConfigLidarsOfHub(LdsHub *lds_hub)
virtual void PrepareExit(void)
std::vector< UserRawConfig > lidar_raw_config_
static void StartSampleCb(livox_status status, uint8_t handle, uint8_t response, void *clent_data)
bool IsAutoConnectMode(void)
void UpdateHubLidarinfo(void)
bool IsBroadcastCodeExistInWhitelist(const char *broadcast_code)
static void ConfigImuPushFrequency(LdsHub *lds_hub)
LdsHub(uint32_t interval_ms)
LidarDevice lidars_[kMaxSourceLidar]
int GetRawConfig(const char *broadcast_code, UserRawConfig &config)
static LdsHub * GetInstance(uint32_t interval_ms)
static void HubErrorStatusCb(livox_status status, uint8_t handle, ErrorMessage *message)
bool IsAllLidarSetBitsClear()