planning: fixed a bug making the last pose published again even after stuck detected

This commit is contained in:
matlabbe
2015-09-27 12:01:02 -04:00
parent 88e67f047a
commit 7ea730bb0a
+9 -6
View File
@@ -3618,13 +3618,16 @@ void Rtabmap::updateGoalIndex()
_pathStuckIterations); _pathStuckIterations);
_pathStuckCount = 0; _pathStuckCount = 0;
_pathUnreachableNodes.insert(_pathGoalIndex); _pathUnreachableNodes.insert(_pathGoalIndex);
// select previous one // select previous reachable one
if(_pathGoalIndex == 0 || --_pathGoalIndex <= _pathCurrentIndex) while(_pathUnreachableNodes.find(_pathGoalIndex) != _pathUnreachableNodes.end())
{ {
// plan failed! if(_pathGoalIndex == 0 || --_pathGoalIndex <= _pathCurrentIndex)
UERROR("No upcoming nodes on the path are reachable! Aborting the plan..."); {
this->clearPath(-1); // plan failed!
return; UERROR("No upcoming nodes on the path are reachable! Aborting the plan...");
this->clearPath(-1);
return;
}
} }
} }
else if(!sameGoalIndex || !sameCurrentIndex) else if(!sameGoalIndex || !sameCurrentIndex)