Giter Site home page Giter Site logo

xushenlz / conflict_rez Goto Github PK

View Code? Open in Web Editor NEW
19.0 3.0 0.0 5.41 MB

Conflict resolution for multiple vehicles in tight spaces

Home Page: https://bit.ly/rl-cr

License: GNU General Public License v3.0

Python 99.18% CMake 0.82%
conflict-resolution optimal-control reinforcement-learning trajectory-planning

conflict_rez's Introduction

conflict_rez

Conflict resolution for multiple vehicles in confined spaces

Xu Shen ([email protected]), Francesco Borrelli

Project Webpage: https://bit.ly/rl-cr

rl-control-side-by-side - 2022-11-01 10-44-17 00_00_00-00_00_30

Install

  1. Clone this repo
  2. Run pip install -e . in the root level of this repo (A virtualenv is recommended). However, due to some buggy dependencies between package versions, you need to manually switch the following packages to specific versions (while ignoring the warning given by the pip dependency resolver):
    1. pip install pettingzoo==1.20.1
    2. pip install supersuit==3.5.0
    3. pip install stable-baselines3==1.6.0
    4. pip install gym==0.25.0

Testing

  1. A pretrained model can be downloaded here.
  2. Run python confrez/rl/experiment.py to see the steps taken by the DQN policy to resolve the conflict in the discrete environment.
  3. Run python confrez/rl/record_states_history.py to generate a .pkl file that records the steps taken by the RL agents, which will serve as the configuration strategies for the trajectory planning problems.
  4. Run python confrez/control/vehicle.py to plan a single-vehicle collision free trajectory following the strategy-guided configurations.
  5. (Centralized method) Run python confrez/control/multi_vehicle_planner.py to solve the multi-vehicle trajectory planning problem to resolve conflict.
  6. (Distributed method) Run python confrez/control/vehicle_follower.py so that each vehicle generates its own strategy-guided reference trajectory, and then follows it with distributed MPC to avoid collisions.

Training

  1. Run python confrez/rl/train.py to train a new policy.
  2. You may set the random_reset argument to True so that you train the policy with a random subset out of 4 vehicles, which may lead to a more generalizable policy. But it also require longer training time.
  3. Different random seeds and different parameter tuning will lead to different behaviors in the trained policy. With your new policy, the vehicles may (almost for sure) take different actions and resolve the conflict in another way.

conflict_rez's People

Contributors

thomasfork avatar xushenlz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

conflict_rez's Issues

Feature request: update PettingZoo version

Hi, would it be possible to update this repo to use the most recent version of PettingZoo? We want to list this project in PettingZoo's third-party-environments, but we can only include environments which work with the current version.

If you need any help working out issues due to different versions feel free to ask, there were some breaking changes in version 1.2, so it requires a bit of code changes to adapt. The previous API returned done in the step() function, whereas the new one returns truncated and terminated (matching gymnasium). There is a migration guide for gymnasium explaining the changes further, the steps should be basically the same (we're working on making resources for updating old PettingZoo repositories as well): https://gymnasium.farama.org/content/migration-guide/

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.