Robotic Car

Wi-Fi drive control and ultrasonic occupancy mapping on a NodeMCU ESP8266.

Original chassis photos showing three assembled robots and one close-up
Chassis and assembly photos from the semester report

Overview

Robotic Car is a NodeMCU-powered teleoperation and occupancy-mapping prototype. A phone or laptop connects to the car’s ESP8266 access point. The firmware controls the L298N motor driver and exposes ultrasonic range and MPU6050 orientation over HTTP. The Python tools inspect the saved map, demonstrate the mapping algorithm offline, and query or send short drive pulses to the board.

What’s Inside

MaterialContents
Firmware sketchDrive control and onboard web interface
Python toolsHTTP client, occupancy grid and offline review
Saved occupancy gridOriginal 500 × 500 probability array
Chassis measurementsOriginal dimensions worksheet
Project reportGroup report and alternate TCP implementation
Assignment briefOriginal course requirements
Hardware videoOriginal recording
Prototype archiveOriginal HTTP sketch and Python mapper

Project Breakdown

SubsystemInputOutput
Drive controlF, B, L, R, RL, RR, SESP8266 translates commands into L298N pin states and caps requested motion at 1 second.
RangeForward ultrasonic echoMeasured centimeters or −1 when no echo arrives.
OrientationMPU6050 DMP packetYaw, pitch and roll in degrees. Missing or stale samples return HTTP 503.
MappingPose (x, y, heading) and a range ≤100 cmMark preceding cells free and the measured cell occupied with bounded Bayesian evidence.
ReviewSaved .npy grid or eight synthetic observationsInspectable map plot with classified cell counts.

Valid range data updates only the cells preceding the hit and the endpoint itself. The firmware checks the requested duration and stops motor output when a pulse expires.

Hardware Demonstration

Download the demonstration video

Mapping Workbench

Open the original grid, replay the synthetic example, or start with a blank map. Enter a pose and range to see where the model places free and occupied evidence. Export the result as a NumPy grid.

  1. Start from a blank grid.
  2. Set x and y to 0, heading to 45°, and range to 22 cm.
  3. Apply the observation and inspect the dashed ray and occupied endpoint.
python -m robotic_car.workbench

Workbench source · Mapping model

Synthetic occupancy map with a dashed diagonal measurement ray
Offline example using a 22 cm observation at 45°

Results

The original 500 × 500 snapshot contains 1,195 free, 248,801 unknown, and 4 occupied cells at the documented thresholds. The sparse rays are evidence from the saved grid. The synthetic demo runs eight labeled range observations from two poses to exercise the same mapping code without hardware.

The recording and saved grid come from the original project. The synthetic plot and regression checks are reproducible offline.

Verification notes

Folder Structure

Robotic_Car/
├── launch_workbench.cmd    Windows desktop launcher
├── firmware/NodeMCU_Car/   ESP8266 sketch and onboard controls
├── robotic_car/            Python client, mapper and command line
├── tests/                  Mapping and client regression checks
├── data/                   Saved occupancy grid and measurements
├── docs/                   Course report, brief and hardware setup
├── media/                  Original hardware demonstration
├── archive/ap_prototype/   Original HTTP sketch and mapper
├── assets/                 Site styling, scripts and 24 figures
└── index.html              GitHub Pages entry point

Setup

Run these PowerShell commands from the project directory to inspect the map and rerun the tests.

python -m venv .venv
.venv\Scripts\python.exe -m pip install -r requirements.txt
.venv\Scripts\python.exe -m unittest discover -s tests -v
.venv\Scripts\python.exe -m robotic_car review
.venv\Scripts\python.exe -m robotic_car demo

For the board, see wiring, flashing and endpoint details. Use python -m robotic_car scan --help to add a live range observation at a manually specified pose.

Limitations

The MPU6050 yaw can drift. A single forward ultrasonic sensor samples a narrow region, and the map assumes that pose is supplied and calibrated. The grid does not recover position, fuse scans from multiple cars, or perform autonomous planning. The course report describes a multi-robot design, while the maintained code controls one car over HTTP.

About the Author

Mohammad Rohaan collaborated with Famia Malik and Awais Khan under Umarah Qaseem for the Fall 2024 FAST-NUCES robotics project. GitHub profile