Skip to content

Commit

Permalink
fix(lane_change): set initail rtc state properly (#8902)
Browse files Browse the repository at this point in the history
set initail rtc state properly

Signed-off-by: Go Sakayori <[email protected]>
  • Loading branch information
go-sakayori authored Sep 19, 2024
1 parent f8dc16f commit 2a2d037
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 2a2d037

Please sign in to comment.