Skip to content

Commit

Permalink
fix(goal_planner): fix freespace planning chattering (#8981)
Browse files Browse the repository at this point in the history
Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
  • Loading branch information
kosuke55 authored Sep 30, 2024
1 parent 92bec0d commit 841c331
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1329,9 +1329,12 @@ BehaviorModuleOutput GoalPlannerModule::planPullOverAsOutput(
return getPreviousModuleOutput();
}

const bool is_freespace =
thread_safe_data_.getPullOverPlannerType() == PullOverPlannerType::FREESPACE;
if (
path_decision_controller_.get_current_state().state ==
PathDecisionState::DecisionKind::NOT_DECIDED &&
!is_freespace &&
needPathUpdate(
planner_data_->self_odometry->pose.pose, 1.0 /*path_update_duration*/, *parameters_)) {
// if the final path is not decided and enough time has passed since last path update,
Expand Down Expand Up @@ -1370,9 +1373,7 @@ BehaviorModuleOutput GoalPlannerModule::planPullOverAsOutput(
setOutput(context_data, output);

// return to lane parking if it is possible
if (
thread_safe_data_.getPullOverPlannerType() == PullOverPlannerType::FREESPACE &&
canReturnToLaneParking(context_data)) {
if (is_freespace && canReturnToLaneParking(context_data)) {
thread_safe_data_.set_pull_over_path(thread_safe_data_.get_lane_parking_pull_over_path());
}

Expand Down

0 comments on commit 841c331

Please sign in to comment.