miscGroupBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
QGridLayout *layout = new QGridLayout();
- showMapPushButton = new QCheckBox(tr("Show &map"));
- showMapPushButton->setShortcut(tr("m"));
-
- layout->addWidget(showMapPushButton, 0, 0);
-
obstacleSimulationCheckBox = new QCheckBox(tr("&Obstacle simulation"));
obstacleSimulationCheckBox->setShortcut(tr("o"));
layout->addWidget(obstacleSimulationCheckBox);
playgroundScene->addItem(robotEstPosUzv);
playgroundScene->addItem(robotEstPosOdo);
+ showTrails(false);
+
playgroundScene->addItem(trailRefPos);
playgroundScene->addItem(trailUzvPos);
playgroundScene->addItem(trailOdoPos);
connect(doCheckBox[0], SIGNAL(stateChanged(int)),
this, SLOT(setDO(int)));
- /* path planning map */
- connect(showMapPushButton, SIGNAL(clicked()),
- this, SLOT(showMap()));
-
connect(startPlug, SIGNAL(stateChanged(int)), this, SLOT(sendStart(int)));
connect(puckInside, SIGNAL(stateChanged(int)), this, SLOT(sendPuckInside(int)));
act_chelae(leftChela, rightChela);
}
-void RobomonAtlantis::showMap()
+void RobomonAtlantis::showMap(bool show)
{
openSharedMemory();
if (sharedMemoryOpened == false)
return;
-
- mapTimer = new QTimer(this);
- connect(mapTimer, SIGNAL(timeout()), this, SLOT(paintMap()));
- mapTimer->start(200);
-
- disconnect(showMapPushButton, SIGNAL(clicked()), this, SLOT(showMap()));
- connect(showMapPushButton, SIGNAL(clicked()),
- this, SLOT(showPlayground()));
- playgroundScene->showMap(true);
-}
-
-void RobomonAtlantis::showPlayground()
-{
- mapTimer->stop();
- disconnect(mapTimer, SIGNAL(timeout()), this, SLOT(paintMap()));
-
- disconnect(showMapPushButton, SIGNAL(clicked()),
- this, SLOT(showPlayground()));
- connect(showMapPushButton, SIGNAL(clicked()), this, SLOT(showMap()));
- playgroundScene->showMap(false);
+
+ if (show) {
+ mapTimer = new QTimer(this);
+ connect(mapTimer, SIGNAL(timeout()), this, SLOT(paintMap()));
+ mapTimer->start(200);
+ } else {
+ mapTimer->stop();
+ disconnect(mapTimer, SIGNAL(timeout()), this, SLOT(paintMap()));
+ }
+ playgroundScene->showMap(show);
}
void RobomonAtlantis::paintMap()
ORTEPublicationSend(orte.publication_puck_inside);
}
+
+void RobomonAtlantis::resetTrails()
+{
+ trailRefPos->reset();
+ trailUzvPos->reset();
+ trailOdoPos->reset();
+}
+
+void RobomonAtlantis::showTrails(bool show)
+{
+ trailRefPos->setVisible(show);
+ trailUzvPos->setVisible(show);
+ trailOdoPos->setVisible(show);
+}