About the project
# Autonomous Delivery Robot (DeliBot)
## What I Built
An end-to-end autonomous delivery robot system capable of GPS waypoint navigation,
real-time remote control, and package tracking. The robot uses Ackermann steering
geometry, a brushless motor, compass heading, and live MQTT communication to navigate
to a destination autonomously. A Flask web app with WebSockets serves as the control
dashboard — complete with user auth, delivery dispatch, email notifications, and a
live tracking link for recipients.
## The Problem It Solves
Large environments like university campuses, hospitals, and warehouses waste time and
money on manual delivery. This robot provides a **low-cost, intelligent alternative**
with autonomous navigation and remote monitoring.
## System Architecture
The robot runs a continuous **Sense → Process → Decide → Move** loop:
- **Sense** — GPS locks position; HMC5883L reads heading; ultrasonic detects obstacles
- **Process** — ESP8266 calculates bearing error using Haversine formula
- **Decide** — Proportional steering control adjusts servo angle
- **Move** — Brushless ESC drives forward at controlled speed
## Hardware Stack
- `ESP8266` — WiFi microcontroller (brain of the robot)
- `NEO-6M GPS` — Real-world coordinate tracking
- `HMC5883L Compass` — Heading estimation (calibrated for Lagos, Nigeria)
- `Brushless Motor + ESC` — High-efficiency propulsion
- `Servo Motor` — Ackermann steering angle control
- `ESP32-CAM` — Live video streaming
## Navigation Algorithm
```cpp
float bearingError = targetBearing - compassHeading;
bearingError = normalizeAngle(bearingError); // -180 to +180
float steeringAngle = bearingError * (TURN_GAIN / 100.0);
steeringAngle = constrain(steeringAngle, -45, 45);
setSteeringAngle(steeringAngle);
```
The robot slows down for sharp turns (>30°) and stops within 5 meters of the waypoint.
## Software & Communication
- **MQTT (HiveMQ broker)** — Lightweight real-time command/status channel
- **Flask + SocketIO** — Backend with live WebSocket state push to dashboard
- **SQLite** — Delivery records with tracking IDs
- **Email Notifications** — Auto-sent to recipient with a unique tracking link
## Key Features
- Autonomous GPS waypoint navigation
- Manual control fallback (forward / backward / left / right / stop)
- Real-time ETA calculation (Haversine distance ÷ 1.5 m/s)
- Secure login/register with hashed passwords
- Per-delivery tracking links with live robot dashboard
- Delivery history admin panel
## Results
A fully functional delivery robot that navigates autonomously to GPS coordinates,
streams live video, and notifies recipients via email — built entirely with low-cost,
accessible hardware.