added switch for unknown color;

This commit is contained in:
Marco Zeisler 2021-06-17 23:51:16 +02:00
parent 39fead94f9
commit 3d88059f8d

View File

@ -157,7 +157,7 @@ class Orchestrator:
i = i + 2 i = i + 2
target_vel = floor(speed_needed_max) target_vel = floor(speed_needed_max)
else: elif self.tls[tl_id]['color'] is TrafficLightColor.GREEN:
# Check if we can reach TL in time # Check if we can reach TL in time
speed_needed_min = (distance / float(time_until_switch)) * 3.6 speed_needed_min = (distance / float(time_until_switch)) * 3.6
if speed_needed_min < 130 * SCALING: if speed_needed_min < 130 * SCALING:
@ -173,5 +173,6 @@ class Orchestrator:
speed_needed_max = (distance / float(next_green_phase_start)) * 3.6 speed_needed_max = (distance / float(next_green_phase_start)) * 3.6
i = i + 2 i = i + 2
target_vel = floor(speed_needed_max) target_vel = floor(speed_needed_max)
else:
print('Unknown Traffic Light Color!')
return target_vel return target_vel