]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
robomon: Set simulated obstacle visible on a click in playground scene
authorMichal Vokac <vokac.m@gmail.com>
Sun, 5 Oct 2014 08:20:29 +0000 (10:20 +0200)
committerMichal Vokac <vokac.m@gmail.com>
Sun, 5 Oct 2014 08:20:29 +0000 (10:20 +0200)
Do not enable the obstacle as soon as someone enables any LIDAR.
Now I do not know how to "connect" all three checkboxes together so when
any of them is being unchecked the obstacle is not removed.
Now even if two lidars are enabled, disabling one of them removes
the obstacle from the scene.

src/robomon/PlaygroundScene.cpp
src/robomon/RobomonAtlantis.cpp

index 5603a5f8134b12d66abe8afd890458fcc5a2b73c..99bec3de0d1cd38d786d56b30cc3b57097bcd320 100644 (file)
@@ -100,6 +100,7 @@ void PlaygroundScene::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent)
 {
        QGraphicsScene::mousePressEvent(mouseEvent);
        QPointF pos = scene2world(mouseEvent->scenePos());
+       obstacle->setVisible(true);
        obstacle->setPos(mouseEvent->scenePos().x(),
                         mouseEvent->scenePos().y());
        emit obstacleChanged(pos);
index 356ad7dd45ee3883eb2282ff565a26ef3cd3d342..7a47c548b6357ba9cea4644abf523336af1056c0 100644 (file)
@@ -390,22 +390,16 @@ void RobomonAtlantis::createActions()
                        this, SLOT(setHokuyoSimulation(int)));
        connect(hokuyoSimCheckBox, SIGNAL(stateChanged(int)),
                        this, SLOT(setHokuyoObstacleSimulation(int)));
-       connect(hokuyoSimCheckBox, SIGNAL(stateChanged(int)),
-                       playgroundScene, SLOT(showObstacle(int)));
 
        connect(sick331SimCheckBox, SIGNAL(stateChanged(int)),
                        this, SLOT(setSick331Simulation(int)));
        connect(sick331SimCheckBox, SIGNAL(stateChanged(int)),
                        this, SLOT(setSick331ObstacleSimulation(int)));
-       connect(sick331SimCheckBox, SIGNAL(stateChanged(int)),
-                       playgroundScene, SLOT(showObstacle(int)));
 
        connect(sick551SimCheckBox, SIGNAL(stateChanged(int)),
                        this, SLOT(setSick551Simulation(int)));
        connect(sick551SimCheckBox, SIGNAL(stateChanged(int)),
                        this, SLOT(setSick551ObstacleSimulation(int)));
-       connect(sick551SimCheckBox, SIGNAL(stateChanged(int)),
-                       playgroundScene, SLOT(showObstacle(int)));
 
        connect(playgroundScene, SIGNAL(obstacleChanged(QPointF)),
                        this, SLOT(changeObstacle(QPointF)));