mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-03 01:50:24 +08:00
MainWindow: Re-added rotation of the map on the graph view based on gps, if used and if priors are ignored by optimizer
This commit is contained in:
@@ -271,6 +271,7 @@ public:
|
|||||||
bool isSLAMMode() const;
|
bool isSLAMMode() const;
|
||||||
bool isRGBDMode() const;
|
bool isRGBDMode() const;
|
||||||
int getKpMaxFeatures() const;
|
int getKpMaxFeatures() const;
|
||||||
|
bool isPriorIgnored() const;
|
||||||
|
|
||||||
//specific
|
//specific
|
||||||
bool isStatisticsPublished() const;
|
bool isStatisticsPublished() const;
|
||||||
|
|||||||
@@ -1905,6 +1905,22 @@ void MainWindow::processStats(const rtabmap::Statistics & stat)
|
|||||||
uInsert(labels, std::pair<int, std::string>(*iter)); // overwrite labels because they could have been modified
|
uInsert(labels, std::pair<int, std::string>(*iter)); // overwrite labels because they could have been modified
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(_preferencesDialog->isPriorIgnored() &&
|
||||||
|
_ui->graphicsView_graphView->getWorldMapRotation()==0.0f &&
|
||||||
|
stat.getLastSignatureData().sensorData().gps().stamp()!=0.0 &&
|
||||||
|
stat.poses().find(stat.getLastSignatureData().id())!=stat.poses().end())
|
||||||
|
{
|
||||||
|
float bearing = (float)((-(stat.getLastSignatureData().sensorData().gps().bearing()-90))*M_PI/180.0);
|
||||||
|
float gpsRotationOffset = stat.poses().at(stat.getLastSignatureData().id()).theta()-bearing;
|
||||||
|
_ui->graphicsView_graphView->setWorldMapRotation(gpsRotationOffset);
|
||||||
|
}
|
||||||
|
else if(!_preferencesDialog->isPriorIgnored() &&
|
||||||
|
_ui->graphicsView_graphView->getWorldMapRotation() != 0.0f)
|
||||||
|
{
|
||||||
|
_ui->graphicsView_graphView->setWorldMapRotation(0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
std::map<int, Transform> poses = stat.poses();
|
std::map<int, Transform> poses = stat.poses();
|
||||||
|
|
||||||
UDEBUG("time= %d ms", time.restart());
|
UDEBUG("time= %d ms", time.restart());
|
||||||
|
|||||||
@@ -5422,6 +5422,10 @@ int PreferencesDialog::getKpMaxFeatures() const
|
|||||||
{
|
{
|
||||||
return _ui->surf_spinBox_wordsPerImageTarget->value();
|
return _ui->surf_spinBox_wordsPerImageTarget->value();
|
||||||
}
|
}
|
||||||
|
bool PreferencesDialog::isPriorIgnored() const
|
||||||
|
{
|
||||||
|
return _ui->graphOptimization_priorsIgnored->isChecked();
|
||||||
|
}
|
||||||
|
|
||||||
/*** SETTERS ***/
|
/*** SETTERS ***/
|
||||||
void PreferencesDialog::setInputRate(double value)
|
void PreferencesDialog::setInputRate(double value)
|
||||||
|
|||||||
Reference in New Issue
Block a user