GUI: added options to hide map/odom frames and yellow TF links. CloudViewer: added option to show/hide camera axis

This commit is contained in:
matlabbe
2020-04-03 20:04:15 -04:00
parent 9c62a11316
commit b3f7d1881f
6 changed files with 116 additions and 26 deletions

View File

@@ -1345,7 +1345,14 @@ void MainWindow::processOdometry(const rtabmap::OdometryEvent & odom, bool dataI
}
_cloudViewer->updateCameraTargetPosition(_odometryCorrection*odom.pose());
#if PCL_VERSION_COMPARE(>=, 1, 7, 2)
_cloudViewer->addOrUpdateLine("odom_to_base_link", _odometryCorrection, _odometryCorrection*odom.pose(), Qt::yellow, false, false);
if(_preferencesDialog->isFramesShown())
{
_cloudViewer->addOrUpdateLine("odom_to_base_link", _odometryCorrection, _odometryCorrection*odom.pose(), Qt::yellow, false, false);
}
else
{
_cloudViewer->removeLine("odom_to_base_link");
}
#endif
}
@@ -2055,9 +2062,18 @@ void MainWindow::processStats(const rtabmap::Statistics & stat)
}
#if PCL_VERSION_COMPARE(>=, 1, 7, 2)
_cloudViewer->addOrUpdateCoordinate("map_frame", Transform::getIdentity(), 0.5, false);
_cloudViewer->addOrUpdateCoordinate("odom_frame", _odometryCorrection, 0.35, false);
_cloudViewer->addOrUpdateLine("map_to_odom", Transform::getIdentity(), _odometryCorrection, Qt::yellow, false, false);
if(_preferencesDialog->isFramesShown())
{
_cloudViewer->addOrUpdateCoordinate("map_frame", Transform::getIdentity(), 0.5, false);
_cloudViewer->addOrUpdateCoordinate("odom_frame", _odometryCorrection, 0.35, false);
_cloudViewer->addOrUpdateLine("map_to_odom", Transform::getIdentity(), _odometryCorrection, Qt::yellow, false, false);
}
else
{
_cloudViewer->removeLine("map_to_odom");
_cloudViewer->removeCoordinate("odom_frame");
_cloudViewer->removeCoordinate("map_frame");
}
#endif
if(_cachedSignatures.contains(0) && stat.refImageId()>0)
@@ -4721,6 +4737,7 @@ void MainWindow::newDatabase()
_cloudViewer->removeLine("map_to_odom");
_cloudViewer->removeLine("odom_to_base_link");
_cloudViewer->removeCoordinate("odom_frame");
_cloudViewer->removeCoordinate("map_frame");
ULOGGER_DEBUG("");
this->clearTheCache();
std::string databasePath = (_preferencesDialog->getWorkingDirectory()+QDir::separator()+QString("rtabmap.tmp.db")).toStdString();