This repository implements an Constrained Iterative Linear Quadratic Regulator (CILQR) algorithm that incorporates constraints in the environment for on-road autonomous motion planning. For more information, see LQR与iLQR:从理论到实践【详细】
- Tested on WSL2 Ubuntu 20.04🐧
- Python >= 3.6.10, matplotlib, numpy
- Other dependencies: fmt, yamp-cpp, spdlog
Clone the repository and make:
git clone https://github.com/PuYuuu/toy-example-of-iLQR.git
cd toy-example-of-iLQR
cmake -B build
cmake --build build
You can find the corresponding python script file in the scripts
folder.
# 1. Closed-loop response of linear system under LQR controller
python scripts/0-lqr-demo.py
# 2. Path tracking using LQR
python scripts/1-lqr-pathtracking.py
# 3. Simple version of on-road motion planning by CILQR
python scripts/2-cilqr-motionplanning.py
Find the executable file in the build folder, and specify the configuration file path through -c
to start the program.
./build/motion_planning -c ./config/scenario_three_bend.yaml
In addition, you can manually modify the contents of the configuration file, including algorithm parameters, initial conditions, scenario information, etc., and observe the performance of CILQR in different scenarios. For example:
./build/motion_planning -c config/scenario_three_straight.yaml
And the scenario_two_borrow.yaml
is configured for the overtaking on the opposite lane scenario: