mainwindow.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3. #include <QMainWindow>
  4. #include <pcl/visualization/cloud_viewer.h>
  5. #include <iostream>
  6. #include <pcl/io/io.h>
  7. #include <pcl/io/pcd_io.h>
  8. #include <QCoreApplication>
  9. #include <thread>
  10. #include <mutex>
  11. #include "modulecomm.h"
  12. #include "ndtpos.pb.h"
  13. #include "relocate.pb.h"
  14. #include "pcdmap.pb.h"
  15. #include <QLabel>
  16. struct pose
  17. {
  18. double x;
  19. double y;
  20. double z;
  21. double roll;
  22. double pitch;
  23. double yaw;
  24. double vx;
  25. double vy;
  26. };
  27. namespace Ui {
  28. class MainWindow;
  29. }
  30. class MainWindow : public QMainWindow
  31. {
  32. Q_OBJECT
  33. public:
  34. explicit MainWindow(QWidget *parent = 0);
  35. ~MainWindow();
  36. signals:
  37. void ndtposupdate();
  38. private slots:
  39. void on_pushButton_Test_clicked();
  40. void on_pushButton_EnableRelocation_clicked();
  41. void on_horizontalSlider_valueChanged(int value);
  42. void on_checkBox_clicked();
  43. void on_comboBox_currentIndexChanged(int index);
  44. void onndtposupdate();
  45. private:
  46. void threadpcdview();
  47. private:
  48. void UpdateNDTPos(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname);
  49. void UpdatePCDMap(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname);
  50. private:
  51. Ui::MainWindow *ui;
  52. pcl::visualization::CloudViewer * mpviewer;
  53. std::thread * mpthreadpcd;
  54. bool mbRun = true;
  55. void * mpandtpos;
  56. void * mparelocate;
  57. void * mpapcdmap;
  58. pose mCurPose;
  59. iv::lidar::ndtpos mndtpos;
  60. std::mutex mmutexndtpos;
  61. bool mbndtposupdate = false;
  62. QLabel * mpLabelStatus;
  63. double mfTransProb = 0.0;
  64. std::string mstrpcdmappath;
  65. std::mutex mmutexpcdmap;
  66. bool mbpcdmapupdate =false;
  67. };
  68. #endif // MAINWINDOW_H