From cfc6ee6fa11671778116bd89aef4539a166ec918 Mon Sep 17 00:00:00 2001 From: nsubiron Date: Tue, 2 Jul 2019 17:40:53 +0200 Subject: [PATCH] Package the project in shipping mode --- CHANGELOG.md | 1 + Docs/configuring_the_simulation.md | 126 +++++++++--------- Docs/faq.md | 15 --- .../Carla/Sensor/ObstacleDetectionSensor.cpp | 5 +- Util/BuildTools/Package.sh | 2 +- Util/Docker/Release.Dockerfile | 4 +- 6 files changed, 73 insertions(+), 80 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 059feb344..ef621602b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ * Add access to vehicle transmission details * Add access to vehicle physics brake values + * The simulator is now compiled in "Shipping" mode, faster but it accepts less command-line arguments * Enabled texture streaming for scene captures - Enabled texture streaming in the Unreal project settings - Changed the scene capture to register its camera with Unreal's texture streamer every tick to enable texture streaming diff --git a/Docs/configuring_the_simulation.md b/Docs/configuring_the_simulation.md index cf3e4d3f1..662f65b03 100644 --- a/Docs/configuring_the_simulation.md +++ b/Docs/configuring_the_simulation.md @@ -4,6 +4,68 @@ Before you start running your own experiments there are few details to take into account at the time of configuring your simulation. In this document we cover the most important ones. +Changing the map +---------------- + +The map can be changed from the Python API with + +```py +world = client.load_map('Town01') +``` + +this creates an empty world with default settings. The list of currently +available maps can be retrieved with + +```py +print(client.get_available_maps()) +``` + +To reload the world using the current active map, use + +```py +world = client.reload_world() +``` + +Running off-screen +------------------ + +In Linux, you can force the simulator to run off-screen by setting the +environment variable `DISPLAY` to empty + +!!! important + **DISPLAY= only works with OpenGL**
+ Vulkan is now the default graphics API used by Unreal Engine and CARLA on + Linux. Unreal Engine currently crashes when Vulkan is used when running + off-screen. Therefore the -opengl flag must be added to force the engine to + use OpenGL instead. We hope that this issue is addressed by Epic in the near + future. + +```sh +# Linux +DISPLAY= ./CarlaUE4.sh -opengl +``` + +This launches the simulator without simulator window, of course you can still +connect to it normally and run the example scripts. Note that with this method, +in multi-GPU environments, it's not possible to select the GPU that the +simulator will use for rendering. To do so, follow the instruction in +[Running without display and selecting GPUs](carla_headless.md). + +No-rendering mode +----------------- + +It is possible to completely disable rendering in the simulator by enabling +_no-rendering mode_ in the world settings. This way is possible to simulate +traffic and road behaviours at very high frequencies without the rendering +overhead. Note that in this mode, cameras and other GPU-based sensors return +empty data. + +```py +settings = world.get_settings() +settings.no_rendering_mode = True +world.apply_settings(settings) +``` + Fixed time-step --------------- @@ -52,65 +114,6 @@ world.apply_settings(settings) no longer in sync with the physics engine. Ref. [#695](https://github.com/carla-simulator/carla/issues/695) - -Changing the map ----------------- - -The map can be selected by passing the path to the map as first argument when -launching the simulator - -```sh -# Linux -./CarlaUE4.sh /Game/Carla/Maps/Town01 -``` - -```cmd -rem Windows -CarlaUE4.exe /Game/Carla/Maps/Town01 -``` - -The path "/Game/" maps to the Content folder of our repository in -"Unreal/CarlaUE4/Content/". - -Running off-screen ------------------- - -In Linux, you can force the simulator to run off-screen by setting the -environment variable `DISPLAY` to empty - -!!! important - **DISPLAY= only works with OpenGL**
- Vulkan is now the default graphics API used by Unreal Engine and CARLA on - Linux. Unreal Engine currently crashes when Vulkan is used when running off-screen. - Therefore the -opengl flag must be added to force the engine to use OpenGL instead. - We hope that this issue is addressed by Epic in the near future. - -```sh -# Linux -DISPLAY= ./CarlaUE4.sh -opengl -``` - -This launches the simulator without simulator window, of course you can still -connect to it normally and run the example scripts. Note that with this method, -in multi-GPU environments, it's not possible to select the GPU that the -simulator will use for rendering. To do so, follow the instruction in -[Running without display and selecting GPUs](carla_headless.md). - -No-rendering mode ------------------ - -It is possible to completely disable rendering in the simulator by enabling -_no-rendering mode_ in the world settings. This way is possible to simulate -traffic and road behaviours at very high frequencies without the rendering -overhead. Note that in this mode, cameras and other GPU-based sensors return -empty data. - -```py -settings = world.get_settings() -settings.no_rendering_mode = True -world.apply_settings(settings) -``` - Synchronous mode ---------------- @@ -156,9 +159,10 @@ at the example [synchronous_mode.py][syncmodelink]. Other command-line options -------------------------- - * `-carla-port=N` Listen for client connections at port N, streaming port is set to N+1. + * `-carla-rpc-port=N` Listen for client connections at port N, streaming port is set to N+1 by default. + * `-carla-streaming-port=N` Specify the port for sensor data streaming, use 0 to get a random unused port. * `-quality-level={Low,Epic}` Change graphics quality level, "Low" mode runs significantly faster. * `-no-rendering` Disable rendering. - * [Full list of UE4 command-line arguments][ue4clilink]. + * [Full list of UE4 command-line arguments][ue4clilink] (note that many of these won't work in the release version). [ue4clilink]: https://docs.unrealengine.com/en-US/Programming/Basics/CommandLineArguments diff --git a/Docs/faq.md b/Docs/faq.md index 699382b1a..caa66b132 100644 --- a/Docs/faq.md +++ b/Docs/faq.md @@ -84,21 +84,6 @@ For more issues related to F.A.Q. see [question list](https://github.com/carla-s - -
-
- Is it possible to dump images from the CARLA simulator view? -
- - Yes, this is an Unreal Engine feature. You can dump the images of the spectator - camera (simulator view) by running CARLA with - - $ ./CarlaUE4.sh -benchmark -fps=30 -dumpmovie - - Images are saved to "CarlaUE4/Saved/Screenshots/LinuxNoEditor". - -
-
diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/ObstacleDetectionSensor.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/ObstacleDetectionSensor.cpp index 8fb8a7307..22364b28a 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/ObstacleDetectionSensor.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/ObstacleDetectionSensor.cpp @@ -42,11 +42,12 @@ void AObstacleDetectionSensor::Set(const FActorDescription &Description) "only_dynamics", Description.Variations, bOnlyDynamics); +#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST) bDebugLineTrace = UActorBlueprintFunctionLibrary::RetrieveActorAttributeToBool( "debug_linetrace", Description.Variations, bDebugLineTrace); - +#endif } void AObstacleDetectionSensor::Tick(float DeltaSeconds) @@ -63,6 +64,7 @@ void AObstacleDetectionSensor::Tick(float DeltaSeconds) // Initialization of Query Parameters FCollisionQueryParams TraceParams(FName(TEXT("ObstacleDetection Trace")), true, this); +#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST) // If debug mode enabled, we create a tag that will make the sweep be // displayed. if (bDebugLineTrace) @@ -71,6 +73,7 @@ void AObstacleDetectionSensor::Tick(float DeltaSeconds) CurrentWorld->DebugDrawTraceTag = TraceTag; TraceParams.TraceTag = TraceTag; } +#endif // Hit against complex meshes TraceParams.bTraceComplex = true; diff --git a/Util/BuildTools/Package.sh b/Util/BuildTools/Package.sh index 9f0c8ffb6..a451513ba 100755 --- a/Util/BuildTools/Package.sh +++ b/Util/BuildTools/Package.sh @@ -68,7 +68,7 @@ if $DO_PACKAGE ; then ${UE4_ROOT}/Engine/Build/BatchFiles/RunUAT.sh BuildCookRun \ -project="${PWD}/CarlaUE4.uproject" \ -nocompileeditor -nop4 -cook -stage -archive -package \ - -clientconfig=Development -ue4exe=UE4Editor \ + -clientconfig=Shipping -ue4exe=UE4Editor \ -prereqs -targetplatform=Linux -build -utf8output \ -archivedirectory="${BUILD_FOLDER}" diff --git a/Util/Docker/Release.Dockerfile b/Util/Docker/Release.Dockerfile index 71c2d10a4..f01f461d9 100644 --- a/Util/Docker/Release.Dockerfile +++ b/Util/Docker/Release.Dockerfile @@ -1,6 +1,6 @@ # Make sure drivers are >= 390 # docker run -p 2000-2002:2000-2002 --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=ID carla:latest ./CarlaUE4.sh -# /Game/Carla/Maps/Town01 -benchmark -carla-server -fps=10 -world-port=2000 -windowed -ResX=100 -ResY=100 -carla-no-hud +# -carla-rpc-port=2000 -carla-streaming-port=2001 FROM nvidia/opengl:1.0-glvnd-runtime-ubuntu16.04 @@ -17,4 +17,4 @@ WORKDIR /home/carla ENV SDL_VIDEODRIVER=offscreen -CMD /bin/bash CarlaUE4.sh -carla-server +CMD /bin/bash CarlaUE4.sh