Skip to content

Commit

Permalink
Merge pull request #1545 from tier4/fix/beta/v0.35/lc_warning
Browse files Browse the repository at this point in the history
fix(lane_change): set initial rtc state properly (autowarefoundation#8902)
  • Loading branch information
rej55 authored Sep 20, 2024
2 parents f675b2d + 3c230eb commit 7ed77b2
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,21 @@ BehaviorModuleOutput LaneChangeInterface::plan()
} else {
const auto path =
assignToCandidate(module_type_->getLaneChangePath(), module_type_->getEgoPosition());
const auto force_activated = std::any_of(
const auto is_registered = std::any_of(
rtc_interface_ptr_map_.begin(), rtc_interface_ptr_map_.end(),
[&](const auto & rtc) { return rtc.second->isForceActivated(uuid_map_.at(rtc.first)); });
if (!force_activated) {
[&](const auto & rtc) { return rtc.second->isRegistered(uuid_map_.at(rtc.first)); });

if (!is_registered) {
updateRTCStatus(
path.start_distance_to_path_change, path.finish_distance_to_path_change, true,
State::RUNNING);
State::WAITING_FOR_EXECUTION);
} else {
const auto force_activated = std::any_of(
rtc_interface_ptr_map_.begin(), rtc_interface_ptr_map_.end(),
[&](const auto & rtc) { return rtc.second->isForceActivated(uuid_map_.at(rtc.first)); });
const bool safe = force_activated ? false : true;
updateRTCStatus(
path.start_distance_to_path_change, path.finish_distance_to_path_change, false,
path.start_distance_to_path_change, path.finish_distance_to_path_change, safe,
State::RUNNING);
}
}
Expand Down

0 comments on commit 7ed77b2

Please sign in to comment.