Change order of spawn points getter

This commit is contained in:
PabloVD 2024-12-10 18:25:30 +01:00 committed by Blyron
parent 6ac39eed34
commit 311cb71a4e
1 changed files with 3 additions and 3 deletions

View File

@ -21,6 +21,9 @@ client = carla.Client('localhost', 2000)
world = client.get_world()
bp_lib = world.get_blueprint_library()
# Get the map spawn points
spawn_points = world.get_map().get_spawn_points()
# spawn vehicle
vehicle_bp =bp_lib.find('vehicle.lincoln.mkz_2020')
vehicle = world.try_spawn_actor(vehicle_bp, random.choice(spawn_points))
@ -37,9 +40,6 @@ settings.synchronous_mode = True # Enables synchronous mode
settings.fixed_delta_seconds = 0.05
world.apply_settings(settings)
# Get the map spawn points
spawn_points = world.get_map().get_spawn_points()
# Create a queue to store and retrieve the sensor data
image_queue = queue.Queue()
camera.listen(image_queue.put)