PSO-RobotPathFinder is an intelligent navigation framework designed to solve complex robotic path planning challenges using Particle Swarm Optimization (PSO).
This project goes beyond simple A* or Dijkstra implementations by using evolutionary algorithms to generate continuous, smooth, and kinematically feasible cubic spline paths. It effectively balances the trade-off between path shortness and safety margins, ensuring robots can navigate narrow corridors and obstacle-rich environments without collision.
Ideal for autonomous mobile robot (AMR) researchers, students, and developers looking for a Python-based, visualized approach to path optimization.
- 🧠 particle Swarm Optimization (PSO): Efficient global search algorithm for finding optimal control points.
- 📐 Cubic Spline Smoothing: Generates kinematically feasible and smooth paths suitable for real-world robot navigation.
- 🖥️ Interactive Streamlit Dashboard: A powerful web-based UI for real-time parameter tuning, environment configuration, and visual debugging.
- 🚧 Dynamic Environment Modeling: Supports adjustable workspace dimensions, start/goal positions, and custom circular obstacles.
- ⚡ Real-time Visualization: Live feedback of the optimization process, showing particle convergence and path evolution.
Ensure you have Python 3.8+ installed.
git clone https://github.com/TRIBAK-Mohamed/PSO-RobotPathFinder.git
cd PSO-RobotPathFinderIt is recommended to use a virtual environment.
pip install -r requirements.txt
# OR manually:
pip install numpy matplotlib scipy streamlitLaunch the Streamlit dashboard for a full interactive experience.
streamlit run streamlit.pyDashboard Capabilities:
- Environment Setup: Adjust width, height, and robot radius.
- Obstacle Editor: Add, remove, or modify obstacles dynamically.
- PSO Tuning: Fine-tune
c1,c2,inertia, andpopulation sizeon the fly. - Visualization: Watch the solver converge in real-time.
Run the standalone Matplotlib demo for a quick test without the web interface.
python main.pyThe codebase is modular and organized for scalability:
| File/Module | Description |
|---|---|
streamlit.py |
Main entry point for the interactive web application. |
pso.py |
Core implementation of the Particle Swarm Optimization algorithm. |
main.py |
Lightweight desktop demo script. |
path_planning/ |
Core Logic Package |
├── solution.py |
Handles Cubic Spline generation and path interpolation. |
├── environment.py |
Defines the workspace bounds and obstacle properties. |
├── cost.py |
Computes the fitness function (Path Length + Collision Penalty). |
└── plots.py |
Visualization utilities for Matplotlib. |
To achieve the best results, you can tune the PSO hyperparameters:
- Population Size: Higher values improve search thoroughness but increase computation time.
- Inertia Weight (
w): Controls the momentum of particles. Higherwfavors exploration; lowerwfavors exploitation. - Coefficients (
c1,c2): Balance the particle's tendency to follow its own best position (c1) vs. the swarm's global best (c2).
Contributions are welcome! Please fork the repository and submit a pull request for any enhancements or bug fixes.
Made with ❤️ by TRIBAK Mohamed
📧 mohamedtribak912@gmail.com