CARLA Simulator: Difference between revisions
No edit summary |
|||
Line 26: | Line 26: | ||
;Notes | ;Notes | ||
* If you want a clean shutdown, you need to disable autopilot on the ego_vehicle before you destroy it. | * If you want a clean shutdown, you need to disable autopilot on the ego_vehicle before you destroy it. | ||
==Build From Source== | |||
To develop vehicles or make significant changes, you will want to build from source. | |||
{{hidden | Build From Source | | |||
See [https://carla.readthedocs.io/en/latest/build_linux/#linux-build-command-summary Linux build summary] | |||
* Get Unreal Engine cloning the UnrealEngine repo and building it. | |||
** You will need an Epic Games account linked to your GitHub to have access to the source code. | |||
* Clone the carla repo and download assets. | |||
}} | |||
==Fixed time step== | ==Fixed time step== |
Revision as of 13:29, 16 July 2020
CARLA is a simulator for self-driving cars.
Getting Started
Installation
Follow the steps at QuickStart.
pip install --user pygame numpy sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 92635A407F7A020C sudo add-apt-repository "deb [arch=amd64 trusted=yes] http://dist.carla.org/carla-0.9.9/ all main" sudo apt-get update sudo apt-get install carla-simulator cd /opt/carla-simulator
Running a simulation
- Start the server by running
/opt/carla-simulator/bin/CarlaUE4.sh
Now you will need to write a client in Python. The client handles setting up the scene and all sensor data. See Tutorial: Retrieve Data and scroll down to tutorial_ego.py.
- Notes
- If you want a clean shutdown, you need to disable autopilot on the ego_vehicle before you destroy it.
Build From Source
To develop vehicles or make significant changes, you will want to build from source.
- Get Unreal Engine cloning the UnrealEngine repo and building it.
- You will need an Epic Games account linked to your GitHub to have access to the source code.
- Clone the carla repo and download assets.
Fixed time step
Normal games run at realtime, i.e. frames are generated as fast as possble (or limited by vsync) and the time between frames set based on the elapsed time. For demos and games, this is fine. However for simulations, you will want to fix the time between frames to a constant value. This allows faster-than-realtime simulations on more powerful hardware and slower-than-realtime simulations on slower hardware.
Below sets the timestep to 1/30
seconds per frame.
./CarlaUE4.sh -benchmark -fps=30