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);
65 /************************************************************
67 ************************************************************/
68 void setVoltage33(int state);
69 void setVoltage50(int state);
70 void setVoltage80(int state);
71 /* void setLeftMotor(int value); */
72 /* void setRightMotor(int value); */
73 /* void stopMotors(); */
75 void setSimulation(int state);
76 void setObstacleSimulation(int state);
77 void simulateObstaclesHokuyo();
78 void changeObstacle(QPointF position);
79 void sendStart(int plug);
80 void setTeamColor(int plug);
82 /************************************************************
84 ************************************************************/
85 void motionStatusReceived();
86 void actualPositionReceived();
87 void powerVoltageReceived();
90 /************************************************************
92 ************************************************************/
93 void createLeftLayout();
94 void createRightLayout();
96 void createPlaygroundGroupBox();
97 void createPositionGroupBox();
98 void createMiscGroupBox();
99 void createDebugGroupBox();
100 void createActuatorsGroupBox();
101 void createMotorsGroupBox();
102 void createDIOGroupBox();
103 void createSensorsGroupBox();
104 void createPowerGroupBox();
105 void createPickerGroupBox();
106 void createFSMGroupBox();
109 void createActions();
111 QVBoxLayout *leftLayout;
112 QVBoxLayout *rightLayout;
114 QGroupBox *playgroundGroupBox;
115 QGroupBox *positionGroupBox;
116 QGroupBox *miscGroupBox;
117 QGroupBox *debugGroupBox;
118 QGroupBox *actuatorsGroupBox;
119 QGroupBox *powerGroupBox;
120 QGroupBox *fsmGroupBox;
123 PlaygroundScene *playgroundScene;
125 PlaygroundView *playgroundSceneView;
130 QLineEdit *actPosPhi;
134 QLineEdit *estPosPhi;
137 QTextEdit *debugWindow;
138 bool debugWindowEnabled;
141 /* QSlider *leftMotorSlider; */
142 /* QSlider *rightMotorSlider; */
143 /* QCheckBox *bothMotorsCheckBox; */
144 /* QPushButton *stopMotorsPushButton; */
147 /* power management */
148 QCheckBox *voltage33CheckBox;
149 QCheckBox *voltage50CheckBox;
150 QCheckBox *voltage80CheckBox;
151 QLineEdit *voltage33LineEdit;
152 QLineEdit *voltage50LineEdit;
153 QLineEdit *voltage80LineEdit;
154 QLineEdit *voltageBATLineEdit;
157 QCheckBox *obstacleSimulationCheckBox;
158 QLabel *fsm_main_state;
159 QLabel *fsm_act_state;
160 QLabel *fsm_motion_state;
161 QCheckBox *startPlug;
162 QCheckBox *colorChoser;
166 Robot *robotEstPosBest;
167 Robot *robotEstPosIndepOdo;
168 Robot *robotEstPosOdo;
171 Trail *trailEstPosBest;
172 Trail *trailPosIndepOdo;
175 HokuyoScan *hokuyoScan;
178 double leftMotorValue;
179 double rightMotorValue;
182 void openSharedMemory();
183 bool sharedMemoryOpened;
186 /* obstacle simulation */
187 double distanceToWallHokuyo(int beamnum);
188 double distanceToObstacleHokuyo(int beamnum, Point obstacle, double obstacleSize);
189 int simulationEnabled;
191 QTimer *obstacleSimulationTimer;
192 Point simulatedObstacle;
194 /************************************************************
196 ************************************************************/
199 struct robottype_orte_data orte;
202 #endif /* ROBOMON_ATLANTIS_H */