Skip to content

Commit

Permalink
fix(goal_planner): do not generate path candidates before execution
Browse files Browse the repository at this point in the history
Signed-off-by: kosuke55 <[email protected]>
  • Loading branch information
kosuke55 committed Oct 28, 2023
1 parent 25e8b3f commit 90ae48d
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@ void GoalPlannerModule::onTimer()
if (status_.get_goal_candidates().empty()) {
return;
}

if (!isExecutionRequested()) {
return;
}

if (
!planner_data_ ||
!goal_planner_utils::isAllowedGoalModification(planner_data_->route_handler)) {
return;
}

const auto goal_candidates = status_.get_goal_candidates();

// generate valid pull over path candidates and calculate closest start pose
Expand Down Expand Up @@ -229,6 +240,10 @@ void GoalPlannerModule::onFreespaceParkingTimer()

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

// Initialize Occupancy Grid Map
// This operation requires waiting for `planner_data_`, hence it is executed here instead of in
// the constructor. Ideally, this operation should only need to be performed once.
Expand Down Expand Up @@ -990,7 +1005,7 @@ BehaviorModuleOutput GoalPlannerModule::planWaitingApprovalWithGoalModification(
}

BehaviorModuleOutput out;
out.modified_goal = plan().modified_goal; // update status_
out.modified_goal = planWithGoalModification().modified_goal; // update status_
out.path = std::make_shared<PathWithLaneId>(generateStopPath());
out.reference_path = getPreviousModuleOutput().reference_path;
path_candidate_ = std::make_shared<PathWithLaneId>(planCandidate().path_candidate);
Expand Down

0 comments on commit 90ae48d

Please sign in to comment.