Skip to content

Commit

Permalink
fix(bvp): traffic light state debug (#1083)
Browse files Browse the repository at this point in the history
Signed-off-by: Mehmet Dogru <[email protected]>
  • Loading branch information
mehmetdogru authored and saka1-s committed Feb 2, 2024
1 parent 4c83b08 commit 6c667d7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions planning/behavior_velocity_traffic_light_module/src/scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 6c667d7

Please sign in to comment.