From 958e97c918ceb56ee3864d15711b0de7ae41e54a Mon Sep 17 00:00:00 2001 From: Liyuan Zhu Date: Wed, 26 Feb 2025 14:34:46 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20Spawn=5FFahrzeuge=5FNna.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Spawn_Fahrzeuge_Nna.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Spawn_Fahrzeuge_Nna.py b/Spawn_Fahrzeuge_Nna.py index 573a65c..dae6f8d 100644 --- a/Spawn_Fahrzeuge_Nna.py +++ b/Spawn_Fahrzeuge_Nna.py @@ -1,3 +1,4 @@ +# Fahrzeugeimplementierung import carla import random import time @@ -67,7 +68,7 @@ map_name = world.get_map().name print("Loaded map name:", map_name) - +# Vorfahrtregeln festlegen # Define uncontrolled intersections (add more coordinates if needed) INTERSECTION_ZONES = [ carla.Location(x=100, y=200, z=0), @@ -129,7 +130,7 @@ def manage_uncontrolled_intersections(): - +# The Code try to adjusts the position of two colliding vehicles to separate them. collision_status = {} # Statut de collision entre véhicules def has_collision(vehicle1, vehicle2): @@ -222,8 +223,12 @@ def communicate_with_other_vehicle(vehicle): vehicle.stop() other.move() -# detection la ligne d'arret en avance +# The code based of the speed and stop_time of vehicles +# check if vehicles has 0.0 m/s speed and +# stop_time ist more than 30 seconds +# that means the vehicle is blocked and +# will be removed STOP_DISTANCE = 10 # Distance avant la ligne d'arrêt def detect_stop_line(vehicle,stop_line_position): @@ -256,7 +261,7 @@ def ensure_correct_stop(vehicle): - +# The code adjust the position of ambulance # Classe représentant un camion class Truck: def __init__(self, vehicle):