ivdriver_lidar.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef IVDRIVER_LIDAR_H
  2. #define IVDRIVER_LIDAR_H
  3. #include <QUdpSocket>
  4. #include <QNetworkDatagram>
  5. #include <vector>
  6. #include <QMutex>
  7. #include <pcl/point_cloud.h>
  8. #include <pcl/point_types.h>
  9. #include "ivdriver.h"
  10. #include "modulecomm.h"
  11. namespace iv {
  12. class ivdriver_lidar : public ivdriver
  13. {
  14. public:
  15. ivdriver_lidar();
  16. void RegisterPointMsg(const char * strmemname,iv::modulecomm::ModuleComm_TYPE xtype);
  17. void SharePointCloud(pcl::PointCloud<pcl::PointXYZI>::Ptr point_cloud);
  18. virtual void modulerun();
  19. virtual int processudpData(QByteArray ba,pcl::PointCloud<pcl::PointXYZI>::Ptr point_cloud) = 0;
  20. private:
  21. void * mpa;
  22. pcl::PointCloud<pcl::PointXYZI>::Ptr mpoint_cloud;
  23. qint64 m_seq = 0;
  24. public:
  25. char mstr_memname[256];
  26. double mfrollang = 0;
  27. double mfinclinationang_yaxis = 0; //from y axis
  28. double mfinclinationang_xaxis = 0; //from x axis
  29. char mstr_hostip[256];
  30. char mstr_port[256];
  31. double mfoffset_x = 0;
  32. double mfoffset_y = 0;
  33. double mfoffset_z = 0;
  34. bool mbinclix = false;
  35. bool mbincliy = false;
  36. // if(finclinationang_xaxis != 0.0)binclix = true;
  37. // if(finclinationang_yaxis != 0.0)bincliy = true;
  38. double mcos_finclinationang_xaxis;// = cos(mfinclinationang_xaxis);
  39. double msin_finclinationang_xaxis;// = sin(mfinclinationang_xaxis);
  40. double mcos_finclinationang_yaxis;// = cos(mfinclinationang_yaxis);
  41. double msin_finclinationang_yaxis;// = sin(mfinclinationang_yaxis);
  42. private:
  43. void threadudp();
  44. bool mbrunudpthread = false;
  45. std::vector<QByteArray> mvectorba;
  46. QMutex mMutexba;
  47. };
  48. }
  49. #endif // IVDRIVER_LIDAR_H