Fix #31 Make CARLA start without client by default
This commit is contained in:
parent
d12de6ad09
commit
c01492c4a2
|
@ -16,8 +16,3 @@ hierarchy overriding earlier values.
|
||||||
Take a look at the [CARLA Settings example][settingslink].
|
Take a look at the [CARLA Settings example][settingslink].
|
||||||
|
|
||||||
[settingslink]: https://github.com/carla-simulator/carla/blob/master/Docs/Example.CarlaSettings.ini
|
[settingslink]: https://github.com/carla-simulator/carla/blob/master/Docs/Example.CarlaSettings.ini
|
||||||
|
|
||||||
!!! tip
|
|
||||||
If you are in editor, you most probably want to disable networking.
|
|
||||||
Otherwise the game will hang until a client connects. Set
|
|
||||||
`UseNetworking=false` in "./Unreal/CarlaUE4/Config/CarlaSettings.ini".
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ How to build CARLA on Linux
|
||||||
|
|
||||||
Install the build tools and dependencies
|
Install the build tools and dependencies
|
||||||
|
|
||||||
$ sudo apt-get install build-essential clang-3.9 git cmake ninja-build python3-pip python3-requests python-dev tzdata curl wget unzip autoconf libtool
|
$ sudo apt-get install build-essential clang-3.9 git cmake ninja-build python3-pip python3-requests python-dev tzdata sed curl wget unzip autoconf libtool
|
||||||
$ sudo pip3 install protobuf
|
$ sudo pip3 install protobuf
|
||||||
|
|
||||||
To avoid compatibility issues between Unreal Engine and the CARLA dependencies,
|
To avoid compatibility issues between Unreal Engine and the CARLA dependencies,
|
||||||
|
|
|
@ -7,11 +7,27 @@ CARLA Simulator
|
||||||
Welcome to CARLA simulator.
|
Welcome to CARLA simulator.
|
||||||
|
|
||||||
This file contains the instructions to run the CARLA simulator binaries on
|
This file contains the instructions to run the CARLA simulator binaries on
|
||||||
Linux. [Get the latest release here.][releaselink]
|
Linux.
|
||||||
|
|
||||||
|
[Get the latest release here.][releaselink]
|
||||||
|
|
||||||
For building CARLA from source, please check out the
|
For building CARLA from source, please check out the
|
||||||
[CARLA Documentation][docslink].
|
[CARLA Documentation][docslink].
|
||||||
|
|
||||||
|
CARLA can be run directly by running the "CarlaUE4.sh" script provided in the
|
||||||
|
release package.
|
||||||
|
|
||||||
|
There are currently two scenarios available, the desired scenario can be chosen
|
||||||
|
from the command-line
|
||||||
|
|
||||||
|
$ ./CarlaUE4.sh /Game/Maps/Town01
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
$ ./CarlaUE4.sh /Game/Maps/Town02
|
||||||
|
|
||||||
|
To run CARLA as server, see ["Running the server"](#running-the-server) below.
|
||||||
|
|
||||||
[releaselink]: https://github.com/carla-simulator/carla/releases/latest
|
[releaselink]: https://github.com/carla-simulator/carla/releases/latest
|
||||||
[docslink]: http://carla.readthedocs.io
|
[docslink]: http://carla.readthedocs.io
|
||||||
|
|
||||||
|
@ -45,41 +61,33 @@ Run the help command to see options available
|
||||||
Running the server
|
Running the server
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
!!! note
|
The server can be started by running the `CarlaUE4.sh` script with some extra
|
||||||
By default the game starts in networking mode. It will hang until a client
|
arguments. When run in server mode (controlled by the CARLA client), it is
|
||||||
is connected. See below how to run it without client.
|
highly recommended to run it at fixed time-step
|
||||||
|
|
||||||
The server can be started by running the `CarlaUE4.sh` script. When run in
|
$ ./CarlaUE4.sh /Game/Maps/Town01 -carla-server -benchmark -fps=15
|
||||||
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
|
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
|
1/15 seconds. In this mode, game-time decouples from real-time and the
|
||||||
simulation runs as fast as possible.
|
simulation runs as fast as possible.
|
||||||
|
|
||||||
To run the game on the second city, just change the command to select the
|
To run the game on the second town, just change the command to select the
|
||||||
"Town02"
|
"Town02" map
|
||||||
|
|
||||||
$ ./CarlaUE4.sh /Game/Maps/Town02 -benchmark -fps=15
|
$ ./CarlaUE4.sh /Game/Maps/Town02 -carla-server -benchmark -fps=15
|
||||||
|
|
||||||
To run the game windowed at a given resolution
|
When run as server is sometimes useful to run the game in a smaller window, this
|
||||||
|
can be chosen with
|
||||||
|
|
||||||
$ ./CarlaUE4.sh /Game/Maps/Town01 -benchmark -fps=15 -windowed -ResX=800 -ResY=600
|
$ ./CarlaUE4.sh /Game/Maps/Town01 -carla-server -benchmark -fps=15 -windowed -ResX=800 -ResY=600
|
||||||
|
|
||||||
The game can also be run without a client, this way you can drive around the
|
#### CARLA specific command-line options
|
||||||
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-server` Launches CARLA as server, the execution hangs until a client connects.
|
||||||
* `-carla-settings=<ini-file-path>` Load settings from the given INI file. See Example.CarlaSettings.ini.
|
* `-carla-settings=<ini-file-path>` Load settings from the given INI file. See Example.CarlaSettings.ini.
|
||||||
* `-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-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 server.
|
||||||
* `-carla-no-networking` Disable networking. Overrides other settings.
|
|
||||||
* `-carla-no-hud` Do not display the HUD by default.
|
* `-carla-no-hud` Do not display the HUD by default.
|
||||||
|
* `-carla-no-networking` Disable networking. Overrides `-carla-server` if present.
|
||||||
|
|
||||||
#### Running CARLA off-screen
|
#### Running CARLA off-screen
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,14 @@ Troubleshooting
|
||||||
|
|
||||||
#### Editor hangs after hitting Play
|
#### Editor hangs after hitting Play
|
||||||
|
|
||||||
By default, when CARLA is started it waits for a client to be connected and
|
This is most probably happening because CARLA is started in server mode. Check
|
||||||
control the vehicle. This is the intended behavior. This can be changed in
|
in your CarlaSettings.ini file ("./Unreal/CarlaUE4/Config/CarlaSettings.ini")
|
||||||
"./Unreal/CarlaUE4/Config/CarlaSettings.ini" changing `UseNetworking=false`.
|
and set
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[CARLA/Server]
|
||||||
|
UseNetworking=false
|
||||||
|
```
|
||||||
|
|
||||||
#### Very low FPS in editor when not in focus
|
#### Very low FPS in editor when not in focus
|
||||||
|
|
||||||
|
|
3
Setup.sh
3
Setup.sh
|
@ -175,7 +175,8 @@ popd >/dev/null
|
||||||
CARLA_SETTINGS_FILE="./Unreal/CarlaUE4/Config/CarlaSettings.ini"
|
CARLA_SETTINGS_FILE="./Unreal/CarlaUE4/Config/CarlaSettings.ini"
|
||||||
|
|
||||||
if [[ ! -f $CARLA_SETTINGS_FILE ]]; then
|
if [[ ! -f $CARLA_SETTINGS_FILE ]]; then
|
||||||
cp -v ./Docs/Example.CarlaSettings.ini $CARLA_SETTINGS_FILE
|
echo "Copying CarlaSettings.ini..."
|
||||||
|
sed -e 's/UseNetworking=true/UseNetworking=false/' ./Docs/Example.CarlaSettings.ini > $CARLA_SETTINGS_FILE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./Util/Protoc.sh
|
./Util/Protoc.sh
|
||||||
|
|
|
@ -155,6 +155,9 @@ void UCarlaSettings::LoadSettings()
|
||||||
}
|
}
|
||||||
// Override settings from command-line.
|
// Override settings from command-line.
|
||||||
{
|
{
|
||||||
|
if (FParse::Param(FCommandLine::Get(), TEXT("carla-server"))) {
|
||||||
|
bUseNetworking = true;
|
||||||
|
}
|
||||||
uint32 Value;
|
uint32 Value;
|
||||||
if (FParse::Value(FCommandLine::Get(), TEXT("-world-port="), Value) ||
|
if (FParse::Value(FCommandLine::Get(), TEXT("-world-port="), Value) ||
|
||||||
FParse::Value(FCommandLine::Get(), TEXT("-carla-world-port="), Value)) {
|
FParse::Value(FCommandLine::Get(), TEXT("-carla-world-port="), Value)) {
|
||||||
|
|
|
@ -70,7 +70,7 @@ public:
|
||||||
|
|
||||||
/** If active, wait for the client to connect and control the pawn. */
|
/** If active, wait for the client to connect and control the pawn. */
|
||||||
UPROPERTY(Category = "CARLA Server", VisibleAnywhere)
|
UPROPERTY(Category = "CARLA Server", VisibleAnywhere)
|
||||||
bool bUseNetworking = true;
|
bool bUseNetworking = false;
|
||||||
|
|
||||||
/** World port to listen for client connections. */
|
/** World port to listen for client connections. */
|
||||||
UPROPERTY(Category = "CARLA Server", VisibleAnywhere, meta = (EditCondition = bUseNetworking))
|
UPROPERTY(Category = "CARLA Server", VisibleAnywhere, meta = (EditCondition = bUseNetworking))
|
||||||
|
|
Loading…
Reference in New Issue