Skip to content

Commit fcc11e1

Browse files
authored
fix(bvp): traffic light state debug (#1083)
Signed-off-by: Mehmet Dogru <mdogru@leodrive.ai>
1 parent 18843b2 commit fcc11e1

File tree

1 file changed

+6
-2
lines changed
  • planning/behavior_velocity_traffic_light_module/src

1 file changed

+6
-2
lines changed

planning/behavior_velocity_traffic_light_module/src/scene.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ bool TrafficLightModule::modifyPathVelocity(PathWithLaneId * path, StopReason *
225225

226226
first_ref_stop_path_point_index_ = stop_line_point_idx;
227227

228+
// Check if stop is coming.
229+
setSafe(!isStopSignal());
230+
228231
const auto rest_time_to_red_signal =
229232
planner_data_->getRestTimeToRedSignal(traffic_light_reg_elem_.id());
230233
if (
@@ -246,8 +249,6 @@ bool TrafficLightModule::modifyPathVelocity(PathWithLaneId * path, StopReason *
246249
return true;
247250
}
248251

249-
// Check if stop is coming.
250-
setSafe(!isStopSignal());
251252
if (isActivated()) {
252253
is_prev_state_stop_ = false;
253254
return true;
@@ -291,6 +292,9 @@ bool TrafficLightModule::updateTrafficSignal()
291292

292293
if (!found_signal) {
293294
// Don't stop when UNKNOWN or TIMEOUT as discussed at #508
295+
// Reset looking_tl_state
296+
looking_tl_state_.elements.clear();
297+
looking_tl_state_.traffic_signal_id = 0;
294298
return false;
295299
}
296300

0 commit comments

Comments
 (0)