A visualization tool for multi-robot path planning using the A* algorithm. This project provides an interactive environment to generate mazes, set obstacle configurations, and visualize multiple robots navigating through paths.
This application demonstrates path planning algorithms for multiple robots in a grid environment. It features:
- Interactive maze generation and obstacle placement
- Multi-robot path planning and visualization using A* algorithm
- Real-time robot movement simulation
- Customizable robot targets and parameters
- Python 3.6+
- NumPy
- PyGame
-
Clone this repository:
git clone https://github.com/yourusername/PyGame_path_planning_visualizer.git cd PyGame_path_planning_visualizer -
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate -
Install required dependencies:
pip install -r requirements.txt
Run the maze generator to create obstacle configurations:
python generate_maze.py
Controls:
- Left-click: Add/remove obstacles on the grid
- D key: Clear all obstacles
- Close window: Save the maze to maps/obstacles1.data
Run the multi-robot simulation:
python multi_robots.py
Controls:
- Left-click: Set a target position for the selected robot
- 1, 2, 3 keys: Select between robots 1, 2, and 3
- Close window: Exit the simulation
The simulation shows three robots (red, green, and blue) navigating to their targets using the A* path planning algorithm. Each robot follows its calculated path while avoiding obstacles.
a_star.py: Implementation of A* pathfinding algorithmgenerate_maze.py: Tool for creating maze configurationsgrid.py: Grid environment implementationmulti_robots.py: Main simulation for multiple robotsplanner.py: Path planning utilitiesrobot3.py: Robot behavior and rendering implementationmaps/: Directory containing obstacle configurations
