// // Created by zx on 2021/12/15. // #ifndef SHUTTER_VERIFY_LASER_LIVOXMID70_H_ #define SHUTTER_VERIFY_LASER_LIVOXMID70_H_ #include "lds_lidar.h" #include #include #include #include #include namespace livox { #define MAX_FRAME 1024 class TimedLivoxExtendRawPoint { public: std::mutex m_mutex; LivoxExtendRawPoint* m_frame; int m_point_num; std::chrono::steady_clock::time_point m_time_point; float m_timeout; TimedLivoxExtendRawPoint(); void Reset(LivoxExtendRawPoint* data ,int count,float timeout_time=0.5); void operator=(const TimedLivoxExtendRawPoint& frame); ~TimedLivoxExtendRawPoint(); bool is_timeout(); }; class LivoxMid70 : public LdsLidar { public: LivoxMid70(); virtual ~LivoxMid70(); void SetFPS(float fps) { m_fps=fps; } pcl::PointCloud::Ptr GetCloud(); void SetTransformParam(Eigen::Vector3f rpy,Eigen::Vector3f transpose); bool is_connected(); private: virtual void LidarDataCallback(uint8_t handle, LivoxEthPacket *data,uint32_t data_num); protected: std::chrono::steady_clock::time_point m_last_data_tp; std::mutex m_mutex; TimedLivoxExtendRawPoint m_frames[MAX_FRAME]; int m_idx; float m_fps; Eigen::Affine3f m_transform; }; } #endif //SHUTTER_VERIFY_LASER_LIVOXMID70_H_