mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-08 12:30:20 +08:00
GUI: fixed odometry visibility flickering
This commit is contained in:
@@ -174,7 +174,7 @@ private slots:
|
||||
void takeScreenshot();
|
||||
void updateElapsedTime();
|
||||
void processCameraInfo(const rtabmap::CameraInfo & info);
|
||||
void processOdometry(const rtabmap::OdometryEvent & odom);
|
||||
void processOdometry(const rtabmap::OdometryEvent & odom, bool dataIgnored);
|
||||
void applyPrefSettings(PreferencesDialog::PANEL_FLAGS flags);
|
||||
void applyPrefSettings(const rtabmap::ParametersMap & parameters);
|
||||
void processRtabmapEventInit(int status, const QString & info);
|
||||
@@ -211,7 +211,7 @@ private slots:
|
||||
signals:
|
||||
void statsReceived(const rtabmap::Statistics &);
|
||||
void cameraInfoReceived(const rtabmap::CameraInfo &);
|
||||
void odometryReceived(const rtabmap::OdometryEvent &);
|
||||
void odometryReceived(const rtabmap::OdometryEvent &, bool);
|
||||
void thresholdsChanged(int, int);
|
||||
void stateChanged(MainWindow::State);
|
||||
void rtabmapEventInitReceived(int status, const QString & info);
|
||||
|
||||
+21
-18
@@ -483,7 +483,7 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent) :
|
||||
connect(this, SIGNAL(cameraInfoReceived(rtabmap::CameraInfo)), this, SLOT(processCameraInfo(rtabmap::CameraInfo)));
|
||||
|
||||
qRegisterMetaType<rtabmap::OdometryEvent>("rtabmap::OdometryEvent");
|
||||
connect(this, SIGNAL(odometryReceived(rtabmap::OdometryEvent)), this, SLOT(processOdometry(rtabmap::OdometryEvent)));
|
||||
connect(this, SIGNAL(odometryReceived(rtabmap::OdometryEvent, bool)), this, SLOT(processOdometry(rtabmap::OdometryEvent, bool)));
|
||||
|
||||
connect(this, SIGNAL(noMoreImagesReceived()), this, SLOT(notifyNoMoreImages()));
|
||||
|
||||
@@ -776,7 +776,7 @@ void MainWindow::handleEvent(UEvent* anEvent)
|
||||
if(!_processingOdometry && !_processingStatistics)
|
||||
{
|
||||
_processingOdometry = true; // if we receive too many odometry events!
|
||||
emit odometryReceived(*odomEvent);
|
||||
emit odometryReceived(*odomEvent, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -786,7 +786,7 @@ void MainWindow::handleEvent(UEvent* anEvent)
|
||||
data.setStereoCameraModel(odomEvent->data().stereoCameraModel());
|
||||
data.setGroundTruth(odomEvent->data().groundTruth());
|
||||
OdometryEvent tmp(data, odomEvent->pose(), odomEvent->covariance(), odomEvent->info().copyWithoutData());
|
||||
emit odometryReceived(tmp);
|
||||
emit odometryReceived(tmp, true);
|
||||
}
|
||||
}
|
||||
else if(anEvent->getClassName().compare("ULogEvent") == 0)
|
||||
@@ -818,7 +818,7 @@ void MainWindow::processCameraInfo(const rtabmap::CameraInfo & info)
|
||||
_ui->statsToolBox->updateStat("Camera/Time scan_from_depth/ms", (float)info.id, info.timeScanFromDepth*1000.0f);
|
||||
}
|
||||
|
||||
void MainWindow::processOdometry(const rtabmap::OdometryEvent & odom)
|
||||
void MainWindow::processOdometry(const rtabmap::OdometryEvent & odom, bool dataIgnored)
|
||||
{
|
||||
UDEBUG("");
|
||||
_processingOdometry = true;
|
||||
@@ -1039,21 +1039,24 @@ void MainWindow::processOdometry(const rtabmap::OdometryEvent & odom)
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!cloudUpdated && _cloudViewer->getAddedClouds().contains("cloudOdom"))
|
||||
if(!dataIgnored)
|
||||
{
|
||||
_cloudViewer->setCloudVisibility("cloudOdom", false);
|
||||
}
|
||||
if(!scanUpdated && _cloudViewer->getAddedClouds().contains("scanOdom"))
|
||||
{
|
||||
_cloudViewer->setCloudVisibility("scanOdom", false);
|
||||
}
|
||||
if(!scanUpdated && _cloudViewer->getAddedClouds().contains("scanMapOdom"))
|
||||
{
|
||||
_cloudViewer->setCloudVisibility("scanMapOdom", false);
|
||||
}
|
||||
if(!featuresUpdated && _cloudViewer->getAddedClouds().contains("featuresOdom"))
|
||||
{
|
||||
_cloudViewer->setCloudVisibility("featuresOdom", false);
|
||||
if(!cloudUpdated && _cloudViewer->getAddedClouds().contains("cloudOdom"))
|
||||
{
|
||||
_cloudViewer->setCloudVisibility("cloudOdom", false);
|
||||
}
|
||||
if(!scanUpdated && _cloudViewer->getAddedClouds().contains("scanOdom"))
|
||||
{
|
||||
_cloudViewer->setCloudVisibility("scanOdom", false);
|
||||
}
|
||||
if(!scanUpdated && _cloudViewer->getAddedClouds().contains("scanMapOdom"))
|
||||
{
|
||||
_cloudViewer->setCloudVisibility("scanMapOdom", false);
|
||||
}
|
||||
if(!featuresUpdated && _cloudViewer->getAddedClouds().contains("featuresOdom"))
|
||||
{
|
||||
_cloudViewer->setCloudVisibility("featuresOdom", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user