Cheetah Software  1.0
SimControlPanel.h
Go to the documentation of this file.
1 
6 #ifndef SIMCONTROLPANEL_H
7 #define SIMCONTROLPANEL_H
8 
9 #include <QMainWindow>
10 #include <thread>
12 #include "Graphics3D.h"
13 #include "RobotInterface.h"
14 #include "Simulation.h"
15 
16 #define DEFAULT_TERRAIN_FILE "/default-terrain.yaml"
17 #define DEFAULT_USER_FILE "/default-user.yaml"
18 
19 namespace Ui {
20 class SimControlPanel;
21 }
22 
23 class SimControlPanel : public QMainWindow {
24  Q_OBJECT
25 
26  public:
27  explicit SimControlPanel(QWidget* parent = nullptr);
28 
29  ~SimControlPanel();
30 
31  private slots:
32 
33  void on_startButton_clicked();
34 
35  void on_stopButton_clicked();
36 
37  void on_joystickButton_clicked();
38 
39  void on_driverButton_clicked();
40 
41  void on_simulatorTable_cellChanged(int row, int column);
42 
43  void on_saveSimulatorButton_clicked();
44 
45  void on_loadSimulatorButton_clicked();
46 
47  void on_robotTable_cellChanged(int row, int column);
48 
49  void on_saveRobotButton_clicked();
50 
51  void on_loadRobotButton_clicked();
52 
53  void on_goHomeButton_clicked();
54 
55  void on_kickButton_clicked();
56 
57  void on_userControlTable_cellChanged(int row, int column);
58 
59  void on_saveUserButton_clicked();
60 
61  void on_loadUserButton_clicked();
62 
63  void on_setTerrainButton_clicked();
64 
65  void updateTerrainLabel();
66 
67  void loadSimulationParameters(SimulatorControlParameters& params);
68  void loadRobotParameters(RobotControlParameters& params);
69  void loadUserParameters(ControlParameters& params);
70 
71  private:
72  void updateUiEnable();
73  std::thread _simThread;
74  bool _started = false;
75  Ui::SimControlPanel* ui;
76  Simulation* _simulation = nullptr;
77  PeriodicTaskManager* _interfaceTaskManager = nullptr;
78  RobotInterface* _robotInterface = nullptr;
79  Graphics3D* _graphicsWindow = nullptr;
82  bool _simulationMode = false;
83  bool _firstStart = true;
84  bool _ignoreTableCallbacks = false;
85  bool _loadedUserSettings = false;
86  std::string _terrainFileName;
87 };
88 
89 #endif // SIMCONTROLPANEL_H
Main simulation class.
ControlParameters _userParameters
SimulatorControlParameters _parameters
std::thread _simThread
Ui::SimControlPanel * ui
Interface between simulator and hardware using LCM.
Visualizer window for simulator.
std::string _terrainFileName