mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +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);
|
distanceToCurrentGoal = currentPose.getDistanceSquared(iter->second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(distanceToCurrentGoal > 0.0f)
|
if(distanceToCurrentGoal > 0.0f)
|
||||||
{
|
{
|
||||||
if(_pathStuckDistance > 0.0f &&
|
if(distanceToCurrentGoal >= _pathStuckDistance)
|
||||||
distanceToCurrentGoal >= _pathStuckDistance)
|
|
||||||
{
|
{
|
||||||
// we are not approaching the goal
|
// we are not approaching the goal
|
||||||
isStuck = true;
|
isStuck = true;
|
||||||
}
|
if(_pathStuckDistance == 0.0f)
|
||||||
else
|
{
|
||||||
{
|
_pathStuckDistance = distanceToCurrentGoal;
|
||||||
_pathStuckDistance = distanceToCurrentGoal;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user