All Projects → carla-rl-gym → carla-rl

carla-rl-gym / carla-rl

Licence: MIT license
Reinforcement Learning Agents Trained in the CARLA Simulator

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to carla-rl

AdverseDrive
Attacking Vision based Perception in End-to-end Autonomous Driving Models
Stars: ✭ 24 (-68.83%)
Mutual labels:  carla-simulator
PackIt
Code for reproducing results in ICML 2020 paper "PackIt: A Virtual Environment for Geometric Planning"
Stars: ✭ 45 (-41.56%)
Mutual labels:  open-ai-gym
interp-e2e-driving
Interpretable End-to-end Urban Autonomous Driving with Latent Deep Reinforcement Learning
Stars: ✭ 159 (+106.49%)
Mutual labels:  carla-simulator
telecarla
TELECARLA: An Open Source Extension of the CARLA Simulator for Teleoperated Driving Research Using Off-the-Shelf Components
Stars: ✭ 34 (-55.84%)
Mutual labels:  carla-simulator
Carla
Open-source simulator for autonomous driving research.
Stars: ✭ 7,012 (+9006.49%)
Mutual labels:  carla-simulator
osm2xodr
converter for OpenStreetMaps to OpenDrive roads - for use with Carla or other things
Stars: ✭ 90 (+16.88%)
Mutual labels:  carla-simulator
carla-colab
How to run CARLA simulator on colab
Stars: ✭ 81 (+5.19%)
Mutual labels:  carla-simulator
carla-data-export
A simple tool for generating training data from the Carla driving simulator
Stars: ✭ 47 (-38.96%)
Mutual labels:  carla-simulator
anomaly-seg
The Combined Anomalous Object Segmentation (CAOS) Benchmark
Stars: ✭ 115 (+49.35%)
Mutual labels:  carla-simulator
stadium
A graphical interface for reinforcement learning and gym-based environments. Integrates tensorboard and various configuration utilities for ease of usage.
Stars: ✭ 26 (-66.23%)
Mutual labels:  open-ai-gym

Carla RL Project

Installation and Setup

Running the CARLA Server

Our program uses the CARLA simulator as the environment. The easiest way to install CARLA is to use the Docker container by running, docker pull carlasim/carla:0.8.2

We change the default settings (the timeout) when running the server and therefore we have our own carla-server docker image that builds on this image. You can build it by running docker build server -t carla-server.

Next, you can run the server Docker container with nvidia-docker run --rm -it -p 2000-2002:2000-2002 carlasim/carla:0.8.2 /bin/bash

Note that this requires nvidia-docker to be installed on your machine (which means you will also need a GPU). Finally, inside the docker container you can run the server with ./CarlaUE4.sh /Game/Maps/Town01 -carla-server -benchmark -fps=15 -windowed -ResX=800 -ResY=600

However, since we often require running more than 1 server, we recommend using the script server/run_servers.py to run the CARLA server. You can run N servers by running (the logs for stdout and stderr will be under server_output folder): python server/run_servers.py --num-servers N In order to see the servers output docker logs -ft CONTAINER_ID follows and tails it.

Running the client (training code, benchmark code)

Our code requires:

  • Python 3
  • PyTorch
  • OpenAI Gym
  • OpenAI Baselines

We suggest that you use our own Dockerfile to install all these dependencies. You can build our client Dockerfile with, docker build client -t carla-client then you can run nvidia-docker run -it --network=host -v $PWD:/app carla-client /bin/bash The --network=host flag allows the Docker container to make requests to the server. Once you are inside the container, you can run any of our scripts like python client/train.py --config client/config/base.yaml.

Arguments and Config Files

Our client/train.py script uses both arguments and a configuration file. The configuration file specifies all components of the model. The config file should have everything necessary to reproduce the results of a given model. The arguments of the script deal with things that are independent of the model (this includes things, like for example, how often to create videos or log to Tensorboard)

Hyperparameter Tuning

To test a set of hyperparemeters see the scripts/test_hyperparameters_parallel.py script. This will let you specify a set of hyperparameters to test different from those specified in the client/config/base.yaml file.

Benchmark Results

A2C

To reproduce our results, run a CARLA server and inside the carla-client docker run, python client/train.py --config client/config/a2c.yaml

ACKTR

To reproduce our results, run a CARLA server and inside the carla-client docker run, python client/train.py --config client/config/acktr.yaml

PPO

To reproduce our results, run a CARLA server and inside the carla-client docker run, python client/train.py --config client/config/ppo.yaml

On-Policy HER

To reproduce our results, run a CARLA server and inside the carla-client docker run, python client/train.py --config client/config/her.yaml

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].