Skip to content

About

ESP8266 robotic car with Wi-Fi drive controls, ultrasonic ranging, MPU6050 telemetry, and Python occupancy mapping.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Robotic Car

Wi-Fi teleoperation and ultrasonic occupancy mapping on an ESP8266

Firmware Python Report Demo Tests

Desktop GUI Mapping Offline demo Controls

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

Table of Contents

Overview · What's Inside · Project Breakdown · Folder Structure · Setup · Mapping Workbench · Results · Limitations · Figure Index · About the Author

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.

The Fall 2024 FAST-NUCES CS-3015 group project was titled Nano Navigators: Mapping with Precision. The archive retains the source associated with the original GitHub submission and the report preserves the group’s implementation and design material.

What's Inside

Material Contents
Firmware sketch Drive control and onboard web interface
Desktop workbench Offline grid viewer, manual range input, and NumPy export
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.

Each valid observation starts at the externally supplied pose. The mapper samples the ray at half-cell intervals, updates each traversed cell once, excludes the hit cell from the free evidence, and then applies occupied evidence to that endpoint. Missing, non-finite, non-positive or over-range measurements leave the grid unchanged. The 0.35 and 0.65 classification thresholds make free, unknown and occupied cells visible. The historical map retains its original values.

The maintained sketch starts with the outputs stopped, validates all drive requests, and polls the motion expiry before and after handling HTTP. The onboard controller sends one short pulse per tap and exposes an explicit Stop. The Python client checks the firmware protocol identifier before issuing motion.

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

Use Python 3.10 or newer. From the repository root in PowerShell:

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

Append --image path.png to either map command for a headless plot. The demo mode can also export a NumPy array with --save-map path.npy. Open index.html to preview the Pages site.

For the car, follow the hardware setup and HTTP API. After flashing and joining the SoftAP, open the car controller at http://192.168.4.1/ or run:

.venv\Scripts\python.exe -m robotic_car telemetry
.venv\Scripts\python.exe -m robotic_car pulse F --ms 250
.venv\Scripts\python.exe -m robotic_car pulse S

To add one live range reading at a known pose without commanding motion, run:

.venv\Scripts\python.exe -m robotic_car scan --pose 0 0 90 --save-map scan.npy

Pass --map scan.npy to extend a previous scan. The pose is supplied as x and y in centimeters and heading in degrees counterclockwise from +x. View the resulting array with python -m robotic_car review --map scan.npy.

Mapping Workbench

Run python -m robotic_car.workbench from an environment with the dependencies installed, or open launch_workbench.cmd on Windows. The workbench starts with the synthetic map, so the first demonstration works without hardware or Wi-Fi.

  1. Open Original saved map to inspect the original 500 × 500 probability grid. Use Open .npy for another square probability array.
  2. Select Blank grid or Synthetic demo. Enter x and y in centimeters, a heading in degrees counterclockwise from +x, and a range from just above zero to 100 cm.
  3. Apply the observation. The dashed overlay shows the latest observation. Cell counts update using the same probability thresholds as the command-line tool.
  4. Export the grid and reopen it in the workbench or command-line reviewer.

For a short demonstration, start from a blank grid and apply a 22 cm range at (0, 0) with a 45° heading. Then repeat from the same pose to reinforce the evidence, or change the heading to inspect how a second ray projects into the map.

The GUI uses the same mapping model as the CLI. The desktop workbench never connects to the robot. Use the HTTP client and the documented CLI commands for physical telemetry or drive pulses.

Results

Three robotic cars in the original demonstration

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 hardware video, report excerpts and saved map are original project artifacts. The offline commands and regression suite recompute results locally. The tests cover range validation, cell classification, ray endpoints, edge clipping, deterministic demonstrations and the Python HTTP interface. See the verification notes for the checks performed on this version.

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. The requested motion timeout is enforced in the firmware loop and can be affected by loop latency. Treat the saved occupancy grid as sparse scan evidence.

Figure Index

Open any preview to inspect its full 1440 × 900 capture.

Saved occupancy detail

Saved occupancy detail

Crop around classified cells in the original occupancy map.

Synthetic mapping run

Synthetic mapping run

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

Manual range observation

Manual range observation

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

Firmware motion expiry

Firmware motion expiry

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

Workbench observation validation

Workbench observation validation

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

Chassis design photos

Chassis design photos

Original report page 8 documents the physical chassis and assembly.

Hardware demo frame 2

Hardware demo frame 2

Frame at 22.1 seconds from the original hardware demonstration video.

Hardware demo frame 3

Hardware demo frame 3

Frame at 38.4 seconds from the original hardware demonstration video.

Mounted hardware photos

Mounted hardware photos

Original report page 9 records the assembled hardware.

Report mapping output

Report mapping output

Original report page 24 shows captured software output.

Report visualization excerpt

Report visualization excerpt

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

Report demonstration montage

Report demonstration montage

Original report page 26 collects demonstration visuals.

Project workflow diagram

Project workflow diagram

Original report page 28 illustrates the planned workflow.

Saved occupancy overview

Saved occupancy overview

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

Saved grid classification

Saved grid classification

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

Synthetic grid classification

Synthetic grid classification

Counts from the current mapper running the deterministic synthetic demo.

Range-ray evidence

Range-ray evidence

A 7 cm hit leaves cells beyond the endpoint unchanged.

Chassis measurement worksheet

Chassis measurement worksheet

Excerpt from the archived CarMeasures workbook.

NodeMCU pin assignments

NodeMCU pin assignments

Pin pairs follow the maintained NodeMCU sketch.

Occupancy evidence update

Occupancy evidence update

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

Python command validation

Python command validation

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

Range response parsing

Range response parsing

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

HTTP control and telemetry

HTTP control and telemetry

Request paths from the maintained ESP8266 interface.

Mapping regression coverage

Mapping regression coverage

Behaviors exercised by the local Python regression suite.

About the Author

Mohammad Rohaan collaborated with Famia Malik and Awais Khan on the Fall 2024 FAST-NUCES CS-3015 project, supervised by Umarah Qaseem. GitHub profile

About

ESP8266 robotic car with Wi-Fi drive controls, ultrasonic ranging, MPU6050 telemetry, and Python occupancy mapping.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages