BSc Thesis · 2024 IUST · Electrical Engineering

Path Planning Robot with
Obstacle Avoidance Using
Image Processing

A fully custom-built omnidirectional robot that uses a ceiling-mounted camera and real-time computer vision to navigate autonomously from any start point to any goal — avoiding dynamic obstacles without turning its frame.

3×
Mecanum Wheels
360°
Omnidirectional Movement
Real-time
Vision Processing
PID
Closed-loop Control
18/20
Final Grade
Supervisors: Dr. Soheil Ganjefar & Dr. Saeed Ebadollahi
Co-Researcher: Shervin Jarahi

Robot Structure & Components

The robot was designed and assembled from scratch. Each subsystem — power, motion, sensing, and computation — was carefully selected and integrated.

Motion System
3× Mecanum wheels (LWT05) with independent DC motors. Omnidirectional movement — forward, sideways, diagonal, rotation — all without the frame turning.
Vision System
Camera mounted near the ceiling to capture a top-down view of the arena. HSV color segmentation identifies the robot (green marker) and target destination in real time.
Control System
PID controller (P=0.15, I=0.00001, D=0.0015) running on Arduino. Receives position commands from the vision computer via serial, executes smooth closed-loop motor control.
Processing
Python-based OpenCV pipeline running on a connected laptop. Processes camera frames, detects positions, computes paths, and sends motor commands at real-time frame rates.
Power Supply
Custom-built PCB with power distribution circuitry. Motor driver board handles the three independent motor channels with current limiting and protection.
Obstacle Sensing
Obstacles are identified via their HSV color profile in the overhead camera view. The path planning algorithm computes tangent-based avoidance trajectories around each obstacle.
Robot motor assembly and circular base plate
Motor assembly on the circular metal base plate — 3 DC motors with mecanum wheels at 120° intervals
PCB soldering and electronics assembly
Custom PCB soldering and electronics assembly for the motor driver board
Mecanum wheel LWT05
Mecanum wheel (LWT05) — angled rollers enable omnidirectional motion
Ceiling-mounted camera housing
Ceiling-mounted camera housing — provides top-down view of the full arena

Path Planning Algorithm

Path trajectory visualization showing robot path with multiple obstacle avoidance points
Multi-obstacle path trajectory — robot navigates sequentially around each obstacle toward target B
Computer vision interface showing robot and target tracking in OpenCV
Live OpenCV computer vision interface — detecting robot position (orange dot) and tracking target in real time

System Pipeline

01
Camera Capture
Overhead camera grabs live frames of the arena floor
02
HSV Detection
OpenCV identifies robot, target & obstacles by color
03
Path Computation
Tangent algorithm finds optimal collision-free route
04
PID Execution
Arduino executes motor commands with closed-loop PID
05
Feedback Loop
Position re-evaluated every frame — corrects drift in real time
PID Controller Constants
// PID
# define Zarib_P 0.15
# define Zarib_I 0.00001
# define Zarib_D 0.0015

Testing & Results

The robot was evaluated across multiple motion directions. Position error was measured over the course of each run to quantify accuracy and stability.

Position error over time graph showing the robot's path correction curve
Position error (cm) vs. time-steps — showing the robot's self-correcting behavior as it navigates and recovers from drift
Key Findings
  • Successfully navigated to target while avoiding single and multiple obstacles
  • Omnidirectional movement achieved without frame rotation
  • PID control reduced oscillation and maintained stable trajectories
  • Real-time processing at camera frame rates with no significant delay
  • Motor angle error quantified across 4 movement directions
Future Work
  • Dynamic obstacle tracking with Kalman filtering
  • Onboard computation (Raspberry Pi) for fully autonomous operation
  • Deep learning-based obstacle detection replacing HSV heuristics

Build Process

Completed robot on laboratory floor
The completed robot — mecanum wheels visible, green target marker on top deck
Motor assembly during construction
Early stage — motors being mounted to the circular metal chassis
Mecanum wheel force diagram showing 60-degree wheel arrangement
Mecanum wheel force diagram — 60° arrangement enables full omnidirectional motion
Top-down view of robot in arena as seen by overhead camera
Top-down arena view from overhead camera — green robot, purple target