2 * RobomonAtlantis.h 07/10/31
4 * Robot's visualization and control GUI for robot of the
5 * Eurobot 2008 competition (Mission to Mars).
7 * Copyright: (c) 2008 CTU Dragons
8 * CTU FEE - Department of Control Engineering
9 * Authors: Martin Zidek, Michal Sojka, Tran Duy Khanh
10 * License: GNU GPL v.2
13 #ifndef ROBOMON_ATLANTIS_H
14 #define ROBOMON_ATLANTIS_H
19 #include "PlaygroundScene.h"
20 #include "playgroundview.h"
22 #include <roboorte_robottype.h>
24 #include "hokuyoscan.h"
41 class RobomonAtlantis : public QWidget
46 RobomonAtlantis(QWidget *parent = 0);
49 bool event(QEvent *event);
50 void keyPressEvent(QKeyEvent *event);
51 void keyReleaseEvent(QKeyEvent *event);
52 void closeEvent(QCloseEvent *event);
55 void motionStatusReceivedSignal();
56 void actualPositionReceivedSignal();
57 void powerVoltageReceivedSignal();
60 void showMap(bool show);
61 void useOpenGL(bool use);
62 void showTrails(bool show);
63 void showShapeDetect(bool show);
66 /************************************************************
68 ************************************************************/
69 void setVoltage33(int state);
70 void setVoltage50(int state);
71 void setVoltage80(int state);
72 /* void setLeftMotor(int value); */
73 /* void setRightMotor(int value); */
74 /* void stopMotors(); */
76 void setSimulation(int state);
77 void setObstacleSimulation(int state);
78 void simulateObstaclesHokuyo();
79 void changeObstacle(QPointF position);
80 void sendStart(int plug);
81 void setTeamColor(int plug);
83 /************************************************************
85 ************************************************************/
86 void motionStatusReceived();
87 void actualPositionReceived();
88 void powerVoltageReceived();
91 /************************************************************
93 ************************************************************/
94 void createLeftLayout();
95 void createRightLayout();
97 void createPlaygroundGroupBox();
98 void createPositionGroupBox();
99 void createMiscGroupBox();
100 void createDebugGroupBox();
101 void createActuatorsGroupBox();
102 void createMotorsGroupBox();
103 void createDIOGroupBox();
104 void createSensorsGroupBox();
105 void createPowerGroupBox();
106 void createPickerGroupBox();
107 void createFSMGroupBox();
110 void createActions();
112 QVBoxLayout *leftLayout;
113 QVBoxLayout *rightLayout;
115 QGroupBox *playgroundGroupBox;
116 QGroupBox *positionGroupBox;
117 QGroupBox *miscGroupBox;
118 QGroupBox *debugGroupBox;
119 QGroupBox *actuatorsGroupBox;
120 QGroupBox *powerGroupBox;
121 QGroupBox *fsmGroupBox;
124 PlaygroundScene *playgroundScene;
126 PlaygroundView *playgroundSceneView;
131 QLineEdit *actPosPhi;
135 QLineEdit *estPosPhi;
138 QTextEdit *debugWindow;
139 bool debugWindowEnabled;
142 /* QSlider *leftMotorSlider; */
143 /* QSlider *rightMotorSlider; */
144 /* QCheckBox *bothMotorsCheckBox; */
145 /* QPushButton *stopMotorsPushButton; */
148 /* power management */
149 QCheckBox *voltage33CheckBox;
150 QCheckBox *voltage50CheckBox;
151 QCheckBox *voltage80CheckBox;
152 QLineEdit *voltage33LineEdit;
153 QLineEdit *voltage50LineEdit;
154 QLineEdit *voltage80LineEdit;
155 QLineEdit *voltageBATLineEdit;
158 QCheckBox *obstacleSimulationCheckBox;
159 QLabel *fsm_main_state;
160 QLabel *fsm_act_state;
161 QLabel *fsm_motion_state;
162 QCheckBox *startPlug;
163 QCheckBox *colorChoser;
167 Robot *robotEstPosBest;
168 Robot *robotEstPosIndepOdo;
169 Robot *robotEstPosOdo;
172 Trail *trailEstPosBest;
173 Trail *trailPosIndepOdo;
176 HokuyoScan *hokuyoScan;
179 double leftMotorValue;
180 double rightMotorValue;
183 void openSharedMemory();
184 bool sharedMemoryOpened;
187 /* obstacle simulation */
188 double distanceToWallHokuyo(int beamnum);
189 double distanceToObstacleHokuyo(int beamnum, Point obstacle, double obstacleSize);
190 int simulationEnabled;
192 QTimer *obstacleSimulationTimer;
193 Point simulatedObstacle;
195 /************************************************************
197 ************************************************************/
200 struct robottype_orte_data orte;
203 #endif /* ROBOMON_ATLANTIS_H */