Skip to content

Commit 2be630b

Browse files
committed
feat(behavior_velocity_traffic_light): don't use the time to red if it is unavailable
Signed-off-by: Tomohito Ando <tomohito.ando@tier4.jp>
1 parent eb15a2b commit 2be630b

File tree

1 file changed

+5
-0
lines changed
  • planning/behavior_velocity_planner/src

1 file changed

+5
-0
lines changed

planning/behavior_velocity_planner/src/node.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,11 @@ void BehaviorVelocityPlannerNode::onTrafficSignalsRawV2I(
344344
std::lock_guard<std::mutex> lock(mutex_);
345345

346346
for (const auto & car_light : msg->car_lights) {
347+
// If the time to red is not available, skip it
348+
if (!car_light.has_max_rest_time || !car_light.has_min_rest_time) {
349+
continue;
350+
}
351+
347352
for (const auto & state : car_light.states) {
348353
TrafficSignalTimeToRedStamped time_to_red;
349354
time_to_red.stamp = msg->header.stamp;

0 commit comments

Comments
 (0)