Skip to content

Commit

Permalink
return previous module output if LC module status is IDLE
Browse files Browse the repository at this point in the history
Signed-off-by: mohammad alqudah <alqudah.mohammad@tier4.jp>
  • Loading branch information
mkquda committed Mar 7, 2025
1 parent ded5f5b commit 81e8df0
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ BehaviorModuleOutput LaneChangeInterface::plan()
resetPathCandidate();
resetPathReference();

// plan() should be called only when the module is in the RUNNING state, but
// due to planner manager implementation, it can be called in the IDLE state.
// TODO(Azu, Quda): consider a proper fix.
if (getCurrentStatus() == ModuleStatus::IDLE) {
auto output = getPreviousModuleOutput();
path_reference_ = std::make_shared<PathWithLaneId>(output.reference_path);
return output;
}

auto output = module_type_->generateOutput();
path_reference_ = std::make_shared<PathWithLaneId>(output.reference_path);

Expand Down

0 comments on commit 81e8df0

Please sign in to comment.