An AI-powered autonomous navigation system built in Python — featuring A* path planning, obstacle detection, and a real-time 2D simulation. No hardware or GPU required.
Agent (blue circle) navigating from start (green) to goal (red), avoiding obstacles (black), following the A* planned path (yellow).
How can a robot or self-driving vehicle navigate from point A to point B in an unknown environment, avoiding obstacles — without human intervention?
This project solves exactly that. It implements the core AI pipeline used in real autonomous systems: perceive → plan → navigate → visualize.
| Domain | Company | Application |
|---|---|---|
| Self-driving cars | Tesla, Waymo, Cruise | Lane keeping, collision avoidance |
| Warehouse robots | Amazon Robotics, Fetch | Autonomous goods transport |
| Delivery robots | Starship, Nuro | Last-mile autonomous delivery |
| Drones | DJI, Zipline | Obstacle-free flight paths |
| Industrial robots | ABB, KUKA, Fanuc | Safe arm navigation |
| Tool | Purpose |
|---|---|
| Python 3.10+ | Core programming language |
| Pygame 2.5 | 2D simulation and real-time visualization |
| NumPy | Grid matrix operations |
| A* Algorithm | Optimal shortest-path planning |
| Matplotlib | Path analysis plots (optional) |
INPUT
└─ 2D Grid Map (rows × cols)
├─ Start position (S)
├─ Goal position (G)
└─ Obstacle positions (1 = blocked)
PERCEPTION MODULE (src/perception.py)
└─ Scans grid → identifies obstacle cells
PATH PLANNING MODULE (src/path_planning.py)
└─ A* algorithm with Manhattan heuristic
└─ Returns optimal waypoint list
NAVIGATION MODULE (src/navigation.py)
└─ Agent follows waypoints step by step
└─ Reports progress and goal status
VISUALIZATION MODULE (src/visualization.py)
└─ Pygame renders grid, agent, path
└─ Auto-saves screenshots for proof
OUTPUT
└─ Animated navigation window
└─ Terminal logs
└─ Screenshot proof in outputs/
AI-Autonomous-Navigation-System/
│
├── src/
│ ├── perception.py # reads grid, identifies obstacles
│ ├── path_planning.py # A* and Dijkstra algorithms
│ ├── navigation.py # agent movement logic
│ └── visualization.py # Pygame renderer + screenshot
│
├── simulation/
│ ├── environments.py # open / maze / dense map generators
│ └── grid_maps/ # saved .npy map files
│
├── outputs/
│ └── screenshots/ # auto-saved proof images
│
├── notebooks/
│ └── demo.ipynb # Jupyter walkthrough
│
├── docs/
│ └── images/ # README assets
│
├── main.py # ← run this to start
├── config.py # grid size, colors, FPS
├── requirements.txt
├── .gitignore
└── README.md
git clone https://github.com/YOUR_USERNAME/AI-Autonomous-Navigation-System.git
cd AI-Autonomous-Navigation-System# Windows
python -m venv venv
venv\Scripts\activate
# Mac / Linux
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtpython -c "import pygame; import numpy; print('All dependencies OK')"python main.pyChange the map type in main.py line 52:
MAP_TYPE = "maze" # "open" | "maze" | "dense"==================================================
AI Autonomous Navigation System
Map type : maze
==================================================
[Perception] Environment scan complete
Total cells : 400
Obstacles : 87
Free cells : 313
Density : 21.8%
[PathPlanning] Running A* algorithm...
[PathPlanning] Path found!
Steps : 34
Path cost : 33
Cells visited: 156
[Navigation] Path loaded — 34 waypoints
[Navigation] Goal reached!
[Simulation] Navigation complete!
Screenshots are auto-saved to outputs/screenshots/.
- Environment loads — 20×20 grid with obstacles appears
- Perception scans — obstacle positions logged to terminal
- A* plans path — yellow cells show the optimal route
- Agent navigates — blue circle follows path step by step
- Goal reached — final screenshot saved, window stays open 2 seconds
- Check proof —
outputs/screenshots/has 3 timestamped images
| Map Type | Path Length | Cells Explored | Time |
|---|---|---|---|
| Open | ~28 steps | ~90 cells | < 1s |
| Maze | ~34 steps | ~156 cells | < 1s |
| Dense | ~48 steps | ~220 cells | < 1s |
| Start | Midway | Goal Reached |
|---|---|---|
![]() |
![]() |
![]() |
- Implemented A* search algorithm from scratch in Python
- Designed a modular perception → planning → navigation pipeline
- Built real-time 2D simulation with Pygame
- Understood how autonomous systems perceive and react to environments
- Practiced industry-style project structure and GitHub documentation
- Real camera input with OpenCV lane detection
- YOLO object detection overlay
- CARLA 3D simulator integration
- Reinforcement learning agent (replace A*)
- ROS2 integration for real robot control
- SLAM — simultaneous localization and mapping
- Multi-agent simulation
- Web dashboard with Flask



