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

#include <lds_lidar.h>

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

Public Member Functions

int DeInitLdsLidar (void)
 
int InitLdsLidar (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 LdsLidarGetInstance (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 IsAutoConnectMode (void)
 
bool IsBroadcastCodeExistInWhitelist (const char *broadcast_code)
 
bool IsExistInRawConfig (const char *broadcast_code)
 
 LdsLidar (uint32_t interval_ms)
 
 LdsLidar (const LdsLidar &)=delete
 
LdsLidaroperator= (const LdsLidar &)=delete
 
int ParseConfigFile (const char *pathname)
 
int ParseTimesyncConfig (rapidjson::Document &doc)
 
virtual void PrepareExit (void)
 
void ResetLdsLidar (void)
 
 ~LdsLidar ()
 

Static Private Member Functions

static void ControlFanCb (livox_status status, uint8_t handle, uint8_t response, void *clent_data)
 
static void DeviceInformationCb (livox_status status, uint8_t handle, DeviceInformationResponse *ack, void *clent_data)
 
static void GetLidarExtrinsicParameterCb (livox_status status, uint8_t handle, LidarGetExtrinsicParameterResponse *response, void *clent_data)
 
static void LidarErrorStatusCb (livox_status status, uint8_t handle, ErrorMessage *message)
 
static void OnDeviceBroadcast (const BroadcastDeviceInfo *info)
 
static void OnDeviceChange (const DeviceInfo *info, DeviceEvent type)
 
static void OnLidarDataCb (uint8_t handle, LivoxEthPacket *data, uint32_t data_num, void *client_data)
 
static void ReceiveSyncTimeCallback (const char *rmc, uint32_t rmc_length, void *client_data)
 
static void SetCoordinateCb (livox_status status, uint8_t handle, uint8_t response, void *clent_data)
 
static void SetHighSensitivityCb (livox_status status, uint8_t handle, DeviceParameterResponse *response, void *clent_data)
 
static void SetImuRatePushFrequencyCb (livox_status status, uint8_t handle, uint8_t response, void *clent_data)
 
static void SetPointCloudReturnModeCb (livox_status status, uint8_t handle, uint8_t response, void *clent_data)
 
static void SetRmcSyncTimeCb (livox_status status, uint8_t handle, uint8_t response, void *client_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]
 
std::mutex config_mutex_
 
bool enable_timesync_
 
volatile bool is_initialized_
 
std::vector< UserRawConfigraw_config_
 
TimeSynctimesync_
 
TimeSyncConfig timesync_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 dependent lidar.

Definition at line 44 of file lds_lidar.h.

Constructor & Destructor Documentation

livox_ros::LdsLidar::LdsLidar ( uint32_t  interval_ms)
private

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

Definition at line 48 of file lds_lidar.cpp.

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

Definition at line 58 of file lds_lidar.cpp.

Member Function Documentation

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

Add broadcast code to whitelist

Definition at line 557 of file lds_lidar.cpp.

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

Definition at line 733 of file lds_lidar.cpp.

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

Definition at line 347 of file lds_lidar.cpp.

int livox_ros::LdsLidar::DeInitLdsLidar ( void  )

Definition at line 137 of file lds_lidar.cpp.

void livox_ros::LdsLidar::DeviceInformationCb ( livox_status  status,
uint8_t  handle,
DeviceInformationResponse *  ack,
void *  clent_data 
)
staticprivate

Query the firmware version of Livox LiDAR.

Definition at line 310 of file lds_lidar.cpp.

void livox_ros::LdsLidar::DisableAutoConnectMode ( void  )
inlineprivate

Definition at line 99 of file lds_lidar.h.

void livox_ros::LdsLidar::EnableAutoConnectMode ( void  )
inlineprivate

Definition at line 98 of file lds_lidar.h.

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

Definition at line 46 of file lds_lidar.h.

void livox_ros::LdsLidar::GetLidarExtrinsicParameterCb ( livox_status  status,
uint8_t  handle,
LidarGetExtrinsicParameterResponse *  response,
void *  clent_data 
)
staticprivate

Callback function of get LiDARs' extrinsic parameter.

Definition at line 431 of file lds_lidar.cpp.

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

Definition at line 759 of file lds_lidar.cpp.

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

Add commandline input broadcast code

Start livox sdk to receive lidar data

Add here, only for callback use

Definition at line 62 of file lds_lidar.cpp.

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

Definition at line 100 of file lds_lidar.h.

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

Definition at line 574 of file lds_lidar.cpp.

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

Definition at line 744 of file lds_lidar.cpp.

void livox_ros::LdsLidar::LidarErrorStatusCb ( livox_status  status,
uint8_t  handle,
ErrorMessage *  message 
)
staticprivate

Callback function of Lidar error message.

Definition at line 324 of file lds_lidar.cpp.

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

Definition at line 172 of file lds_lidar.cpp.

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

Callback function of changing of device state.

Config lidar parameter

Ensure the thread safety for set_bits and connect_state

Definition at line 228 of file lds_lidar.cpp.

void livox_ros::LdsLidar::OnLidarDataCb ( uint8_t  handle,
LivoxEthPacket *  data,
uint32_t  data_num,
void *  client_data 
)
staticprivate

Static function in LdsLidar for callback or event process ----------—— Receiving point cloud data from Livox LiDAR.

Definition at line 158 of file lds_lidar.cpp.

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

Config file process

Definition at line 644 of file lds_lidar.cpp.

int livox_ros::LdsLidar::ParseTimesyncConfig ( rapidjson::Document doc)
private

Definition at line 589 of file lds_lidar.cpp.

void livox_ros::LdsLidar::PrepareExit ( void  )
privatevirtual

Reimplemented from livox_ros::Lds.

Definition at line 153 of file lds_lidar.cpp.

void livox_ros::LdsLidar::ReceiveSyncTimeCallback ( const char *  rmc,
uint32_t  rmc_length,
void *  client_data 
)
staticprivate

Definition at line 538 of file lds_lidar.cpp.

void livox_ros::LdsLidar::ResetLdsLidar ( void  )
private

Definition at line 60 of file lds_lidar.cpp.

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

Definition at line 376 of file lds_lidar.cpp.

void livox_ros::LdsLidar::SetHighSensitivityCb ( livox_status  status,
uint8_t  handle,
DeviceParameterResponse *  response,
void *  clent_data 
)
staticprivate

Definition at line 471 of file lds_lidar.cpp.

void livox_ros::LdsLidar::SetImuRatePushFrequencyCb ( livox_status  status,
uint8_t  handle,
uint8_t  response,
void *  clent_data 
)
staticprivate

Definition at line 405 of file lds_lidar.cpp.

void livox_ros::LdsLidar::SetPointCloudReturnModeCb ( livox_status  status,
uint8_t  handle,
uint8_t  response,
void *  clent_data 
)
staticprivate

Definition at line 350 of file lds_lidar.cpp.

void livox_ros::LdsLidar::SetRmcSyncTimeCb ( livox_status  status,
uint8_t  handle,
uint8_t  response,
void *  client_data 
)
staticprivate

Definition at line 529 of file lds_lidar.cpp.

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

Callback function of starting sampling.

Definition at line 501 of file lds_lidar.cpp.

void livox_ros::LdsLidar::StopSampleCb ( livox_status  status,
uint8_t  handle,
uint8_t  response,
void *  clent_data 
)
staticprivate

Callback function of stopping sampling.

Definition at line 526 of file lds_lidar.cpp.

Member Data Documentation

bool livox_ros::LdsLidar::auto_connect_mode_
private

Definition at line 107 of file lds_lidar.h.

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

Definition at line 110 of file lds_lidar.h.

std::mutex livox_ros::LdsLidar::config_mutex_
private

Definition at line 116 of file lds_lidar.h.

bool livox_ros::LdsLidar::enable_timesync_
private

Definition at line 113 of file lds_lidar.h.

volatile bool livox_ros::LdsLidar::is_initialized_
private

Definition at line 109 of file lds_lidar.h.

std::vector<UserRawConfig> livox_ros::LdsLidar::raw_config_
private

Definition at line 111 of file lds_lidar.h.

TimeSync* livox_ros::LdsLidar::timesync_
private

Definition at line 114 of file lds_lidar.h.

TimeSyncConfig livox_ros::LdsLidar::timesync_config_
private

Definition at line 115 of file lds_lidar.h.

uint32_t livox_ros::LdsLidar::whitelist_count_
private

Definition at line 108 of file lds_lidar.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