mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-01 17:10:26 +08:00
Reset stuck when moving toward the goal
This commit is contained in:
@@ -3889,17 +3889,17 @@ void Rtabmap::updateGoalIndex()
|
||||
distanceToCurrentGoal = currentPose.getDistanceSquared(iter->second);
|
||||
}
|
||||
}
|
||||
|
||||
if(distanceToCurrentGoal > 0.0f)
|
||||
{
|
||||
if(_pathStuckDistance > 0.0f &&
|
||||
distanceToCurrentGoal >= _pathStuckDistance)
|
||||
if(distanceToCurrentGoal >= _pathStuckDistance)
|
||||
{
|
||||
// we are not approaching the goal
|
||||
isStuck = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_pathStuckDistance = distanceToCurrentGoal;
|
||||
if(_pathStuckDistance == 0.0f)
|
||||
{
|
||||
_pathStuckDistance = distanceToCurrentGoal;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user