Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
livox_ros::LdsHub Class Reference

#include <lds_hub.h>

Inheritance diagram for livox_ros::LdsHub:
Inheritance graph
[legend]

Public Member Functions

int DeInitLdsHub (void)
 
int InitLdsHub (std::vector< std::string > &broadcast_code_strs, const char *user_config_path)
 
- Public Member Functions inherited from livox_ros::Lds
void CleanRequestExit ()
 
uint8_t GetDeviceType (uint8_t handle)
 
bool IsAllQueueEmpty ()
 
bool IsAllQueueReadStop ()
 
bool IsRequestExit ()
 
 Lds (uint32_t buffer_time_ms, uint8_t data_src)
 
void RequestExit ()
 
void ResetLds (uint8_t data_src)
 
void StorageRawPacket (uint8_t handle, LivoxEthPacket *eth_packet)
 
void UpdateLidarInfoByEthPacket (LidarDevice *p_lidar, LivoxEthPacket *eth_packet)
 
virtual ~Lds ()
 

Static Public Member Functions

static LdsHubGetInstance (uint32_t interval_ms)
 
- Static Public Member Functions inherited from livox_ros::Lds
static void ResetLidar (LidarDevice *lidar, uint8_t data_src)
 
static void SetLidarDataSrc (LidarDevice *lidar, uint8_t data_src)
 

Private Member Functions

int AddBroadcastCodeToWhitelist (const char *broadcast_code)
 
int AddRawUserConfig (UserRawConfig &config)
 
void DisableAutoConnectMode (void)
 
void EnableAutoConnectMode (void)
 
int GetRawConfig (const char *broadcast_code, UserRawConfig &config)
 
bool IsAllLidarSetBitsClear ()
 
bool IsAutoConnectMode (void)
 
bool IsBroadcastCodeExistInWhitelist (const char *broadcast_code)
 
bool IsExistInRawConfig (const char *broadcast_code)
 
 LdsHub (uint32_t interval_ms)
 
 LdsHub (const LdsHub &)=delete
 
LdsHuboperator= (const LdsHub &)=delete
 
int ParseConfigFile (const char *pathname)
 
virtual void PrepareExit (void)
 
void ResetLdsHub (void)
 
void StateReset (void)
 
void UpdateHubLidarinfo (void)
 
 ~LdsHub ()
 

Static Private Member Functions

static void ConfigImuPushFrequency (LdsHub *lds_hub)
 
static void ConfigLidarsOfHub (LdsHub *lds_hub)
 
static void ConfigPointCloudReturnMode (LdsHub *lds_hub)
 
static void ControlFanCb (livox_status status, uint8_t handle, uint8_t response, void *clent_data)
 
static void HubErrorStatusCb (livox_status status, uint8_t handle, ErrorMessage *message)
 
static void HubQueryLidarInfoCb (livox_status status, uint8_t handle, HubQueryLidarInformationResponse *response, void *client_data)
 
static void HubSetImuRatePushFrequencyCb (livox_status status, uint8_t handle, HubSetImuPushFrequencyResponse *response, void *clent_data)
 
static void HubSetPointCloudReturnModeCb (livox_status status, uint8_t handle, HubSetPointCloudReturnModeResponse *response, void *clent_data)
 
static void OnDeviceBroadcast (const BroadcastDeviceInfo *info)
 
static void OnDeviceChange (const DeviceInfo *info, DeviceEvent type)
 
static void OnHubDataCb (uint8_t hub_handle, LivoxEthPacket *data, uint32_t data_num, void *client_data)
 
static void SetCoordinateCb (livox_status status, uint8_t handle, uint8_t response, void *clent_data)
 
static void StartSampleCb (livox_status status, uint8_t handle, uint8_t response, void *clent_data)
 
static void StopSampleCb (livox_status status, uint8_t handle, uint8_t response, void *clent_data)
 

Private Attributes

bool auto_connect_mode_
 
char broadcast_code_whitelist_ [kMaxLidarCount][kBroadcastCodeSize]
 
LidarDevice hub_
 
UserRawConfig hub_raw_config_
 
volatile bool is_initialized_
 
std::vector< UserRawConfiglidar_raw_config_
 
uint32_t whitelist_count_
 

Additional Inherited Members

- Public Attributes inherited from livox_ros::Lds
uint8_t lidar_count_
 
LidarDevice lidars_ [kMaxSourceLidar]
 
Semaphore semaphore_
 
- Protected Attributes inherited from livox_ros::Lds
uint32_t buffer_time_ms_
 
uint8_t data_src_
 

Detailed Description

LiDAR data source, data from hub.

Definition at line 41 of file lds_hub.h.

Constructor & Destructor Documentation

livox_ros::LdsHub::LdsHub ( uint32_t  interval_ms)
private

Global function for common use -------------------------------------—— Lds hub function ------------------------------------------------------—

Definition at line 46 of file lds_hub.cpp.

livox_ros::LdsHub::LdsHub ( const LdsHub )
privatedelete
livox_ros::LdsHub::~LdsHub ( )
private

Definition at line 57 of file lds_hub.cpp.

Member Function Documentation

int livox_ros::LdsHub::AddBroadcastCodeToWhitelist ( const char *  broadcast_code)
private

Add broadcast code to whitelist

Definition at line 503 of file lds_hub.cpp.

int livox_ros::LdsHub::AddRawUserConfig ( UserRawConfig config)
private

Definition at line 667 of file lds_hub.cpp.

void livox_ros::LdsHub::ConfigImuPushFrequency ( LdsHub lds_hub)
staticprivate

Definition at line 450 of file lds_hub.cpp.

void livox_ros::LdsHub::ConfigLidarsOfHub ( LdsHub lds_hub)
staticprivate

Definition at line 484 of file lds_hub.cpp.

void livox_ros::LdsHub::ConfigPointCloudReturnMode ( LdsHub lds_hub)
staticprivate

Definition at line 415 of file lds_hub.cpp.

void livox_ros::LdsHub::ControlFanCb ( livox_status  status,
uint8_t  handle,
uint8_t  response,
void *  clent_data 
)
staticprivate

Definition at line 314 of file lds_hub.cpp.

int livox_ros::LdsHub::DeInitLdsHub ( void  )

Definition at line 124 of file lds_hub.cpp.

void livox_ros::LdsHub::DisableAutoConnectMode ( void  )
inlineprivate

Definition at line 93 of file lds_hub.h.

void livox_ros::LdsHub::EnableAutoConnectMode ( void  )
inlineprivate

Definition at line 92 of file lds_hub.h.

static LdsHub* livox_ros::LdsHub::GetInstance ( uint32_t  interval_ms)
inlinestatic

Definition at line 43 of file lds_hub.h.

int livox_ros::LdsHub::GetRawConfig ( const char *  broadcast_code,
UserRawConfig config 
)
private

Definition at line 693 of file lds_hub.cpp.

void livox_ros::LdsHub::HubErrorStatusCb ( livox_status  status,
uint8_t  handle,
ErrorMessage *  message 
)
staticprivate

Callback function of hub error message.

Definition at line 296 of file lds_hub.cpp.

void livox_ros::LdsHub::HubQueryLidarInfoCb ( livox_status  status,
uint8_t  handle,
HubQueryLidarInformationResponse *  response,
void *  client_data 
)
staticprivate

Definition at line 251 of file lds_hub.cpp.

void livox_ros::LdsHub::HubSetImuRatePushFrequencyCb ( livox_status  status,
uint8_t  handle,
HubSetImuPushFrequencyResponse *  response,
void *  clent_data 
)
staticprivate

Definition at line 365 of file lds_hub.cpp.

void livox_ros::LdsHub::HubSetPointCloudReturnModeCb ( livox_status  status,
uint8_t  handle,
HubSetPointCloudReturnModeResponse *  response,
void *  clent_data 
)
staticprivate

Definition at line 317 of file lds_hub.cpp.

int livox_ros::LdsHub::InitLdsHub ( std::vector< std::string > &  broadcast_code_strs,
const char *  user_config_path 
)

Start livox sdk to receive lidar data

Add here, only for callback use

Definition at line 64 of file lds_hub.cpp.

bool livox_ros::LdsHub::IsAllLidarSetBitsClear ( )
inlineprivate

Definition at line 99 of file lds_hub.h.

bool livox_ros::LdsHub::IsAutoConnectMode ( void  )
inlineprivate

Definition at line 94 of file lds_hub.h.

bool livox_ros::LdsHub::IsBroadcastCodeExistInWhitelist ( const char *  broadcast_code)
private

Definition at line 520 of file lds_hub.cpp.

bool livox_ros::LdsHub::IsExistInRawConfig ( const char *  broadcast_code)
private

Definition at line 678 of file lds_hub.cpp.

void livox_ros::LdsHub::OnDeviceBroadcast ( const BroadcastDeviceInfo *  info)
staticprivate

Definition at line 157 of file lds_hub.cpp.

void livox_ros::LdsHub::OnDeviceChange ( const DeviceInfo *  info,
DeviceEvent  type 
)
staticprivate

Callback function of changing of device state.

Definition at line 214 of file lds_hub.cpp.

void livox_ros::LdsHub::OnHubDataCb ( uint8_t  hub_handle,
LivoxEthPacket *  data,
uint32_t  data_num,
void *  client_data 
)
staticprivate

Static function in LdsLidar for callback

Caculate which lidar the eth packet data belong to

Definition at line 139 of file lds_hub.cpp.

LdsHub& livox_ros::LdsHub::operator= ( const LdsHub )
privatedelete
int livox_ros::LdsHub::ParseConfigFile ( const char *  pathname)
private

Config file process

Definition at line 561 of file lds_hub.cpp.

void livox_ros::LdsHub::PrepareExit ( void  )
privatevirtual

Reimplemented from livox_ros::Lds.

Definition at line 136 of file lds_hub.cpp.

void livox_ros::LdsHub::ResetLdsHub ( void  )
private

Definition at line 59 of file lds_hub.cpp.

void livox_ros::LdsHub::SetCoordinateCb ( livox_status  status,
uint8_t  handle,
uint8_t  response,
void *  clent_data 
)
staticprivate

Definition at line 338 of file lds_hub.cpp.

void livox_ros::LdsHub::StartSampleCb ( livox_status  status,
uint8_t  handle,
uint8_t  response,
void *  clent_data 
)
staticprivate

Callback function of starting sampling.

Definition at line 387 of file lds_hub.cpp.

void livox_ros::LdsHub::StateReset ( void  )
private
void livox_ros::LdsHub::StopSampleCb ( livox_status  status,
uint8_t  handle,
uint8_t  response,
void *  clent_data 
)
staticprivate

Callback function of stopping sampling.

Definition at line 412 of file lds_hub.cpp.

void livox_ros::LdsHub::UpdateHubLidarinfo ( void  )
private

Get and update LiDAR info

Definition at line 536 of file lds_hub.cpp.

Member Data Documentation

bool livox_ros::LdsHub::auto_connect_mode_
private

Definition at line 108 of file lds_hub.h.

char livox_ros::LdsHub::broadcast_code_whitelist_[kMaxLidarCount][kBroadcastCodeSize]
private

Definition at line 111 of file lds_hub.h.

LidarDevice livox_ros::LdsHub::hub_
private

Definition at line 113 of file lds_hub.h.

UserRawConfig livox_ros::LdsHub::hub_raw_config_
private

Definition at line 116 of file lds_hub.h.

volatile bool livox_ros::LdsHub::is_initialized_
private

Definition at line 110 of file lds_hub.h.

std::vector<UserRawConfig> livox_ros::LdsHub::lidar_raw_config_
private

Definition at line 115 of file lds_hub.h.

uint32_t livox_ros::LdsHub::whitelist_count_
private

Definition at line 109 of file lds_hub.h.


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


livox_ros_driver
Author(s): Livox Dev Team
autogenerated on Mon Mar 15 2021 02:40:46