mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-29 18:42:07 +08:00
sim: improve carla performance (#23046)
old-commit-hash: a4ca8e4835949f5f8a5d6123142f9ffcb7e36245
This commit is contained in:
+11
-1
@@ -221,13 +221,20 @@ def bridge(q):
|
||||
client.set_timeout(10.0)
|
||||
world = client.load_world(args.town)
|
||||
|
||||
settings = world.get_settings()
|
||||
settings.synchronous_mode = True # Enables synchronous mode
|
||||
settings.fixed_delta_seconds = 0.05
|
||||
world.apply_settings(settings)
|
||||
|
||||
world.set_weather(carla.WeatherParameters.ClearSunset)
|
||||
|
||||
if args.low_quality:
|
||||
world.unload_map_layer(carla.MapLayer.Foliage)
|
||||
world.unload_map_layer(carla.MapLayer.Buildings)
|
||||
world.unload_map_layer(carla.MapLayer.ParkedVehicles)
|
||||
world.unload_map_layer(carla.MapLayer.Particles)
|
||||
world.unload_map_layer(carla.MapLayer.Props)
|
||||
world.unload_map_layer(carla.MapLayer.StreetLights)
|
||||
world.unload_map_layer(carla.MapLayer.Particles)
|
||||
|
||||
blueprint_library = world.get_blueprint_library()
|
||||
|
||||
@@ -414,6 +421,9 @@ def bridge(q):
|
||||
if rk.frame % PRINT_DECIMATION == 0:
|
||||
print("frame: ", "engaged:", is_openpilot_engaged, "; throttle: ", round(vc.throttle, 3), "; steer(c/deg): ", round(vc.steer, 3), round(steer_out, 3), "; brake: ", round(vc.brake, 3))
|
||||
|
||||
if rk.frame % 5 == 0:
|
||||
world.tick()
|
||||
|
||||
rk.keep_time()
|
||||
|
||||
# Clean up resources in the opposite order they were created.
|
||||
|
||||
@@ -24,4 +24,4 @@ docker run \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
|
||||
-it \
|
||||
carlasim/carla:0.9.12 \
|
||||
/bin/bash ./CarlaUE4.sh -opengl -nosound -RenderOffScreen -quality-level=Epic
|
||||
/bin/bash ./CarlaUE4.sh -opengl -nosound -RenderOffScreen -benchmark -fps=20 -quality-level=High
|
||||
|
||||
Reference in New Issue
Block a user