Skip to content

Commit

Permalink
fix(start/goal_planner): do not call freespace planner callback when …
Browse files Browse the repository at this point in the history
…not necessary (autowarefoundation#6125)

Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
  • Loading branch information
kosuke55 authored and kyoichi-sugahara committed Jan 23, 2024
1 parent a7c166a commit 39dcaa5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ void GoalPlannerModule::onTimer()

void GoalPlannerModule::onFreespaceParkingTimer()
{
if (getCurrentStatus() == ModuleStatus::IDLE) {
return;
}

if (!planner_data_) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ StartPlannerModule::StartPlannerModule(

void StartPlannerModule::onFreespacePlannerTimer()
{
if (getCurrentStatus() == ModuleStatus::IDLE) {
return;
}

if (!planner_data_) {
return;
}
Expand All @@ -97,7 +101,11 @@ void StartPlannerModule::onFreespacePlannerTimer()

const bool is_new_costmap =
(clock_->now() - planner_data_->costmap->header.stamp).seconds() < 1.0;
if (isStuck() && is_new_costmap) {
if (!is_new_costmap) {
return;
}

if (isStuck()) {
planFreespacePath();
}
}
Expand Down

0 comments on commit 39dcaa5

Please sign in to comment.