]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
robomon: Display independent odometry position and remove UZV position
authorMichal <zandar@zandar-laptop.(none)>
Mon, 19 Apr 2010 15:08:10 +0000 (17:08 +0200)
committerMichal <zandar@zandar-laptop.(none)>
Mon, 19 Apr 2010 15:08:10 +0000 (17:08 +0200)
src/robomon/RobomonAtlantis.cpp
src/robomon/RobomonAtlantis.h
src/robomon/RobomonTuning.cpp
src/robomon/robomon_orte.h

index 629be99adf75e8993db98537f4ac0d9e5010491c..2dd1a4ba461c169ad79769e9ed03c0be82158da5 100644 (file)
@@ -318,23 +318,23 @@ void RobomonAtlantis::createRobots()
        trailRefPos = new Trail(QPen(Qt::darkBlue));
        trailRefPos->setZValue(11);
        
-       robotEstPosOdo = new Robot("Odo", QPen(Qt::white), QBrush(Qt::darkRed));
+       robotEstPosOdo = new Robot("Mot", QPen(Qt::white), QBrush(Qt::darkRed));
        robotEstPosOdo->setZValue(10);
        trailOdoPos = new Trail(QPen(Qt::white));
        trailOdoPos->setZValue(10);
-       robotEstPosUzv = new Robot("Uzv", QPen(), QBrush(Qt::darkGray));
-       robotEstPosUzv->setZValue(10);
-       trailUzvPos = new Trail(QPen());
-       trailUzvPos->setZValue(10);
+       robotEstPosIndepOdo = new Robot("Odo", QPen(), QBrush(Qt::darkGray));
+       robotEstPosIndepOdo->setZValue(10);
+       trailPosIndepOdo = new Trail(QPen());
+       trailPosIndepOdo->setZValue(10);
 
        playgroundScene->addItem(robotActPos);
-       playgroundScene->addItem(robotEstPosUzv);
+       playgroundScene->addItem(robotEstPosIndepOdo);
        playgroundScene->addItem(robotEstPosOdo);
        
        showTrails(false);
        
        playgroundScene->addItem(trailRefPos);
-       playgroundScene->addItem(trailUzvPos);
+       playgroundScene->addItem(trailPosIndepOdo);
        playgroundScene->addItem(trailOdoPos);
 }
 
@@ -571,8 +571,16 @@ bool RobomonAtlantis::event(QEvent *event)
                case QEVENT(QEV_REFERENCE_POSITION):
                        emit actualPositionReceivedSignal();
                        break;
-               case QEVENT(QEV_ESTIMATED_POSITION_UZV):
-                       emit estimatedPositionReceivedSignal();
+               case QEVENT(QEV_ESTIMATED_POSITION_INDEP_ODO):
+                       estPosX->setText(QString("%1").arg(orte.est_pos_indep_odo.x, 0, 'f', 3));
+                       estPosY->setText(QString("%1").arg(orte.est_pos_indep_odo.y, 0, 'f', 3));
+                       estPosPhi->setText(QString("%1(%2)")
+                                       .arg(DEGREES(orte.est_pos_indep_odo.phi), 0, 'f', 0)
+                                       .arg(orte.est_pos_indep_odo.phi, 0, 'f', 1));
+                       robotEstPosIndepOdo->moveRobot(orte.est_pos_indep_odo.x, 
+                               orte.est_pos_indep_odo.y, orte.est_pos_indep_odo.phi);
+                       trailPosIndepOdo->addPoint(QPointF(orte.est_pos_indep_odo.x, 
+                                             orte.est_pos_indep_odo.y));
                        break;
                case QEVENT(QEV_ESTIMATED_POSITION_ODO):
                        robotEstPosOdo->moveRobot(orte.est_pos_odo.x, 
@@ -749,10 +757,10 @@ void RobomonAtlantis::createOrte()
                                receiveMotionStatusCallBack, this);
        robottype_subscriber_ref_pos_create(&orte, 
                                receiveActualPositionCallBack, this);
-       robottype_subscriber_est_pos_uzv_create(&orte, 
-                       generic_rcv_cb, new OrteCallbackInfo(this, QEV_ESTIMATED_POSITION_UZV));
        robottype_subscriber_est_pos_odo_create(&orte, 
                        generic_rcv_cb, new OrteCallbackInfo(this, QEV_ESTIMATED_POSITION_ODO));
+       robottype_subscriber_est_pos_indep_odo_create(&orte, 
+                       generic_rcv_cb, new OrteCallbackInfo(this, QEV_ESTIMATED_POSITION_INDEP_ODO));
        robottype_subscriber_fsm_main_create(&orte, 
                                             rcv_fsm_main_cb, this);
        robottype_subscriber_fsm_motion_create(&orte, 
@@ -779,8 +787,6 @@ void RobomonAtlantis::createOrte()
                        this, SLOT(motionStatusReceived()));
        connect(this, SIGNAL(actualPositionReceivedSignal()), 
                        this, SLOT(actualPositionReceived()));
-       connect(this, SIGNAL(estimatedPositionReceivedSignal()), 
-                       this, SLOT(estimatedPositionReceived()));
        connect(this, SIGNAL(powerVoltageReceivedSignal()), 
                        this, SLOT(powerVoltageReceived()));
 }
@@ -802,19 +808,6 @@ void RobomonAtlantis::actualPositionReceived()
        trailRefPos->addPoint(QPointF(orte.ref_pos.x, orte.ref_pos.y));
 }
 
-void RobomonAtlantis::estimatedPositionReceived()
-{
-       estPosX->setText(QString("%1").arg(orte.est_pos_uzv.x, 0, 'f', 3));
-       estPosY->setText(QString("%1").arg(orte.est_pos_uzv.y, 0, 'f', 3));
-       estPosPhi->setText(QString("%1(%2)")
-                       .arg(DEGREES(orte.est_pos_uzv.phi), 0, 'f', 0)
-                       .arg(orte.est_pos_uzv.phi, 0, 'f', 1));
-       robotEstPosUzv->moveRobot(orte.est_pos_uzv.x, 
-               orte.est_pos_uzv.y, orte.est_pos_uzv.phi);
-       trailUzvPos->addPoint(QPointF(orte.est_pos_uzv.x, 
-                             orte.est_pos_uzv.y));
-}
-
 void RobomonAtlantis::powerVoltageReceived()
 {
        voltage33LineEdit->setText(QString("%1").arg(
@@ -897,7 +890,7 @@ double RobomonAtlantis::distanceToWallHokuyo(int beamnum)
  */    
 double RobomonAtlantis::distanceToObstacleHokuyo(int beamnum, Point obstacle, double obstacleSize)
 {  
-       struct robot_pos_type e = orte.est_pos_uzv;
+       struct robot_pos_type e = orte.est_pos_indep_odo;
        double sensor_a;
        struct sharp_pos s;
 
@@ -942,13 +935,13 @@ void RobomonAtlantis::sendStart(int plug)
 void RobomonAtlantis::resetTrails()
 {
        trailRefPos->reset();
-       trailUzvPos->reset();
+       trailPosIndepOdo->reset();
        trailOdoPos->reset();
 }
 
 void RobomonAtlantis::showTrails(bool show)
 {
        trailRefPos->setVisible(show);
-       trailUzvPos->setVisible(show);
+       trailPosIndepOdo->setVisible(show);
        trailOdoPos->setVisible(show);
 }
index 7a61a147c2190140a989c959a49ef227c6febb0c..da1c8508563f2dca7c3cb19b0f146d91beb56ae8 100644 (file)
@@ -54,7 +54,6 @@ protected:
 signals:
        void motionStatusReceivedSignal();
        void actualPositionReceivedSignal();
-       void estimatedPositionReceivedSignal();
        void powerVoltageReceivedSignal();
        
 public slots:
@@ -83,7 +82,6 @@ private slots:
         ************************************************************/
        void motionStatusReceived();
        void actualPositionReceived();
-       void estimatedPositionReceived();
        void powerVoltageReceived();
 
 private:
@@ -161,11 +159,11 @@ private:
 
        /* robot */
        Robot *robotActPos;
-       Robot *robotEstPosUzv;
+       Robot *robotEstPosIndepOdo;
        Robot *robotEstPosOdo;
        
        Trail *trailRefPos;
-       Trail *trailUzvPos;
+       Trail *trailPosIndepOdo;
        Trail *trailOdoPos;
 
        /* keypad */
index 852b86283a87955ca78bbff829d628f983e58cac..91dff8dfbca004ca31e1f441ad8d5f3ba01c1ec1 100644 (file)
@@ -173,8 +173,6 @@ bool RobomonTuning::event(QEvent *event)
                        break;
                case QEVENT(QEV_REFERENCE_POSITION):
                        break;
-               case QEVENT(QEV_ESTIMATED_POSITION_UZV):
-                       break;
                case QEVENT(QEV_ESTIMATED_POSITION_ODO):
                        break;
                case QEVENT(QEV_SHARP_LONGS):
index 80c6765a09dc207d40610c206c9dbcd4458a7867..4a3aaa1a02433c7596e15566eb7dc9ed386ed80c 100644 (file)
@@ -27,8 +27,8 @@ enum robomon_qev {
        QEV_MOTION_STATUS = 0,
        QEV_MOTION_IRC,
        QEV_REFERENCE_POSITION,
-       QEV_ESTIMATED_POSITION_UZV,
        QEV_ESTIMATED_POSITION_ODO,
+       QEV_ESTIMATED_POSITION_INDEP_ODO,
        QEV_SHARP_LONGS,
        QEV_SHARP_SHORTS,
        QEV_SHARPS,