mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-03 10:00:23 +08:00
Refactored graph::getPosesInRadius -> graph::findNearestPoses. Labels can be removed: added Remove label option in MainWindow. In localization mode, label set with id=0 is set to nearest node of current pose.
This commit is contained in:
@@ -354,6 +354,7 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent, bool sh
|
||||
connect(_ui->actionSend_waypoints, SIGNAL(triggered()), this, SLOT(sendWaypoints()));
|
||||
connect(_ui->actionCancel_goal, SIGNAL(triggered()), this, SLOT(cancelGoal()));
|
||||
connect(_ui->actionLabel_current_location, SIGNAL(triggered()), this, SLOT(label()));
|
||||
connect(_ui->actionRemove_label, SIGNAL(triggered()), this, SLOT(removeLabel()));
|
||||
connect(_ui->actionClear_cache, SIGNAL(triggered()), this, SLOT(clearTheCache()));
|
||||
connect(_ui->actionAbout, SIGNAL(triggered()), _aboutDialog , SLOT(exec()));
|
||||
connect(_ui->actionHelp, SIGNAL(triggered()), this , SLOT(openHelp()));
|
||||
@@ -2300,7 +2301,6 @@ void MainWindow::processStats(const rtabmap::Statistics & stat)
|
||||
// update pose only if odometry is not received
|
||||
std::map<int, int> mapIds = _currentMapIds;
|
||||
std::map<int, Transform> groundTruth = _currentGTPosesMap;
|
||||
std::map<int, std::string> labels = _currentLabels;
|
||||
|
||||
mapIds.insert(std::make_pair(stat.getLastSignatureData().id(), stat.getLastSignatureData().mapId()));
|
||||
if(!stat.getLastSignatureData().getGroundTruthPose().isNull() &&
|
||||
@@ -2308,10 +2308,6 @@ void MainWindow::processStats(const rtabmap::Statistics & stat)
|
||||
{
|
||||
groundTruth.insert(std::make_pair(stat.getLastSignatureData().id(), stat.getLastSignatureData().getGroundTruthPose()));
|
||||
}
|
||||
for(std::map<int, std::string>::const_iterator iter=stat.labels().begin(); iter!=stat.labels().end(); ++iter)
|
||||
{
|
||||
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 &&
|
||||
@@ -2413,7 +2409,7 @@ void MainWindow::processStats(const rtabmap::Statistics & stat)
|
||||
poses,
|
||||
stat.constraints(),
|
||||
mapIds,
|
||||
labels,
|
||||
stat.labels(),
|
||||
groundTruth,
|
||||
stat.odomCachePoses(),
|
||||
stat.odomCacheConstraints(),
|
||||
@@ -2646,7 +2642,7 @@ void MainWindow::updateMapCloud(
|
||||
std::map<int, Transform> nearestPoses;
|
||||
if(maxNodes > 0)
|
||||
{
|
||||
std::map<int, float> nodes = graph::findNearestNodes(poses, currentPose, maxNodes);
|
||||
std::map<int, float> nodes = graph::findNearestNodes(currentPose, poses, 0, 0, maxNodes);
|
||||
for(std::map<int, float>::iterator iter=nodes.begin(); iter!=nodes.end(); ++iter)
|
||||
{
|
||||
if(altitudeDelta<=0.0 ||
|
||||
@@ -6947,6 +6943,17 @@ void MainWindow::label()
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::removeLabel()
|
||||
{
|
||||
UINFO("Removing label...");
|
||||
bool ok = false;
|
||||
QString label = QInputDialog::getText(this, tr("Remove label"), tr("Label: "), QLineEdit::Normal, "", &ok);
|
||||
if(ok && !label.isEmpty())
|
||||
{
|
||||
this->post(new RtabmapEventCmd(RtabmapEventCmd::kCmdRemoveLabel, label.toStdString(), 0));
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::updateCacheFromDatabase()
|
||||
{
|
||||
QString dir = getWorkingDirectory();
|
||||
|
||||
Reference in New Issue
Block a user