12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #ifndef IVDRIVER_LIDAR_H
- #define IVDRIVER_LIDAR_H
- #include <QUdpSocket>
- #include <QNetworkDatagram>
- #include <vector>
- #include <QMutex>
- #include <pcl/point_cloud.h>
- #include <pcl/point_types.h>
- #include "ivdriver.h"
- #include "modulecomm.h"
- namespace iv {
- class ivdriver_lidar : public ivdriver
- {
- public:
- ivdriver_lidar();
- void RegisterPointMsg(const char * strmemname,iv::modulecomm::ModuleComm_TYPE xtype);
- void SharePointCloud(pcl::PointCloud<pcl::PointXYZI>::Ptr point_cloud);
- virtual void modulerun();
- virtual int processudpData(QByteArray ba,pcl::PointCloud<pcl::PointXYZI>::Ptr point_cloud) = 0;
- private:
- void * mpa;
- pcl::PointCloud<pcl::PointXYZI>::Ptr mpoint_cloud;
- qint64 m_seq = 0;
- public:
- char mstr_memname[256];
- double mfrollang = 0;
- double mfinclinationang_yaxis = 0; //from y axis
- double mfinclinationang_xaxis = 0; //from x axis
- char mstr_hostip[256];
- char mstr_port[256];
- double mfoffset_x = 0;
- double mfoffset_y = 0;
- double mfoffset_z = 0;
- bool mbinclix = false;
- bool mbincliy = false;
- // if(finclinationang_xaxis != 0.0)binclix = true;
- // if(finclinationang_yaxis != 0.0)bincliy = true;
- double mcos_finclinationang_xaxis;// = cos(mfinclinationang_xaxis);
- double msin_finclinationang_xaxis;// = sin(mfinclinationang_xaxis);
- double mcos_finclinationang_yaxis;// = cos(mfinclinationang_yaxis);
- double msin_finclinationang_yaxis;// = sin(mfinclinationang_yaxis);
- private:
- void threadudp();
- bool mbrunudpthread = false;
- std::vector<QByteArray> mvectorba;
- QMutex mMutexba;
- };
- }
- #endif // IVDRIVER_LIDAR_H
|