GithubHelp home page GithubHelp logo

wenbo9045 / computation-of-interactive-reachebale-set Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xin-jonas/computation-of-interactive-reachebale-set

0.0 0.0 0.0 11.26 MB

License: MIT License

Python 100.00%

computation-of-interactive-reachebale-set's Introduction

Computing Interaction-aware Reachable Sets of Automated Vehicles by Monte Carlo Tree Search

The project is developed and verified based on the CommonRoad. The main problem is that the current calculation process of reachable sets is; first predict the trajectory of other vehicles, and then calculate the reachable sets. So the resulting reachable sets do not take into account the impact between vehicles. So this project uses MCTS to solve the vehicle interaction problem and obtain interaction-aware reachable sets.

Reference

  • Tactical cooperative planning for autonomous highway driving using Monte-Carlo tree search
  • Computing the drivable area of autonomous road vehicles in dynamic road scenes
  • CommonRoad-Reach: A Toolbox for Reachability Analysis of Automated Vehicles

Request Initialization Packages

We recommend using Ubuntu 18.04 and 20.04. And use Anaconda to create a conda environment to manage the required packages and libraries.

  • CommonRoad-IO

      pip install commonroad-io
    
  • CommonRoad Route Planner

      pip install commonroad-route-planner
    
  • CommonRoad Drivabilibty Check

    The intialization of this package refers to this CommonRoad dc Domumentation. We git clone the following branch:

    https://gitlab.lrz.de/cps/commonroad-drivability-checker/-/tree/development

    and use the following command to initial:

      bash build.sh -j 6 --cgal -i
    
  • CommonRoad Reach

    The readme.md in this package provides a detailed activation tutorial. But it should be noted that:

    You need to specify commonroad-drivability-checker package path that can be detected, that is, DCRDC_DIR instead of CRDC_DIR, otherwise the package will not be found.

          DCRDC_DIR="<your path>/commonroad-drivability-checker" pip install -v .
    

    Secondly, use cmake to compile the file

          cmake .. -DPYTHON_VER="cpython-37" -DCRDC_DIR="<your path>/commonroad-drivability-checker"
    

    Use the make to generate pycrreach.xxx.so, which needs to be copied and moved to the file directory commonroad-reachable-set/commonroad-reach. Finally, you can run the file to test whether the activation is successful,

File Struct

  • scenario

    Test scenarios are download from CommonRoad Benchmark.

  • idm_model

    This folder contains two files, which implement the IDM follow-up model.

  • monte_carlo_tree_serach

    • config.py: Definition of gloable variables
    • actions.py: Each Action is a value (acceleration)
    • actions_range.py: Each Action is an range of acceleration
    • basefunctions.py: This file applies to action is an acceleration range. The file integrates various functional equations: Collision detection, target area detection, reference path generation, idm agent definition, heuristic random selection, etc.
    • basefunctions_O.py: This file is similar to basefunctions.py, but applied to acrion is a value.
    • mcts_node.py: Basic componnets of MCTS.
    • mcts_idm_sim_reach.py: Reliazation of MCTS. An interval action is used and in simulation stage, the sequence decision will be made. The behaviour of surrounding vehicles is stimulated by the IDM model and the behaviour of ego vehicle will be controlled by heuristic random selection based on the action system.
    • mcts_v.py: Reliazation of MCTS. Action is a value and will be used only one sample tinme. In simulation stage, only the ego vehicle will be controlled by action sytem, the trajectories of other vehicles will be directly used to simulation.
    • mcts_v5.py: Similar to mcts_v.py. Only one difference is that the action will be used for five sample times.
    • mcts_idm_sim_v5.py: Reliazation of MCTS. In simulation stage, the surrouding vehicles will be simulated by IDM, the action for ego vehicle is a value.
    • visualization.py: Visulization of the simulated result.
    • Others: Test for different realization of MCTS.
  • mcst_example.py

    This file is to test the MCST with the action( a value). Simulation results include the postion and acceleration over time. And a gif file for ego vehilce shows that the ego vehicle moved based on the action list from MCTS.

  • reach_example.py

    This file is to test the MCST with the action( an range). Simulation results include action list and will be output to calulate the reachable sets. And a gif file for ego vehilce shows the interaction-aware reachable sets over time.

    Notice:

Because we continuously update the maximum and minimum acceleration in the calculation of the reachable set, we need to update the zero state polygon at the same time when updating. And ensure that the reachable set is pruned at the end. So the source files in commonroad-reach need to be modified, and the modified files in the commonroad-reach need to replace the original files.

Uesage of Programm

MCTS with a value action

Run mcst_example.py with mcts_idm_sim_v5.py for the test scenario DEU_IV21-1_1_T-1.xml.

The simularion result:

Editor

Ego vehicle (id = 7) first decelerating for keeping a distance to leader vehilce (id = 6). Then ego vehicle accelerates to the desired velocity. Wenn the velocity of ego vehicle is higher than the desired velocity, the ego vehicle dont accelerating any more. The gif shows the result.

Editor

MCTS with an range action

Run reach_example.py with mcts_idm_sim_reach.py for the test scenario ZAM_Intersection-1_2_T-1.xml.

The first picture is the original reachable sets. The second picture shows the simulation results with the desired velocity of ego vehicle (15 m/s). Interaction-aware reachable sets shows that ego vehicle crosses the intersection first, and when we reduce the desired velocity to 6, we get the third picture and find that the ego vehicle waits for another vehicle to cross the intersection.

Editor Editor Editor

computation-of-interactive-reachebale-set's People

Contributors

xin-jonas avatar

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.