From 7ddf45ba13fac860f5dea57ebd7690a43e075562 Mon Sep 17 00:00:00 2001 From: nsubiron Date: Tue, 24 Oct 2017 17:07:23 +0200 Subject: [PATCH] Documentation --- Docs/Example.CarlaSettings.ini | 25 +++--- Docs/carla_settings.md | 8 +- Docs/index.md | 2 +- Docs/release_readme.md | 152 ++++++++++++++++++++++++--------- 4 files changed, 129 insertions(+), 58 deletions(-) diff --git a/Docs/Example.CarlaSettings.ini b/Docs/Example.CarlaSettings.ini index 1bdbdad27..722c4e6b4 100644 --- a/Docs/Example.CarlaSettings.ini +++ b/Docs/Example.CarlaSettings.ini @@ -1,7 +1,7 @@ ; Example of settings file for CARLA. [CARLA/Server] -; If set to false, a mock controller will be used instead of waiting for a +; If set to false, a mock controller will be used instead of waiting for a real ; client to connect. UseNetworking=true ; Ports to use for the server-client communication. This can be overridden by @@ -10,10 +10,13 @@ UseNetworking=true WorldPort=2000 ; Time-out in milliseconds for the networking operations. ServerTimeOut=10000 -; In synchronous mode, CARLA waits every tick until the control from the client +; In synchronous mode, CARLA waits every frame until the control from the client ; is received. SynchronousMode=true -; Send info about every non-player agent in the scene every frame. +; Send info about every non-player agent in the scene every frame, the +; information is attached to the measurements message. This includes other +; vehicles, pedestrians and traffic signs. Disabled by default to improve +; performance. SendNonPlayerAgentsInfo=false [CARLA/LevelSettings] @@ -21,29 +24,27 @@ SendNonPlayerAgentsInfo=false ; Paths follow the pattern "/Game/Blueprints/Vehicles/Mustang/Mustang.Mustang_C" PlayerVehicle= ; Number of non-player vehicles to be spawned into the level. -NumberOfVehicles=5 +NumberOfVehicles=15 ; Number of non-player pedestrians to be spawned into the level. -NumberOfPedestrians=15 +NumberOfPedestrians=30 ; Index of the weather/lighting presets to use. If negative, the default presets ; of the map will be used. -WeatherId=-1 +WeatherId=1 ; Seeds for the pseudo-random number generators. SeedVehicles=123456789 SeedPedestrians=123456789 [CARLA/SceneCapture] -; Names of the scene capture cameras to be attached to the player, -; comma-separated, each of them should be defined in its own subsection. +; Names of the cameras to be attached to the player, comma-separated, each of +; them should be defined in its own subsection. Cameras=MyCamera -; Defaults for all cameras can be set here too. - [CARLA/SceneCapture/MyCamera] ; Post-processing effect to be applied. Valid values: ; * None No effects applied. ; * SceneFinal Post-processing present at scene (bloom, fog, etc). -; * Depth Depth map only. -; * SemanticSegmentation Semantic segmentation only. +; * Depth Depth map ground-truth only. +; * SemanticSegmentation Semantic segmentation ground-truth only. PostProcessing=SceneFinal ; Size of the captured image in pixels. ImageSizeX=800 diff --git a/Docs/carla_settings.md b/Docs/carla_settings.md index fadd1f7ca..ab50151cb 100644 --- a/Docs/carla_settings.md +++ b/Docs/carla_settings.md @@ -1,8 +1,8 @@ CARLA Settings ============== -The CARLA plugin reads its settings from a "CarlaSettings.ini" file. This file -controls most aspects of the game, and it is loaded every time a new episode is +CARLA reads its settings from a "CarlaSettings.ini" file. This file controls +most aspects of the simulation, and it is loaded every time a new episode is started (every time the level is loaded). Settings are loaded following the next hierarchy, with values later in the @@ -15,7 +15,7 @@ hierarchy overriding earlier values. Take a look at the [CARLA Settings example](Example.CarlaSettings.ini). -**Important:** If you are in editor, you most probably want to disable -networking. Otherwise the game will hang until a client connects. Copy +IMPORTANT: If you are in editor, you most probably want to disable networking. +Otherwise the game will hang until a client connects. Copy "Example.CarlaSettings.ini" to "CARLAUE4/Config/CarlaSettings.ini" and set `UseNetworking=false`. diff --git a/Docs/index.md b/Docs/index.md index ca3d41478..df4b27273 100644 --- a/Docs/index.md +++ b/Docs/index.md @@ -25,9 +25,9 @@ Index #### Setup + * [How to run CarlaUE4 binary](release_readme.md) * [How to build on Linux](how_to_build_on_linux.md) * [How to build on Windows](how_to_build_on_windows.md) - * [How to run CarlaUE4 binary](release_readme.md) * [CARLA Settings](carla_settings.md) #### Development diff --git a/Docs/release_readme.md b/Docs/release_readme.md index 6f12420c1..396de59de 100644 --- a/Docs/release_readme.md +++ b/Docs/release_readme.md @@ -1,41 +1,134 @@ -CARLA UE4 -========= +CARLA Simulator +=============== -To run the game with the second city +Welcome to CARLA simulator. - $ ./CarlaUE4.sh /Game/Maps/CARLA_ORIGIN_1 +This file contains the instructions to run the CARLA simulator binaries on +Linux. -To run the game at fixed time-step, e.g. 30 FPS +Running the Python client +------------------------- - $ ./CarlaUE4.sh -benchmark -fps=30 +Requires Python 3 and the protobuf module installed, saving images to disk +requires the PIL module too. + + $ sudo apt-get install python3 python3-pip + $ sudo pip install protobuf + +A sample Python script is provided at `PythonClient/client_example.py`. The +script is well commented explaining how to use the client API. + +The script can be run and provides basic functionality for controlling the +vehicle and saving images to disk. Run the help command to see options available + + $ ./client_example.py --help + +Running the server +------------------ + +IMPORTANT: By default the game starts in networking mode. It will hang until a +client is connected. See below how to run it without client. + +IMPORTANT: Semantic segmentation ground-truth is disabled by default due to its +impact on performance. See below how to enable it. + +The server can be started by running the `CarlaUE4.sh` script. When run in +networking mode (controlled by the CARLA client), it is highly recommended to +run it at fixed time-step + + $ ./CarlaUE4.sh /Game/Maps/Town01 -benchmark -fps=15 + +The arguments `-benchmark -fps=15` make the engine run at a fixed time-step of +1/15 seconds. In this mode, game-time decouples from real-time and the +simulation runs as fast as possible. + +To run the game on the second city, just change the command to select the +"Town02" + + $ ./CarlaUE4.sh /Game/Maps/Town02 -benchmark -fps=15 To run the game windowed at a given resolution - $ ./CarlaUE4.sh -windowed -ResX=800 -ResY=600 + $ ./CarlaUE4.sh /Game/Maps/Town01 -benchmark -fps=15 -windowed -ResX=800 -ResY=600 -Other CARLA related command-line options +The game can also be run without a client, this way you can drive around the +city just using the keyboard (in this mode is not recommended to use fixed +frame-rate to get a more realistic feeling) + + $ ./CarlaUE4.sh /Game/Maps/Town02 -carla-no-networking + +#### CARLA command-line options * `-carla-settings=` Load settings from the given INI file. See Example.CarlaSettings.ini. - * `-carla-world-port=` Listen for client connections at , write and read ports are set to +1 and +2 respectively. Activates networking. - * `-carla-no-networking` Disable networking. Overrides any other settings file. + * `-carla-world-port=` Listen for client connections at , agent ports are set to +1 and +2 respectively. Activates networking. + * `-carla-no-networking` Disable networking. Overrides other settings. * `-carla-no-hud` Do not display the HUD by default. -To activate semantic segmentation ---------------------------------- +#### Enable semantic segmentation ground-truth -In the config file `CarlaUE4/Saved/Config/LinuxNoEditor/Engine.ini`, add the -following +Semantic segmentation ground-truth is disabled by default due to its impact on +performance. When disabled, semantic segmentation images will display a single +red color for every object. To make the engine draw the right tags we need to +activate the custom depth in the configuration file. + +Open the configuration file `CarlaUE4/Saved/Config/LinuxNoEditor/Engine.ini`, +and add the following ``` [/Script/Engine.RendererSettings] r.CustomDepth=3 ``` -Weather presets ---------------- +Now run the game as usual and semantic segmentation images will be produced with +the right tags. -To change the weather and sun light, set `WeatherId` in CarlaSettings.ini -from the following +#### In-game controls + +The following key bindings are available during game play at the server window. +Note that vehicle controls are only available when networking is disabled. + + W : throttle + S : brake + AD : steer + Q : toggle reverse + Space : hand-brake + + P : toggle autopilot + + Arrow keys : move camera + PgUp PgDn : zoom in and out + mouse wheel : zoom in and out + Tab : toggle on-board camera + + R : restart level + G : toggle HUD + C : change weather/lighting + + Enter : jump + F : use the force + +Settings +-------- + +CARLA reads its settings from a "CarlaSettings.ini" file. This file controls +most aspects of the simulator, and it is loaded every time a new episode is +started (every time the level is loaded). + +Settings are loaded following the next hierarchy, with values later in the +hierarchy overriding earlier values. + + 1. `{ProjectFolder}/Config/CarlaSettings.ini` + 2. File provided by command-line argument `-carla-settings=` + 3. Other command-line arguments as `-world-port`, or `-carla-no-networking` + 4. Settings file sent by the client on every new episode. + +Take a look at the Example.CarlaSettings.ini file for further details. + +#### Weather presets + +The weather and lighting conditions can be chosen from a set of predefined +settings. To select one, set the `WeatherId` key in CarlaSettings.ini. The +following presets are available * 0 - Default * 1 - ClearNoon @@ -59,26 +152,3 @@ E.g., to choose the weather to be hard-rain at noon, add to CarlaSettings.ini [CARLA/LevelSettings] WeatherId=6 ``` - -In-game controls ----------------- - - W : throttle - S : brake - AD : steer - Q : toggle reverse - Space : hand-brake - - P : toggle autopilot - - Arrow keys : move camera - PgUp PgDn : zoom in and out - mouse wheel : zoom in and out - Tab : toggle on-board camera - - R : restart level - G : toggle HUD - C : change weather/lighting - - Enter : jump - F : use the force