carla/Docs/release_readme.md

140 lines
4.5 KiB
Markdown
Raw Normal View History

2017-10-24 23:07:23 +08:00
CARLA Simulator
===============
2017-03-31 23:54:06 +08:00
2017-10-24 23:07:23 +08:00
Welcome to CARLA simulator.
2017-10-24 23:07:23 +08:00
This file contains the instructions to run the CARLA simulator binaries on
Linux.
2017-10-24 23:07:23 +08:00
Running the Python client
-------------------------
2017-03-31 23:54:06 +08:00
2017-10-24 23:07:23 +08:00
Requires Python 3 and the protobuf module installed, saving images to disk
requires the PIL module too.
$ sudo apt-get install python3 python3-pip
2017-10-26 23:23:13 +08:00
$ sudo pip3 install protobuf
2017-10-24 23:07:23 +08:00
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
2017-10-26 20:52:05 +08:00
A second Python script is provided at `PythonClient/client_manual_control.py`. The
script is pygame dependent and servers as an interactive example where the user controls
the car with a keyboard Run the help command to see options available
$ ./client_manual_control.py --help
2017-10-24 23:07:23 +08:00
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.
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
2017-03-31 23:54:06 +08:00
2017-09-07 21:55:41 +08:00
To run the game windowed at a given resolution
2017-10-24 23:07:23 +08:00
$ ./CarlaUE4.sh /Game/Maps/Town01 -benchmark -fps=15 -windowed -ResX=800 -ResY=600
2017-09-07 21:55:41 +08:00
2017-10-24 23:07:23 +08:00
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
2017-03-31 23:54:06 +08:00
* `-carla-settings=<ini-file-path>` Load settings from the given INI file. See Example.CarlaSettings.ini.
2017-10-24 23:07:23 +08:00
* `-carla-world-port=<port-number>` Listen for client connections at <port-number>, agent ports are set to <port-number>+1 and <port-number>+2 respectively. Activates networking.
* `-carla-no-networking` Disable networking. Overrides other settings.
* `-carla-no-hud` Do not display the HUD by default.
2017-05-04 00:41:39 +08:00
2017-10-24 23:07:23 +08:00
#### 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.
2017-05-20 00:41:15 +08:00
2017-10-24 23:07:23 +08:00
1. `{ProjectFolder}/Config/CarlaSettings.ini`
2. File provided by command-line argument `-carla-settings=<path-to-ini-file>`
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
2017-05-20 00:41:15 +08:00
* 0 - Default
* 1 - ClearNoon
* 2 - CloudyNoon
* 3 - WetNoon
* 4 - WetCloudyNoon
* 5 - MidRainyNoon
* 6 - HardRainNoon
* 7 - SoftRainNoon
* 8 - ClearSunset
* 9 - CloudySunset
* 10 - WetSunset
* 11 - WetCloudySunset
* 12 - MidRainSunset
* 13 - HardRainSunset
* 14 - SoftRainSunset
E.g., to choose the weather to be hard-rain at noon, add to CarlaSettings.ini
```
[CARLA/LevelSettings]
WeatherId=6
```