Skip to content

Latest commit

 

History

185 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vision-Driven Autonomous 4WD Mobile Robot 🏎️👁️

Real-Time Computer Vision, Differential Kinematics, & Embedded Control


OpenCV Python C++ Fusion360 3D Printing

Autonomous 4WD Robot Render


📑 DIRECTORY TERMINAL (TABLE OF CONTENTS)
  1. Executive System Overview
  2. System Datasheet & Engineering Targets
  3. Computer Vision & Kinematic Control Logic
  4. Hardware Fabrication & Bill of Materials
  5. Vision Processing & Execution Pipeline
  6. Repository Architecture & CI/CD
  7. Empirical Validation Matrix (Development Log)
  8. Deployment & Reproducibility
  9. R&D Framework & Development Scope
  10. Academic Trajectory
  11. Academic Citation

🌐 EXECUTIVE SYSTEM OVERVIEW

This repository hosts the source code, hardware integration metrics, and vision processing algorithms for an autonomous 4WD mobile vehicle. While traditional line-following robots rely on simple, localized infrared (IR) sensor arrays that pass binary high/low values to a microcontroller, this platform elevates the control loop by utilizing a sophisticated onboard Machine Vision system.

By processing high-dimensional image frames in real-time, the system extracts path geometries, dynamically calculates heading errors, and maps those errors directly to a 4WD differential drive system. This architecture ensures smooth, high-speed tracking and robust trajectory correction under variable ambient lighting conditions, preventing the track-loss common in IR-based systems.


📋 SYSTEM DATASHEET & ENGINEERING TARGETS

The architecture bridges embedded image processing with deterministic mechatronic actuation to maintain a continuous, low-latency control loop.
Subsystem Specification Engineering Objective
Control Architecture Embedded SBC (Single Board Computer) Execute multi-threaded vision and PWM pipelines simultaneously.
Vision Framework OpenCV Image Processing Pipeline High-speed contour extraction and centroid localization.
Drive Kinematics 4-Wheel Differential Steering Translate angular correction to left/right wheel RPM variables.
Environmental Adaptation Dynamic Thresholding Matrix Isolate target paths despite glare, shadows, or track noise.
Response Latency Optimized Frame Rate Processing Ensure mechanical actuation occurs before geometric tracking loss.
Project Status OPERATIONAL Fully functional and field-validated under dynamic track conditions.

🧠 COMPUTER VISION & KINEMATIC CONTROL LOGIC

To achieve high-speed path tracking, the vision script extracts the center of mass (centroid) of the target line within a defined Region of Interest (ROI). Let $(c_x, c_y)$ represent the target's centroid, and $w_{frame}$ represent the pixel width of the camera frame. The lateral heading error $e(t)$ is calculated as the offset from the center of the camera's field of view:

$$e(t) = c_x - \frac{w_{frame}}{2}$$

A Proportional-Integral-Derivative (PID) controller evaluates this pixel error to generate a dynamic angular velocity correction factor ($\omega$):

$$\omega = K_p e(t) + K_i \int e(t)dt + K_d \frac{de(t)}{dt}$$

Using Differential Drive Kinematics, the target velocities for the left wheel array ($v_L$) and right wheel array ($v_R$) are derived using the base linear velocity ($V_{base}$) and the chassis track width ($L$). The motor drivers receive these values as scaled PWM signals:

$$v_L = V_{base} - \frac{\omega \cdot L}{2}$$

$$v_R = V_{base} + \frac{\omega \cdot L}{2}$$


⚙️ HARDWARE FABRICATION & BILL OF MATERIALS

The physical architecture was designed to handle high-torque differential slipping and provide a vibration-damped mount for the optical sensor to prevent motion blur during high-speed maneuvering.
  • 🛡️ Chassis Dynamics: Rigid 4WD frame layout ensuring all four wheels maintain uniform surface contact during sharp differential turns.
  • 👁️ Optical Mounting: Angled camera geometry calibrated to capture an optimal Region of Interest (ROI) slightly ahead of the chassis for predictive tracking.
  • ⚡ Power Distribution: Dual-rail power management isolating logic-level voltage (SBC/Sensors) from high-current motor spikes to prevent brownouts.

Primary Hardware Bill of Materials (BOM):

Component Material / Specification Subsystem
Master Controller Embedded SBC (e.g., Raspberry Pi / Jetson) Logic Engine & Vision Processing
Optical Sensor High-Framerate Telemetry Camera Machine Vision Input
Motor Drivers High-Current Dual H-Bridge PWM Signal Amplification
Actuators 4x High-Torque DC Gear Motors Physical Locomotion
Chassis Aluminum/Acrylic 4WD Frame Structural Containment

📡 VISION PROCESSING & EXECUTION PIPELINE

The software architecture relies on a highly optimized, continuous loop running at the maximum achievable frame rate of the embedded hardware.
  1. Frame Ingestion: The camera captures RGB frames and crops them to a strict ROI, ignoring background noise and reducing computational overhead.
  2. Color Masking & Binarization: Frames are converted to the HSV color space, and dynamic thresholding is applied to isolate the path geometry into a stark binary mask.
  3. Centroid Extraction: OpenCV moments are calculated to find the $(c_x, c_y)$ coordinates of the target path.
  4. Kinematic Execution: The PID loop converts the $c_x$ offset into proportional PWM adjustments, triggering the motor drivers via GPIO pins.

🗄️ REPOSITORY ARCHITECTURE & CI/CD

Structured for absolute transparency, bridging embedded computer vision software with mechatronic hardware schematics.
📁 Vision-Autonomous-4WD/
│
├── 📁 .github/workflows/     # CI/CD: Automated linting for Python/C++ vision scripts
├── 📁 src/                   # Core Logic & Algorithms
│   ├── vision_tracker.py     # OpenCV color masking and centroid extraction pipeline
│   ├── kinematics_pid.py     # Differential drive math and PWM mapping
│   └── main_loop.py          # Multi-threaded execution script
│
├── 📁 hardware/              # Physical Build Assets
│   ├── wiring_schematic.pdf  # Motor driver, SBC, and power rail routing
│   └── CAD_models/           # Chassis layouts and camera mount geometries (STEP/STL)
│
├── 📁 docs/                  # System documentation
│   ├── dynamic_thresholds.csv # Calibration logs for varying ambient lighting conditions
│   └── PID_tuning_log.md     # Kp, Ki, Kd parameter adjustments for speed benchmarking
│
├── requirements.txt          # Python dependencies (OpenCV, NumPy, GPIO libraries)
└── README.md                 # Main system dossier

About

Autonomous 4WD mobile robot featuring real-time OpenCV color segmentation, closed-loop PID path-tracking kinematics, and encoder-based odometry running on an embedded microcontroller.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages