Giter Site home page Giter Site logo

yurawoo / intersection-planning-with-mpc-approach-for-autonomous-vehicles Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paulyehtw/intersection-planning-with-mpc-approach-for-autonomous-vehicles

0.0 0.0 0.0 1.22 MB

Implement an MPC approach to coordinate automated vehicles with fixed priorities

Python 100.00%

intersection-planning-with-mpc-approach-for-autonomous-vehicles's Introduction

Intersection-planning-with-MPC-approach-for-autonomous-vehicles

To run the simulation, just install Python 3.6 and run the MPC_planner.py file

The intersection planning problem can be divided into two parts : priority assignment problem and vehicle control problem. This project assumes that it the priority is governed by the European right hand driving traffic rules, which means vehicles must defer to vehicles arriving on the road to its right. So here only the vehicle control problem is tackled and the Model Predictive Control approach is implemented.

Intersection scenario setting :

  1. An ego will show up at the left lane of the intersection at random position and with random velocity between 5 m/s and 20 m/s.
  2. A prior car (the car arriving from the right) will show up also at the right lane to ego car at random position and with random velocity.
  3. The prior car will no yield to the ego car.
  4. All vehicles will go straight to cross the intersection, no turns will be made.
  5. Measurements from prior car is accurate without noise
  6. Communication between planner and ego car is ideal and without delay, whic means the speed command at timestamp t can be reached at timestamp t+1

Constraints subjected to the MPC cost function :

  1. The ego car must drive with velocity in range of [0, 20] m/s.
  2. The ego car must drive with acceleration in range of [-2, 2] m/s^2.
  3. The change of acceleration must be within [-0.2, 0.2] m/s^2 between each time step for the sake of driving comfort.
  4. A quadratic cost function is chosen for the MPC as follows : Cv(vel_target - vel_next)^2 + Ca(acc^2), where vel_target is set to 20 m/s, Cv and Ca are factors for tuning.

Simulation settings :

  1. Time step is 0.1 second.
  2. Prediction horizon for the MPC is 50 steps (5 seconds).
  3. Timeout threshold is 150 steps if the ego car does not reach goal.

Simulation results over 10000 episodes:

  1. The ego car doesnt yield to the prior car 2531 times in 10000 episodes(25%), it is because the initial position is too close to the intersection or initial velocity is too fast, the controller cannot stop the car if constraints are obeyed(See figure 1 below).
  2. The ego car timeouted 103 times in 10000 episodes(1%) because the prior car is too slow and ego needs to wait for it to pass(See figure 2 below).
  3. The efficiency of the algorithm is evaluated, on average the ego car needs 1.8 steps to travel 1 meter.
  4. The comfort index is evaluated, on average the acceleration is 1.6 m/s^2.

Figure 1 : Crash scenario

Figure 2 : Timeout scenario

intersection-planning-with-mpc-approach-for-autonomous-vehicles's People

Contributors

paulyehtw 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.