Skip to content

Latest commit

 

History

History
132 lines (82 loc) · 6.26 KB

simulators.rst

File metadata and controls

132 lines (82 loc) · 6.26 KB

Supported Simulators

Scenic is designed to be easily interfaced to any simulator (see new_simulator). On this page we list interfaces that we and others have developed; if you have a new interface, let us know and we'll list it here!

Note that not every interface supports all Scenic features: in particular, some interfaces do not support dynamic scenarios. See the individual entries for details on each interface's capabilities and how to set it up.

List of Simulators

Currently Supported

Built-in Newtonian Simulator

To enable debugging of dynamic scenarios without having to install an external simulator, Scenic includes a simple 2D Newtonian physics simulator. The simulator supports scenarios written using the cross-platform driving_domain, and can render top-down views showing the positions of objects relative to the road network. See the documentation of the scenic.simulators.newtonian module for details.

CARLA

Our interface to the CARLA simulator enables using Scenic to describe autonomous driving scenarios. The interface supports dynamic scenarios written using the CARLA world model (scenic.simulators.carla.model) as well as scenarios using the cross-platform driving_domain. To use the interface, please follow these instructions:

  1. Install the latest version of CARLA (we've tested versions 0.9.9 through 0.9.14) from the CARLA Release Page. Note that CARLA currently only supports Linux and Windows.
  2. Install Scenic in your Python virtual environment as instructed in quickstart.
  3. Within the same virtual environment, install CARLA's Python API. How to do this depends on the CARLA version and whether you built it from source:

    0.9.12+

    Run the following command, replacing X.Y.Z with the version of CARLA you installed:

    python -m pip install carla==X.Y.Z

    Older Versions

    For older versions of CARLA, you'll need to install its Python API from the provided .egg file. If your system has the easy_install command, you can run:

    easy_install /PATH_TO_CARLA_FOLDER/PythonAPI/carla/dist/carla-0.9.9-py3.7-linux-x86_64.egg

    The exact name of the .egg file may vary depending on the version of CARLA you installed; make sure to use the file for Python 3, not 2. You may get an error message saying Could not find suitable distribution, which you can ignore.

    The easy_install command is deprecated and may not exist if you have a newer version of Python. In that case, you can try setting your PYTHONPATH environment variable to include the egg with a command like:

    export PYTHONPATH=/PATH_TO_CARLA_FOLDER/PythonAPI/carla/dist/carla-0.9.9-py3.7-linux-x86_64.egg

    Built from Source

    If you built CARLA from source, the process is more involved: see the detailed instructions here.

You can check that the carla package was correctly installed by running python -c 'import carla': if it prints No module named 'carla', the installation didn't work. We suggest upgrading to a newer version of CARLA so that you can use pip to install the Python API.

To start CARLA, run the command ./CarlaUE4.sh in your CARLA folder. Once CARLA is running, you can run dynamic Scenic scenarios following the instructions in the dynamics tutorial <dynamics_running_examples>.

Grand Theft Auto V

The interface to Grand Theft Auto V, used in our PLDI paper, allows Scenic to position cars within the game as well as to control the time of day and weather conditions. Many examples using the interface (including all scenarios from the paper) can be found in examples/gta. See the paper and scenic.simulators.gta for documentation.

Importing scenes into GTA V and capturing rendered images requires a GTA V plugin, which you can find here.

Webots

We have several interfaces to the Webots robotics simulator, for different use cases. Our main interface provides a generic world model that can be used with any Webots world and supports dynamic scenarios. See the examples/webots folder for example Scenic scenarios and Webots worlds using this interface, and scenic.simulators.webots for documentation.

Scenic also includes more specialized world models for use with Webots:

  • A general model for traffic scenarios, used in our VerifAI paper. Examples using this model can be found in the VerifAI repository; see also the documentation of scenic.simulators.webots.road.

Note

The last model above, and the example .wbt files for it, was written for the R2018 version of Webots. Relatively minor changes would be required to make it work with the newer open source versions of Webots. We may get around to porting them eventually; we'd also gladly accept a pull request!

X-Plane

Our interface to the X-Plane flight simulator enables using Scenic to describe aircraft taxiing scenarios. This interface is part of the VerifAI toolkit; documentation and examples can be found in the VerifAI repository.

Deprecated

Scenic previously provided interfaces to these simulators, but no longer does. See individual entries for the last version of Scenic providing the interface and the reason it is no longer supported.

LGSVL

The LGSVL simulator (a.k.a. SVL Simulator) was deprecated in Scenic 3.0, with the last version of Scenic supporting this simulator being 2.1. The original simulator is no longer usable due to LG shutting down its cloud service, but we are open to a PR targeting one of its forks.