SLAM
mainwindow.h
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3 
4 #include <QMainWindow>
5 #include <QTimer>
6 #include <QModelIndex>
7 #include <QTableView>
8 
9 #include "datastructures.h"
10 #include "datareader.h"
11 #include "datapreprocessor.h"
12 #include "pointsetregistration.h"
13 #include "landmarkextraction.h"
14 #include "statistics.h"
15 #include "mapclass.h"
16 #include "mapprocess.h"
17 #include "udpclient.h"
18 #include "submappostproc.h"
19 
20 namespace Ui {
21 class MainWindow;
22 }
23 
27 class MainWindow : public QMainWindow
28 {
29  Q_OBJECT
30 
31 public:
32  explicit MainWindow(QWidget *parent = 0);
33  ~MainWindow();
34 
35  enum MainMenuTabs {
36  File,
37  StaticRender,
38  RealTimeRender,
39  ProcessSubmap,
40  Settings
41  };
42 
43  enum RightColumnTabs {
44  StatisticsTab,
45  SubmapsTab,
46  LidarTab,
47  LoadedTab
48  };
49 
50  enum StackedWidget {
51  ActualScan,
52  Map,
53  LidarSettings
54  };
55 
56  enum StackedWidgetLidar {
57  NotConnected,
58  Connected,
59  Actions
60  };
61 
62 private slots:
63  void dataLoaded();
64  void reloadStatistics();
65  void reloadSubmapTab();
66  void nextScan();
67  void registrationStepCompleted();
68  void correctionStepCompleted();
69  void checkRegistrationResults();
70  void landmarkExtractionRun();
71  void renderStatistics();
72  void updateMapRender();
73  void zoomIn();
74  void zoomOut();
75  void onSubmapClicked(QModelIndex index);
76  void checkMainMenuEnabled();
77 
78  void allReset();
79  void changeEnableStaticControls(bool enabled);
80  void changeEnabledSubmapControls(bool enabled);
81  void clientChangeState();
82  void submapLoaded();
83  void reloadLoadedTable();
84  void reloadLidarTable();
85 
86  void on_toolButtonOpenFile_clicked();
87  void on_toolButton_clicked();
88  void on_toolButtonClose_clicked();
89  void on_toolButtonNext_clicked();
90  void on_toolButtonStart_clicked();
91  void on_toolButtonStop_clicked();
92  void on_toolButtonRegistration_clicked();
93  void on_toolButtonShowLandmark_clicked();
94  void on_toolButtonActualScan_clicked();
95  void on_toolButtonMap_clicked();
96  void on_toolButtonLidarSettings_clicked();
97  void on_pushButtonConnect_clicked();
98  void on_pushButtonConnectLidar_clicked();
99  void on_pushButtonGrab_clicked();
100  void on_pushButtonStop_clicked();
101  void on_pushButtonStateInfo_clicked();
102  void on_toolButtonRemoveSubmap_clicked();
103  void on_toolButtonSaveSubmap_clicked();
104  void on_toolButtonLoadSubmap_clicked();
105  void on_toolButtonRealTimeStart_clicked();
106  void on_toolButtonRealTimeStop_clicked();
107  void on_tableViewLoadedSubmaps_clicked(const QModelIndex &index);
108 
109 private:
110  Ui::MainWindow *ui;
111  DataReader *dataReader;
112  DataPreProcessor *dataPreProcessor;
113  LandmarkExtraction *landmarkExtraction;
114  Statistics *statistics;
115  Statistics *statisticsMap;
116  Statistics *statisticsMapRender;
117  int activeStaticRender;
118  bool renderSubmap;
119  int renderedSubmap;
120  area_t *areaChanged;
121  robotPosition_t *robotPos;
122  UdpClient *client;
123  SubmapPostProc *postProc;
124 
125  MapClass *map;
126  MapClass *mapRender;
127  MapProcess *mapProcess;
128 
129  // registration step
130  int areaIndex;
131  int connectedIndex;
132  int connectedWith;
133  int correctionCount;
134  bool correctionRunning;
135  QVector<int> forbiddenIndexes;
136 
137  bool activated;
138  bool applyRegistration;
139  bool showLandmark;
140  bool completedFirstThreat;
141  bool completedSecondThreat;
142  bool obDraw;
143 
144  QTimer *timer;
145 
146  void setupTableView(QTableView *tableView);
147  void reloadStaticRender();
148  void registrationStep();
149  void correctionStep(int what, int with);
150  void mapCorrectionStep(int start);
151  void enableProgressBar();
152  void disableProgressBar();
153 
154 };
155 
156 #endif // MAINWINDOW_H
Třída pro práci s submapami. Umožňuje ukládání a nahravání ze souboru a odstraňování nepotřebných sub...
Definition: submappostproc.h:14
Třída k načtení naměřených dat ze souboru.
Definition: datareader.h:15
Definition: mainwindow.h:20
Hlavní struktura aplikace. V této struktůře jsou uložena všechna naměřená data a představuje jednu ot...
Definition: datastructures.h:71
Třída zajišťující real time statistiky (pravé menu první záložka).
Definition: statistics.h:12
Třída hledající důležité objekty, hrany nebo rohy.
Definition: landmarkextraction.h:12
Třída pro ukládání měření do oblastí area_t bůď ze skeneru nebo z načtených souborů.
Definition: datapreprocessor.h:14
Třída pro práci s mapou. Zatím testovací a nepoužita.
Definition: mapprocess.h:70
Struktura k ukládáná pozice robota. Aktuální pozice je vždy [0, 0].
Definition: datastructures.h:121
Třída pro připojení se k serveru, ke kterému je připojen LIDAR.
Definition: udpclient.h:37
Třída pro práci s mapou a submapami. Obsahuje všechny submapy spolu s pozicemi důležitých objektů a r...
Definition: mapclass.h:17
Hlavní okno aplikace, zde se pracuje se všemi třídami.
Definition: mainwindow.h:27