This project is for path-planning, specifically designed for four-wheeled vehicles with front-wheel steering. A* and RRT* path-finding algorithms are implemented, some modules are written in C++ to improve performance.
The vehicle is modeled with Ackermann steering geometry,
the origin
The configuration file defines a test scene. You can configure field dimensions, grid resolution, obstacles, vehicle properties, start and goal poses, and planner parameters, etc.
Feel free to add new configuration files or edit the existing one.
First clone the repository. Be sure to add --recurse-submodules
to clone pybind11 submodule.
git clone --recurse-submodules https://github.com/solemnwind/automatic-parking
You can change the scene setup and configurations in scripts/utils/test_parking_lot.toml
or create a new configuration file.
To run the simulation, you need python >= 3.11
, numpy
, matplotlib
and toml
cd ./scripts
python main.py
You will notice the following warnings:
WARNING:[algorithms.astar_search]:C++ library _reeds_shepp not found! Using fallback Python module: reeds_shepp
WARNING:[algorithms.astar_search]:C++ library _reeds_shepp not found! Using fallback Python module: occupancy_map
To use C++ libraries, you need to compile these libraries,
and copy the shared library files (for example _reeds_shepp.cpython-312-x86_64-linux-gnu.so
) to scripts/models/
.
It is recommended to use the C++ modules, since they are significantly faster than the python counterparts.
To get the shortest Reeds-Shepp curve from one point to another, run:
cd ./scripts/models
python reeds_shepp.py [-h] [-s X Y PHI] -g X Y PHI [-r RADIUS]
For example, python reeds_shepp.py -g 2 1 90 -s 4 0 0 -r 1.5
computes the shortest Reeds-Shepp path from -g
parameter is necessary, while -s
and -r
are emittable,
their default values are
In the plots, the blue paths indicate the car is moving forward, while the red paths indicate the car is reversing.
All C++ modules are placed in src/
,
currently there are 2 C++ modules: reeds_shepp_cpp
and occupancy_map_cpp
.
To compile them:
cd ./src
In CMakeLists.txt
, edit PYTHON_EXECUTABLE
to specify your python executable to use.
The python version should be the same as that you use to run main.py
:
set (PYTHON_EXECUTABLE "path/to/your/python/executable")
Make sure you have CMake installed and properly configured, and:
mkdir -p build && cd build
cmake ..
make -j2
make install
Upon successful execution of all the commands above,
the two shared library binaries will be installed in scripts/models/
.