SkillAgentSearch skills...

DecisionPlanning

The repository implements some decision-making and contingency planning (contingency model predictive control) methods.

Install / Use

/learn @ZhaiMen-Hub/DecisionPlanning

README

DecisionPlanning

The repository implements some decision-making and contingency planning methods.

If you find this work useful or interesting, please kindly give me a star ⭐, thanks!😀

Star History Chart

Requirements

  • System: Ubuntu 20.04 (Tested on Win11 WSL2 )
  • Python 3.8.10: numpy == 1.24.4 matplotlib == 3.7.4 casadi == 3.6.5

Contingency MPC / Contingency Planning

How to run

  • Navigate to the root folder

  • Uncomment the corresponding code block of settings in ContingencyMPC/CMPC.py (enable CMPC - obstacle pops out as follows)

    # CMPC - obstacle pops out
    obs_pop = True
    Pc = 0.25        # Cost weight for contingency control
    
    # # CMPC - obstacle does not pop out
    # obs_pop = False
    # Pc = 1e-2       # for unique minimum solution
    
    # # RMPC
    # obs_pop = False
    # Pc = 1.0 - 1e-2   
    
  • Run the script python3 ContingencyMPC/CMPC.py

  • The anime and figures are saved in ContingencyMPC/log/

Results

  • CMPC - obstacle pops out (at k = 4)
    • at k = 5, the nominal planner observes this movement and recognizes the contingency has occurred
<img src="./README.assets/mpc_animation.gif" style="zoom: 67%;" />
  • CMPC - obstacle pops out (at k=4)
<img src="./README.assets/mpc_animation-1721010789883-1.gif" style="zoom:67%;" />
  • RMPC
    • assumes the worst case evolution of the scene (follow the contingency planner, the red triangles), even though the obstacle never pops out
<img src="./README.assets/mpc_animation-1721010810644-3.gif" style="zoom:67%;" />

Reference

Game-Theoretic Motion Planning

How to run

  • Uncomment the corresponding code block of settings in Game-Theoretic Motion Planning/Game.py

    KF = 0.01
    KL = 1 - KF
    # distF = 20    # collision ditance (conservative)
    distF = 10    # collision ditance (agressive)
    distL = 15
    Kinfluence = 0
    
    # KF = 0.5
    # KL = 1 - KF
    # distF = 20    # collision ditance
    # distL = 20
    # Kinfluence = 1 # add Jinfluence
    
  • Run the script python3 Game-Theoretic Motion Planning/Game.py

  • The anime and figures are saved in Game-Theoretic Motion Planning/log/

Results

  • Aggressive follower: Leader (automated vehicles) performs an aggressive lane change
<img src="./README.assets/Game_animation.gif" alt="Game_animation" style="zoom:67%;" />
  • Conservative follower: Leader accelerates before performing lane change (also the Fig 4. of [Burger, 2022])
<img src="./README.assets/Game_animation-1722329898665-2.gif" alt="Game_animation" style="zoom:67%;" />

Reference

Game-Theoretic CMPC

How to run

  • Uncomment the corresponding code block of settings in Game-Theoretic Motion Planning/CMPCGame.py

    # scenario
    
    decel = True        # whether follower will decelarate
    # decel = False
    
  • Run the script python3 Game-Theoretic Motion Planning/CMPCGame.py

  • The anime and figures are saved in Game-Theoretic Motion Planning/log/

Results

  • Follower decelerate
<img src="./README.assets/CMPCGame_animation.gif" alt="CMPCGame_animation" style="zoom: 67%;" />
  • Follower does not decelerate
<img src="./README.assets/CMPCGame_animation-1724510471142-2.gif" alt="CMPCGame_animation" style="zoom:67%;" />

Reference

View on GitHub
GitHub Stars142
CategoryDevelopment
Updated26d ago
Forks43

Languages

Python

Security Score

85/100

Audited on Mar 9, 2026

No findings