Skip to content

Commit aeadff6

Browse files
committed
fix(behavior_velocity_traffic_light): do not use the timed out remaining time information
Signed-off-by: Tomohito Ando <tomohito.ando@tier4.jp>
1 parent 8331314 commit aeadff6

File tree

1 file changed

+3
-5
lines changed
  • planning/behavior_velocity_traffic_light_module/src

1 file changed

+3
-5
lines changed

planning/behavior_velocity_traffic_light_module/src/scene.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,11 @@ bool TrafficLightModule::modifyPathVelocity(PathWithLaneId * path, StopReason *
239239
// stop for the traffic signal
240240
const auto rest_time_to_red_signal =
241241
planner_data_->getRestTimeToRedSignal(traffic_light_reg_elem_.id());
242+
const bool is_time_to_red_signal_available =
243+
(rest_time_to_red_signal.has_value() && !isDataTimeout(rest_time_to_red_signal->stamp));
242244
const bool is_stop_required = is_unknown_signal || is_signal_timed_out;
243245

244-
if (planner_param_.v2i_use_rest_time && rest_time_to_red_signal && !is_stop_required) {
246+
if (planner_param_.v2i_use_rest_time && is_time_to_red_signal_available && !is_stop_required) {
245247
if (!canPassStopLineBeforeRed(*rest_time_to_red_signal, signed_arc_length_to_stop_point)) {
246248
*path = insertStopPose(input_path, stop_line_point_idx, stop_line_point, stop_reason);
247249
}
@@ -517,10 +519,6 @@ bool TrafficLightModule::canPassStopLineBeforeRed(
517519
const TrafficSignalTimeToRedStamped & time_to_red_signal,
518520
const double distance_to_stop_line) const
519521
{
520-
if (isDataTimeout(time_to_red_signal.stamp)) {
521-
return false;
522-
}
523-
524522
const double rest_time_allowed_to_go_ahead =
525523
time_to_red_signal.time_to_red - planner_param_.v2i_last_time_allowed_to_pass;
526524

0 commit comments

Comments
 (0)