This project demonstrates advanced autonomous navigation through:
- Multi-Modal Perception: Camera vision + distance sensors
- Intelligent Decision Making: Priority-based obstacle avoidance algorithms
- Real-Time Processing: Live AI inference on embedded hardware
- Robust Architecture: Thread-safe, fault-tolerant system design
- AI Object Detection - Real-time YOLOv5 inference
- Dual Sensor System - Camera + Ultrasonic sensors
- Smart Decision Making - Priority-based obstacle avoidance
- Modular Design - Clean, maintainable code
- Complete Hardware Integration - L298N motors + HC-SR04 sensors
- Beginner Friendly - Extensive documentation and demos

# 1. Clone repository
git clone <your-repo-url>
cd robotics
# 2. Run setup (Raspberry Pi)
chmod +x setup.sh
./setup.sh
# 3. Test installation
python test_robot.py
# 4. Start robot
python main.py
CAMERA INPUT → YOLOv5 AI → DECISION ENGINE → MOTOR CONTROL
Smart Decision Tree:
if ultrasonic_distance < 20cm:
EMERGENCY STOP → Turn Left
elif AI_detects_obstacle_in_front():
STRATEGIC AVOID → Turn Right
else:
ADVANCE → Move Forward
robotics/
├── main.py # Main control loop
├── detection.py # YOLO object detection
├── movement.py # Motor & sensor control
├── config.py # Configuration settings
├── README.md # This file
├── requirements.txt # Dependencies
├── setup.sh # Auto setup script
├── test_robot.py # Test suite
├── demo.py # Vision demo
└── beginner_demo.py # Learning demo
L298N → Raspberry Pi GPIO
ENA → GPIO 18 (PWM Left)
IN1 → GPIO 24 (Left Dir 1)
IN2 → GPIO 23 (Left Dir 2)
IN3 → GPIO 25 (Right Dir 1)
IN4 → GPIO 8 (Right Dir 2)
ENB → GPIO 12 (PWM Right)
Front Sensor: Trig→GPIO16, Echo→GPIO20
Side Sensor: Trig→GPIO21, Echo→GPIO26
# Run all tests
python test_robot.py
# Test specific components
python test_robot.py camera # Camera test
python test_robot.py yolo # AI detection test
python test_robot.py movement # Motor test
# Interactive learning demo
python beginner_demo.py
# Computer vision demo (with camera)
python demo.py
This project is open source and available under the MIT License.