From 6c667d7021dbadf11dd4ce4260b8e0ad1da9363c Mon Sep 17 00:00:00 2001 From: Mehmet Dogru <48479081+mehmetdogru@users.noreply.github.com> Date: Mon, 22 Jan 2024 18:17:26 +0900 Subject: [PATCH] fix(bvp): traffic light state debug (#1083) Signed-off-by: Mehmet Dogru --- .../behavior_velocity_traffic_light_module/src/scene.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/planning/behavior_velocity_traffic_light_module/src/scene.cpp b/planning/behavior_velocity_traffic_light_module/src/scene.cpp index 46999d4122346..233d553d15e4e 100644 --- a/planning/behavior_velocity_traffic_light_module/src/scene.cpp +++ b/planning/behavior_velocity_traffic_light_module/src/scene.cpp @@ -225,6 +225,9 @@ bool TrafficLightModule::modifyPathVelocity(PathWithLaneId * path, StopReason * first_ref_stop_path_point_index_ = stop_line_point_idx; + // Check if stop is coming. + setSafe(!isStopSignal()); + const auto rest_time_to_red_signal = planner_data_->getRestTimeToRedSignal(traffic_light_reg_elem_.id()); if ( @@ -246,8 +249,6 @@ bool TrafficLightModule::modifyPathVelocity(PathWithLaneId * path, StopReason * return true; } - // Check if stop is coming. - setSafe(!isStopSignal()); if (isActivated()) { is_prev_state_stop_ = false; return true; @@ -291,6 +292,9 @@ bool TrafficLightModule::updateTrafficSignal() if (!found_signal) { // Don't stop when UNKNOWN or TIMEOUT as discussed at #508 + // Reset looking_tl_state + looking_tl_state_.elements.clear(); + looking_tl_state_.traffic_signal_id = 0; return false; }