From 2be630bc54fb3decd76a326c5d1bb7844905c078 Mon Sep 17 00:00:00 2001 From: Tomohito Ando Date: Wed, 6 Mar 2024 19:00:50 +0900 Subject: [PATCH] feat(behavior_velocity_traffic_light): don't use the time to red if it is unavailable Signed-off-by: Tomohito Ando --- planning/behavior_velocity_planner/src/node.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/planning/behavior_velocity_planner/src/node.cpp b/planning/behavior_velocity_planner/src/node.cpp index 2ece273715425..b5d019820bebe 100644 --- a/planning/behavior_velocity_planner/src/node.cpp +++ b/planning/behavior_velocity_planner/src/node.cpp @@ -344,6 +344,11 @@ void BehaviorVelocityPlannerNode::onTrafficSignalsRawV2I( std::lock_guard lock(mutex_); for (const auto & car_light : msg->car_lights) { + // If the time to red is not available, skip it + if (!car_light.has_max_rest_time || !car_light.has_min_rest_time) { + continue; + } + for (const auto & state : car_light.states) { TrafficSignalTimeToRedStamped time_to_red; time_to_red.stamp = msg->header.stamp;