Skip to content

Commit

Permalink
Wait for replanning_period also when starting a goal
Browse files Browse the repository at this point in the history
  • Loading branch information
corot committed Nov 23, 2023
1 parent 85898d0 commit b6d30ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mbf_abstract_nav/src/move_base_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ bool MoveBaseAction::replanningActive() const
void MoveBaseAction::replanningThread()
{
ros::Duration update_period(0.005);
ros::Time last_replan_time(0.0);
ros::Time last_replan_time = ros::Time::now();

while (ros::ok() && !replanning_thread_shutdown_)
{
Expand Down Expand Up @@ -564,6 +564,7 @@ void MoveBaseAction::replanningThread()
}
else if (!replanningActive())
{
last_replan_time = ros::Time::now();
update_period.sleep();
}
else if (ros::Time::now() - last_replan_time >= replanning_period_)
Expand Down

0 comments on commit b6d30ba

Please sign in to comment.