From 3d88059f8dd517cf7743b95e3e612b40f9c29626 Mon Sep 17 00:00:00 2001 From: Marco Zeisler Date: Thu, 17 Jun 2021 23:51:16 +0200 Subject: [PATCH] added switch for unknown color; --- components/orchestration/orchestrator.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/orchestration/orchestrator.py b/components/orchestration/orchestrator.py index 110d216..acee465 100644 --- a/components/orchestration/orchestrator.py +++ b/components/orchestration/orchestrator.py @@ -157,7 +157,7 @@ class Orchestrator: i = i + 2 target_vel = floor(speed_needed_max) - else: + elif self.tls[tl_id]['color'] is TrafficLightColor.GREEN: # Check if we can reach TL in time speed_needed_min = (distance / float(time_until_switch)) * 3.6 if speed_needed_min < 130 * SCALING: @@ -173,5 +173,6 @@ class Orchestrator: speed_needed_max = (distance / float(next_green_phase_start)) * 3.6 i = i + 2 target_vel = floor(speed_needed_max) - + else: + print('Unknown Traffic Light Color!') return target_vel