Giter Club home page Giter Club logo

scenario_runner_rl's Introduction

ScenarioRunner-RL

License: MIT

This repository is a fork from the official carla-simulator/scenario_runner. It is meant to be used combined with model/checkpoint trained by our fork of MARLlib.

Currently based on branch tag/0.9.13.

Getting started

Currently, you can try with:

cd scenario_runner

python scenario_runner.py --host 127.0.0.1 --port 2000 --openscenario srunner/examples/RLTest_Town01.xosc --sync --reloadWorld 

Note: In order to keep the repository small, we will distribute the trained model/checkpoint in Releases. You can download them and put them in the srunner/examples/rl_models folder.

Changes

The RL inference support is added as an "extension" to the original scenario_runner, with minimal changes to the original code. This project should be fully compatible to run non-RL scenarios.

Added files

  1. srunner/extension. Folder for extensions, currently only rl_integrate folder.
  2. srunner/examples/rl_models. Folder for RL models/checkpoints.

Modified files

  1. srunner/autoagents/agent_wrapper.py

    • Code formatting and type annotations.
    • Import rl_integrate module. This is done in a try-except block, so that the original scenario_runner can still run without the module.
    • Add support for RLAgent class, which is a wrapper for RL inference.
    • Complement the destruction logic for AgentWrapper class.
  2. srunner/autoagents/sensor_interface.py

    • Add support for carla.ColorConverter. This will not change the default behavior of the original scenario_runner.
  3. srunner/scenariomanager/carla_data_provider.py

    • Code formatting and type annotations.
    • Add new data pool _actor_velocity_vector_map and _actor_acceleration_map.
    • For all get_xxx functions, add new function called get_xxx_by_id, which takes an actor id as input.
    • Other changes are made for our custom UE4 build, which should not affect the original scenario_runner.
  4. srunner/scenariomanager/scenario_manager.py

    • Import rl_integrate module. This is done in a try-except block, so that the original scenario_runner can still run without the module.
    • Register all agents to RL blackboard
    • on each tick, update information for RL (RlAgent.on_carla_tick())
    • add some function to check and enable heterogeneous agents action space padding.
  5. srunner/examples/catalogs/ControllerCatalog.xosc

    • Add a new controller catagory "RLControl"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.