mainwindow.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3. #include <string>
  4. #include <QMainWindow>
  5. #include <QPainter>
  6. #include <QImage>
  7. #include <QTime>
  8. #include <rosinterface/rosinterface.h>
  9. #include <fastvirtualscan/fastvirtualscan.h>
  10. #include <sensor_msgs/LaserScan.h>
  11. //#define DEBUG_GUI
  12. namespace Ui
  13. {
  14. class MainWindow;
  15. }
  16. class MainWindow : public QMainWindow
  17. {
  18. Q_OBJECT
  19. public:
  20. explicit MainWindow(QWidget* parent = 0);
  21. ~MainWindow();
  22. private:
  23. Ui::MainWindow* ui;
  24. protected:
  25. ROSSub<sensor_msgs::PointCloud2ConstPtr>* velodyne;
  26. ROSPub<sensor_msgs::PointCloud2>* vsros;
  27. ROSPub<sensor_msgs::LaserScan>* scanros;
  28. FastVirtualScan virtualscan;
  29. QVector<double> beams;
  30. QVector<double> heights;
  31. QImage image;
  32. public slots:
  33. void generateVirtualScanSlot();
  34. void showMatrixSlot(int beamid);
  35. void recalculateSlot();
  36. protected:
  37. QPointF convert2RealPoint(QPoint point);
  38. QPoint convert2ImagePoint(QPointF point);
  39. void drawGrid();
  40. void drawPoints();
  41. void drawBeam(int beamid);
  42. };
  43. #endif // MAINWINDOW_H