Skip to content

solemnwind/automatic-parking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automatic Parking

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.

Demos

A* Path finding

RRT* Path finding (Time Budget $200\ \mathrm{ms}$)

Reeds-Shepp curve

Simulation Configuration

Vehicle Model

The vehicle is modeled with Ackermann steering geometry, the origin $O$ is chosen to be the center of the rear axle, because the center of the turning circle always lies on the extension of the rear axle.

Simulation Environment

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.

Usage

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 $(4, 0, 0^\circ)$ to $(2, 1, 90^\circ)$, with the minimum turning radius $1.5$. The -g parameter is necessary, while -s and -r are emittable, their default values are $(0, 0, 0^\circ)$ and $1$, respectively.

In the plots, the blue paths indicate the car is moving forward, while the red paths indicate the car is reversing.

Compile C++ Components

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

About

Pathfinding for the Reeds-Shepp car, with A* and RRT* algorithms

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published