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

Live Links
| What | Link |
|---|---|
| Repository | https://github.com/rohaan2802/Robotic_Car |
| GitHub Pages | https://rohaan2802.github.io/Robotic_Car/ |
| Project report | https://github.com/rohaan2802/Robotic_Car/blob/main/docs/project_report.pdf |
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
| Material | Contents |
|---|---|
| Firmware sketch | Drive control and onboard web interface |
| Python tools | HTTP client, occupancy grid and offline review |
| Saved occupancy grid | Original 500 × 500 probability array |
| Chassis measurements | Original dimensions worksheet |
| Project report | Group report and alternate TCP implementation |
| Assignment brief | Original course requirements |
| Hardware video | Original recording |
| Prototype archive | Original HTTP sketch and Python mapper |
Project Breakdown
| Subsystem | Input | Output |
|---|---|---|
| Drive control | F, B, L, R, RL, RR, S | ESP8266 translates commands into L298N pin states and caps requested motion at 1 second. |
| Range | Forward ultrasonic echo | Measured centimeters or −1 when no echo arrives. |
| Orientation | MPU6050 DMP packet | Yaw, pitch and roll in degrees. Missing or stale samples return HTTP 503. |
| Mapping | Pose (x, y, heading) and a range ≤100 cm | Mark preceding cells free and the measured cell occupied with bounded Bayesian evidence. |
| Review | Saved .npy grid or eight synthetic observations | Inspectable 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
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.
- Start from a blank grid.
- Set x and y to 0, heading to 45°, and range to 22 cm.
- Apply the observation and inspect the dashed ray and occupied endpoint.
python -m robotic_car.workbench

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.
Figure Gallery
Select any figure to view it at full size. Use Zoom in to read small labels and code. Browse with Previous, Next, arrow keys, or swipe.
24 figures

Crop around classified cells in the original occupancy map.

Eight deterministic range observations from two poses. This is a software demonstration.

A 22 cm observation at 45° is applied to the synthetic grid. The dashed line shows the newly added ray.

The ESP8266 checks elapsed time and stops the motor outputs after a requested pulse.

The desktop workbench validates the pose and range before modifying the grid.

Original report page 8 documents the physical chassis and assembly.

Frame at 22.1 seconds from the original hardware demonstration video.

Frame at 38.4 seconds from the original hardware demonstration video.

Original report page 9 records the assembled hardware.

Original report page 24 shows captured software output.

Original report page 25 preserves visual output from the semester project.

Original report page 26 collects demonstration visuals.

Original report page 28 illustrates the planned workflow.

The original 500 × 500 probability grid, shown at full extent.

Counts are computed from the saved grid at the documented 0.35 and 0.65 thresholds.

Counts from the current mapper running the deterministic synthetic demo.

A 7 cm hit leaves cells beyond the endpoint unchanged.

Excerpt from the archived CarMeasures workbook.

Pin pairs follow the maintained NodeMCU sketch.

Source excerpt showing per-ray deduplication and bounded Bayesian evidence.

The HTTP client validates command names and pulse durations before dispatch.

Malformed and non-positive range values are represented as missing.

Request paths from the maintained ESP8266 interface.

Behaviors exercised by the local Python regression suite.
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 demoFor 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.