From 456d61b7e2323d7d76a628dccd4b784177501b4d Mon Sep 17 00:00:00 2001 From: Michal Vokac Date: Sun, 5 Oct 2014 10:20:29 +0200 Subject: [PATCH] robomon: Set simulated obstacle visible on a click in playground scene 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 | 1 + src/robomon/RobomonAtlantis.cpp | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/robomon/PlaygroundScene.cpp b/src/robomon/PlaygroundScene.cpp index 5603a5f8..99bec3de 100644 --- a/src/robomon/PlaygroundScene.cpp +++ b/src/robomon/PlaygroundScene.cpp @@ -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); diff --git a/src/robomon/RobomonAtlantis.cpp b/src/robomon/RobomonAtlantis.cpp index 356ad7dd..7a47c548 100644 --- a/src/robomon/RobomonAtlantis.cpp +++ b/src/robomon/RobomonAtlantis.cpp @@ -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))); -- 2.39.2