1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- //
- // Created by zx on 2021/12/15.
- //
- #ifndef SHUTTER_VERIFY_LASER_LIVOXMID70_H_
- #define SHUTTER_VERIFY_LASER_LIVOXMID70_H_
- #include "lds_lidar.h"
- #include <pcl/point_types.h>
- #include <pcl/point_cloud.h>
- #include <pcl/io/pcd_io.h>
- #include <pcl/common/transforms.h>
- #include <mutex>
- 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<pcl::PointXYZ>::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_
|