]> rtime.felk.cvut.cz Git - eurobot/public.git/blobdiff - src/robomon/RobomonAtlantis.h
Revert "Delete old meta-ti"
[eurobot/public.git] / src / robomon / RobomonAtlantis.h
index 61d09366c19e32f08d5a4686aa552d873e77b5dc..f62fe99c9b7d28bd683abd43a54d9990ff9bd307 100644 (file)
 #ifndef ROBOMON_ATLANTIS_H
 #define ROBOMON_ATLANTIS_H
 
-#define SIM_OBST_SIZE_M 0.5
-
 #include <QDialog>
 
 #include <trgen.h>
 #include "PlaygroundScene.h"
+#include "playgroundview.h"
 #include "Robot.h"
+#include "Map.h"
 #include <roboorte_robottype.h>
-#include <roboorte.h>
+#include "trail.h"
+#include "hokuyoscan.h"
 
 class QHBoxLayout;
 class QVBoxLayout;
@@ -37,13 +38,7 @@ class QDial;
 class QSlider;
 class QProgressBar;
 class QFont;
-
-#define PG_X 600
-#define PG_Y 420
-
-#define TOP_LEFT QPointF(10,0)
-#define TOP_LEFT_X 10
-#define TOP_LEFT_Y 0
+class QImage;
 
 class RobomonAtlantis : public QWidget
 {
@@ -61,43 +56,39 @@ protected:
 signals:
        void motionStatusReceivedSignal();
        void actualPositionReceivedSignal();
-       void estimatedPositionReceivedSignal();
-       void diReceivedSignal();
-       void accelerometerReceivedSignal();
-       void accumulatorReceivedSignal();
        void powerVoltageReceivedSignal();
 
+public slots:
+       void showMap(bool show);
+       void useOpenGL(bool use);
+       void showTrails(bool show);
+       void showShapeDetect(bool show);
+       void resetTrails();
 private slots:
        /************************************************************
-        * GUI actions 
+        * GUI actions
         ************************************************************/
        void setVoltage33(int state);
        void setVoltage50(int state);
        void setVoltage80(int state);
-       void setLeftMotor(int value);
-       void setRightMotor(int value);
-       void stopMotors();
-       void setDO(int state);
-       void showMap();
-       void showPlayground();
+/*     void setLeftMotor(int value); */
+/*     void setRightMotor(int value); */
+/*     void stopMotors(); */
        void paintMap();
        void setSimulation(int state);
        void setObstacleSimulation(int state);
        void simulateObstaclesHokuyo();
        void changeObstacle(QPointF position);
-       void pick();
-       void setBelts(int value);
-       void setChelae(int value);
+       void sendStart(int plug);
+       void setTeamColor(int plug);
+        void changeStrategy_1();
+        void changeStrategy_0();
 
        /************************************************************
-        * ORTE 
+        * ORTE
         ************************************************************/
        void motionStatusReceived();
        void actualPositionReceived();
-       void estimatedPositionReceived();
-       void diReceived();
-       void accelerometerReceived();
-       void accumulatorReceived();
        void powerVoltageReceived();
 
 private:
@@ -117,29 +108,27 @@ private:
        void createSensorsGroupBox();
        void createPowerGroupBox();
        void createPickerGroupBox();
-
-       void createSharpSensorsLayout();
+       void createFSMGroupBox();
 
        void createRobots();
        void createActions();
+       void createMap();
 
        QVBoxLayout *leftLayout;
        QVBoxLayout *rightLayout;
-       QVBoxLayout *sharpSensorsLayout;
 
        QGroupBox *playgroundGroupBox;
        QGroupBox *positionGroupBox;
        QGroupBox *miscGroupBox;
        QGroupBox *debugGroupBox;
        QGroupBox *actuatorsGroupBox;
-       QGroupBox *enginesGroupBox;
-       QGroupBox *dioGroupBox;
-       QGroupBox *sensorsGroupBox;
        QGroupBox *powerGroupBox;
-       QGroupBox *pickerGroupBox;
+       QGroupBox *fsmGroupBox;
 
+public:
        PlaygroundScene *playgroundScene;
-       QGraphicsView *playgroundSceneView;
+private:
+       PlaygroundView *playgroundSceneView;
 
        /* position state */
        QLineEdit *actPosX;
@@ -155,21 +144,11 @@ private:
        bool debugWindowEnabled;
 
        /* actuators */
-       QSlider *leftMotorSlider;
-       QSlider *rightMotorSlider;
-       QCheckBox *bothMotorsCheckBox;
-       QPushButton *stopMotorsPushButton;
-
-       QCheckBox *leftBeltCheckBox;
-       QCheckBox *rightBeltCheckBox;
-       QCheckBox *leftChelaCheckBox;
-       QCheckBox *rightChelaCheckBox;
-
-       QDial *leftBeltDial;
-       QDial *rightBeltDial;
-       QDial *leftChelaDial;
-       QDial *rightChelaDial;
-       QPushButton *pickPushButton;
+/*     QSlider *leftMotorSlider; */
+/*     QSlider *rightMotorSlider; */
+/*     QCheckBox *bothMotorsCheckBox; */
+/*     QPushButton *stopMotorsPushButton; */
+       //QDial *vidle;
 
        /* power management */
        QCheckBox *voltage33CheckBox;
@@ -180,16 +159,29 @@ private:
        QLineEdit *voltage80LineEdit;
        QLineEdit *voltageBATLineEdit;
 
-       QCheckBox *diCheckBox[8];
-       QCheckBox *doCheckBox[8];
-
        /* misc */
        QCheckBox *obstacleSimulationCheckBox;
-       QPushButton *showMapPushButton;
-
+       QLabel *fsm_main_state;
+       QLabel *fsm_act_state;
+       QLabel *fsm_motion_state;
+       QCheckBox *startPlug;
+       QCheckBox *colorChoser;
+        QPushButton *strategyButton;
+public:
        /* robot */
-       Robot *robotActPos;
-       Robot *robotEstPos;
+       Robot *robotRefPos;
+       Robot *robotEstPosBest;
+       Robot *robotEstPosIndepOdo;
+       Robot *robotEstPosOdo;
+
+       Map *mapImage;
+private:
+       Trail *trailRefPos;
+       Trail *trailEstPosBest;
+       Trail *trailPosIndepOdo;
+       Trail *trailOdoPos;
+
+        HokuyoScan *hokuyoScan;
 
        /* keypad */
        double leftMotorValue;
@@ -198,19 +190,19 @@ private:
        /* map */
        void openSharedMemory();
        bool sharedMemoryOpened;
-       int cellSize;
        QTimer *mapTimer;
 
        /* obstacle simulation */
        double distanceToWallHokuyo(int beamnum);
        double distanceToObstacleHokuyo(int beamnum, Point obstacle, double obstacleSize);
+       double distanceToCircularObstacleHokuyo(int beamnum, Point center, double diameter);
        int simulationEnabled;
 
        QTimer *obstacleSimulationTimer;
        Point simulatedObstacle;
 
        /************************************************************
-        * ORTE 
+        * ORTE
         ************************************************************/
        void createOrte();