PathPlanner3D is an open-source, Python-based framework for 3D path planning, specifically designed for research and experimentation. Its core philosophy is "terrain awareness", integrating various metaheuristic optimization algorithms: Genetic Algorithm (GA), Particle Swarm Optimization (PSO), and a hybrid PSO-GA, with an interactive simulation and visualization environment.
This framework aims to provide a flexible and extensible experimental platform for researchers and developers in fields like UAV trajectory planning. With its highly modular architecture, users can easily validate new algorithms, compare the performance of different strategies, and conduct intuitive visual analysis in dynamically generated 3D terrains.
- Multiple Optimization Algorithms: Includes built-in Genetic Algorithm (GA), Particle Swarm Optimization (PSO), and an innovative hybrid PSO-GA, all with dynamic parameter tuning.
- Terrain Awareness: Ensures path feasibility in complex terrains through intelligent collision avoidance, featuring vertical height checks and horizontal obstacle detection (e.g. mountains).
- Interactive Playground: Built with Streamlit, it supports real-time parameter adjustments, parallel comparison of multiple algorithms, and dynamic code editing with instant feedback.
- High-Quality 3D Visualization: Uses Plotly to dynamically display 3D terrains, planned paths, and convergence curves, offering multi-angle views for analysis.
- Modular and Extensible Architecture: A clean, layered design ("algorithm-common-visualization-playground") makes it easy to add new algorithms, customize fitness functions, or extend to new scenarios.
- Modern Engineering Practices: Employs
pyproject.toml,uvfor dependency locking, andpre-commitfor code quality assurance, ensuring project stability and maintainability.
The framework is built on a foundation of well-established libraries:
- Core: NumPy, SciPy, Pydantic, Loguru
- Visualization: Plotly
- Interactive UI: Streamlit
- Development Tools:
uv,pytest,ruff,pyright,pre-commit
Prerequisites: Python 3.12+
We recommend using uv for dependency management to ensure a consistent environment.
-
Clone the repository:
git clone https://github.com/codeboyzhou/PathPlanner3D.git cd PathPlanner3D -
Install dependencies (Recommended): Use
uvto sync dependencies.uv sync
-
Install dependencies (Alternative): If you prefer using
pip, you can perform an editable installation.pip install -e .
Activate the virtual environment:
.venv/Scripts/activateLaunch the Streamlit interactive playground with the following command:
streamlit run src/pp3d/playground/playground.pyAfter launching, a web interface will open automatically in your browser. You can:
- Select an algorithm (e.g.
PSO) from the left sidebar. - Adjust parameters like terrain, number of waypoints, and iterations.
- Click the
Runbutton to see the generated 3D path and fitness convergence curve on the right. - Try modifying the terrain generation logic or fitness function in the central code editor and observe the immediate impact on the results.
- UAV Trajectory Planning: Plan safe and efficient flight paths in complex environments like mountains or urban areas.
- Academic Research & Education: Serve as a visual platform for teaching algorithms, comparing performance, and validating new theories.