Opening case study…
Opening case study…
A research project comparing tabular Q-Learning against Deep Q-Learning on resource-constrained edge hardware, built as five ROS2 packages around maze-solving microrobots.
Covers
Stack
How do tabular Q-Learning and Deep Q-Learning compare on a genuinely resource-constrained device — not just in how well they learn, but in what they cost to run: compute, memory, inference time, communication, and how well a policy transfers to a maze it has not seen.
The framing matters because the two are usually compared on the learning axis alone, where the neural method wins by construction. On a microcontroller the interesting question is different: a table that fits in flash and needs no floating-point inference may be the better engineering answer even when it generalizes worse.
The longer-term direction is to extend that comparison across several robots learning at once, and to measure what the coordination itself costs. The phases below mark what is built and what is not.
The project is organized as five ROS2 packages: shared messages, training, dashboard, robot control, and simulation. A robot — simulated or physical — publishes over ROS2 topics to a training server, which produces models and metrics that the dashboard reads.
Splitting messages into their own package is the load-bearing decision. Every other package depends on the contract rather than on each other, which is what allows the simulated robot and a physical one to be interchangeable from the training server's point of view.
The three flows run at different rates for good reason: state is frequent because it drives control, experience is less frequent because it drives learning, and telemetry is slow because nobody needs battery voltage ten times a second. Quality-of-service profiles are configuration rather than code, which is what a lossy radio link to a microcontroller eventually requires.
Packages
micromouse_msgs_package
Shared message types
training_package
DQN and Q-Learning trainers
dashboard_package
Streamlit monitoring surface
robot_package
Robot-side control
simulation_package
Physics-based environment
Robot / simulation
Publisher
ROS2 topics
Messaging layer
Training server
PC-side
Model / metrics
Versioned artifacts
Dashboard
Analysis surface
Experience replay
Sampling buffer
Model manager
Versioning
Experiment manager
Run control
/mouse/stateTraining server/mouse/experienceModel updates/mouse/telemetryDashboardThe interface between parts is written down as message, service and action definitions rather than left as whatever the publisher happened to send. Six message types, four services and one long-running action.
Three of those four services exist for a single purpose: moving a model between a trainer and a device. One uploads weights, one fetches the current global model, and one fetches it in chunks. That third call is the whole federated design in miniature — a microcontroller cannot receive a model the way a workstation can, so the contract admits it up front.
Messages
Services
Actions
Training nodes
Robot & simulation
Dashboard
The interface is declared rather than assumed. Three of the four services exist specifically to move a model between a trainer and a device — upload, fetch, and fetch in chunks.
Both training paths are implemented. The tabular trainer discretizes state, explores with an epsilon-greedy schedule, and persists a table small enough to live in the device's own flash. The deep trainer approximates the same values with a network, stabilized by a replay buffer and a target network, trained in PyTorch on a workstation.
They trade compute against generalization, which is precisely what the experiments are meant to measure. A table is fast, cheap and specific to the maze it learned; a network is expensive to train, needs floating-point inference, and stands a chance of transferring to a maze it has never seen.
Which one suits a constrained device better is a question this project has not answered yet. No winner is declared here, and no comparative figure is reported, because the comparison has not been run and recorded.
Q-Learning
Deep Q-Learning
Deploying a policy to a microcontroller is its own problem, and the repository treats it as one rather than as a final step. A model trained in PyTorch is converted to TensorFlow Lite, versioned by a model manager, and fetched by the device — in pieces, through the chunked service, because it cannot hold the transfer in memory otherwise.
The tabular path needs none of that. A Q-table is small enough to write straight to flash, which is the practical half of the comparison: not only which algorithm learns better, but which one can actually be deployed and updated on the hardware in question, and what each update costs in flash wear.
A firmware sketch is committed and a converted model sits in the repository, so the path exists end to end in source. The hardware experiments themselves have not been run.
Training server
PyTorch, on a workstation
Trained model
Versioned by the model manager
Conversion
PyTorch → TensorFlow Lite
Chunked transfer
A service call per piece
ESP32
Inference at the edge
Flash storage
Where the tabular path lives
The instrumentation is in place and the measures are chosen. Hardware telemetry covers processor load, free memory, battery voltage, inference time and flash write cycles; training telemetry covers loss, episode reward, exploration decay and buffer size; and three maze layouts of increasing difficulty are defined for testing transfer.
These are targets, not findings. They describe what the experiments are designed to capture, and no value for any of them is reported on this page.
Hardware
Training
Generalization scenarios
These are the measures the experiments are designed to capture, not results. No benchmark figures, accuracy numbers or comparative outcomes are reported on this page.
The analysis tooling is genuinely built: a Q-table visualizer producing heatmaps, coverage maps, per-action panels and policy views; a comparative benchmark tool producing learning curves, resource comparisons and performance tables; and a dashboard showing all of it live. Everything renders at publication resolution.
It also has a mode that generates all of that from synthetic data, alongside a synthetic data generator in the simulation package. That exists for good reasons — you cannot develop a plotting pipeline while waiting on hardware — but it means a finished-looking comparison from this repository is not evidence of anything until it says which data produced it.
That is why no figure from this project appears on this page, and why any that is published later should carry its provenance on its face.
Known-data KPI test
The last point is the one that matters when reading any figure from this project: the benchmark tool can produce a complete, publication-styled comparison from synthetic data. No plot made that way is a result, and no result from either training path is reported here.
The federated work is a direction with a contract, not a completed result. The service definitions for uploading weights and distributing a global model exist; the intended arrangement is several simulated robots alongside one physical one, with local adaptation on each and aggregation at the centre.
The measure that would make it research rather than plumbing is communication efficiency — what the coordination costs relative to what it buys. Nothing below has been run, and every row is marked accordingly.
For a project whose output is meant to be research, the environment is not setup detail — it is part of the finding. A comparison of memory use and inference time means very little if a reader cannot determine which toolchain and which versions produced it.
Two things need settling before any number is published. The setup instructions name two different ROS2 releases in different places, and several of the guides the README links to are not in the repository. Neither is difficult to fix, and both would undermine a published figure if left as they are.
Known gap
The repository is public, so the left column below can be checked rather than trusted: the packages, the nodes, the declared contract, both training paths, the conversion utility and the committed converted model are all there to read.
The right column is the part that keeps this a project rather than a paper. No comparative run has been recorded, no hardware measurement taken, no federated experiment performed, and no maze held out to test transfer. The gap between a system that could produce results and results is exactly the work that remains.
Next proof
Phases 1 and 2 are complete: the architecture, both training paths, the simulation, the dashboard and the analysis tooling all exist and run.
Phase 3 — hardware integration, the comparative experiments, the federated work and the analysis that would follow — is ahead. It is listed here as outstanding rather than folded into a summary that would read as finished.
Q-table visualization
Benchmark comparison
Dashboard
The tooling can generate high-resolution figures suitable for research analysis and publication preparation. No figures are reproduced on this page — none have been produced from a completed experimental run, and nothing here has been submitted or published.
The repository is public. It shows a five-package ROS2 architecture with a declared message, service and action contract; both a Deep Q-Learning and a tabular Q-Learning training path; a model manager; a physics-based simulator and a synthetic data generator; a Streamlit dashboard; PyTorch to TensorFlow Lite conversion with a converted model committed; verification scripts; and publication-quality plotting tools.
No comparative result is reported, because none has been run and recorded. The hardware experiments, the multi-robot federated experiments and the generalization analysis are all outstanding. The benchmark tool can render a finished-looking comparison from synthetic data, so no figure from this project should be read as a finding. I claim no publication, and no contribution split is stated because none is documented.
The project builds as five ROS2 packages with colcon, holding QoS profiles and training hyperparameters in committed YAML rather than in code. The documentation currently names two different ROS2 releases across its setup paths, and several of the guides its README links to are not committed; the reproducible research environment should be standardized and recorded before any result is published.
Rafay Khattak
Portfolio project contributor / researcher
Muhammad Adil Khan
Maintainer