#ifndef RSDRIVER_H #define RSDRIVER_H #include #include #include #include #include #include #include #include "rawdata.h" #include #include #include "modulecomm.h" namespace lidar{ extern char gstr_hostip[256]; extern char gstr_port[256]; struct { std::string frame_id; ///< tf frame ID std::string model; ///< device model name int npackets; ///< number of packets to collect double rpm; ///< device rotation rate (RPMs) double time_offset; ///< time in seconds added to each time stamp bool start_from_edge; } config_; void getPacket(int n); int StartLidar_rs_m1(); void StopLidar_rs_m1(); class rsM1_Buf { private: char * mstrdata; int mnSize; //Data SizeUse QMutex mMutex; int mIndex; public: rsM1_Buf() { mstrdata = new char[BK32_DATA_BUFSIZE]; mIndex = 0; mnSize = 0; } ~rsM1_Buf() { delete mstrdata; } void WriteData(const char * strdata,const int nSize) { mMutex.lock(); memcpy(mstrdata,strdata,nSize); mnSize = nSize; mIndex++; mMutex.unlock(); } int ReadData(char * strdata,const int nRead,int * pnIndex) { int nRtn = 0; if(mnSize <= 0)return 0; mMutex.lock(); nRtn = mnSize; if(nRtn >nRead) { nRtn = nRead; std::cout<<"lidar_rsM1 rsM1_Buf ReadData data nRead = "<