A vision-based autonomous robot navigation system
π₯ Winner β IEEE Robotrix 2025-26 Final Hackathon
Challenge β’ Demo β’ Solution β’ Quick Start
Navigate a blind rover through a maze using only drone vision β no GPS, no coordinates, no cheating.
|
|
πΉ Final Cleared.mp4 β Complete maze navigation in real-time
Our solution implements a Multi-State Visual Wall Follower using computer vision and control theory β a completely vision-based approach that doesn't rely on any position data.
Instead of tracking absolute position, we generate a virtual guide rail from camera images and follow it using a simulated IR sensor array.
flowchart TD
A[Camera Frame] --> B[Detect Mole]
B --> C[Drone PID Tracking]
C --> D[π Hawk Velocity]
B --> E[Detect Walls]
E --> F[Generate Guide Rail]
F --> G["5-Sensor Array<br/>[LL][L][C][R][RR]"]
G --> H[PID Steering]
H --> I[π€ Mole Velocity]
style A fill:#e1f5fe
style D fill:#c8e6c9
style I fill:#c8e6c9
| Component | Purpose | Technique |
|---|---|---|
| Mole Detection | Track rover position in frame | HSV thresholding (yellow marker) + contour detection |
| Drone Tracking | Keep mole centered | Dual-axis PID with anti-windup |
| Wall Detection | Segment maze walls | Dual HSV ranges (red hue wraparound) |
| Guide Rail | Generate followable path | Closest-point wall selection + morphological fillet |
| 5-Sensor Array | Line following | Virtual IR sensors in reverse-U layout |
| Heading Estimation | Track orientation | Hybrid odometry + visual sensor fusion (98%/2%) |
| State Machine | Handle edge cases | WALL_FOLLOW β LOOP_ESCAPE |
Problem: Centroid-based selection jumps between walls at corners.
Solution: Sample a point to the rover's RIGHT and find the nearest wall contour.
# Sample point 100px to the right of mole
sample_x = int(cx + right_x * 100)
sample_y = int(cy + right_y * 100)
# Find wall contour closest to this point
for contour in wall_contours:
dist = abs(cv2.pointPolygonTest(contour, (sample_x, sample_y), True))
if dist < best_distance:
best_contour = contour# Dilate + erode creates naturally rounded corners
dilate_kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (offset*2, offset*2))
dilated = cv2.dilate(wall_mask, dilate_kernel)
erode_kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (radius*2, radius*2))
filleted = cv2.erode(dilated, erode_kernel)# Complementary Filter: 98% Odometry, 2% Vision
alpha = 0.98
new_heading = alpha * odometry_heading + (1.0 - alpha) * visual_headingHigh odometry weight = smooth motion | Low vision weight = eliminates drift
SENSOR_ARRAY = [
{'name': 'FAR_L', 'weight': 2.3}, # Strong left turn
{'name': 'LEFT', 'weight': 1.2}, # Mild left turn
{'name': 'CENTER', 'weight': 0.0}, # No correction
{'name': 'RIGHT', 'weight': -1.2}, # Mild right turn
{'name': 'FAR_R', 'weight': -2.3}, # Strong right turn
]Robotrix-26/
βββ task_submission.py # β
Winning solution
βββ approach_explanation.md # Technical writeup
βββ blog.md # Competition blog post
βββ Final Cleared.mp4 # Competition submission video
βββ Robotrix 2026 Problem Statement.pdf # Official problem statement
βββ World.ttt # CoppeliaSim scene file
β
βββ Approach 1 - wall follow logic/ # Alternative approach (didn't work)
βββ explanation.md
βββ World.ttt
βββ task14_final.py
βββ all code files-iterations/ # 18 iterations of development
- CoppeliaSim (with ZeroMQ Remote API)
- Python 3.8+
git clone https://github.com/ADRSH99/Robotrix-26.git
cd Robotrix-26
pip install numpy opencv-python coppeliasim-zmqremoteapi-client# 1. Open CoppeliaSim with the maze scene
# 2. Run the solution
python task_submission.py| Metric | Value |
|---|---|
| Result | π 1st Place |
| Maze Size | 15m Γ 15m |
| Processing | Real-time |
| Key Feature | Fully vision-based, no position data |
Traditional wall-following with discrete 90Β° turns and reference frame transformations.
- Issue: Reference frame confusion between drone (global XY) and rover (local frame)
- 18 iterations documented in
Approach 1 - wall follow logic/
Vision-based line following with virtual sensors.
- Key insight: Generate a followable "rail" from wall detection, treat it like a line-following problem
- Result: Smooth, continuous navigation without reference frame issues
The final winning solution was developed independently after pivoting from the initial approach.
- Python β Core implementation
- OpenCV β Computer vision (HSV thresholding, morphology, contour detection)
- NumPy β Numerical operations
- CoppeliaSim β Robot simulation environment
- ZeroMQ β Remote API communication
- Sensor Fusion: Combining wheel odometry with visual heading estimation
- PID Tuning: Anti-windup is crucial for real-world performance
- Computer Vision: HSV color spaces, morphological operations, contour analysis
- State Machines: Handling edge cases (stuck detection, loop escape)
- Reference Frames: The importance of coordinate system consistency
- IEEE NITK Student Branch for organizing Robotrix 2025-26
- CoppeliaSim for the simulation platform
Built during IEEE Robotrix 2025-26