Problem
The robot had to explore a randomly generated maze until a central server assigned it a destination coordinate, then navigate there efficiently, all under strict memory and timing constraints.
University course project · 2023
An autonomous LEGO EV3 rover that explores mazes with depth-first search, routes with Dijkstra, and stays on track with PID control.
A Python control stack for an EV3-based rover navigating dynamic maze environments. It combines real-time hardware interfaces, a PID controller for line following, a finite state machine for mode switching, and MQTT telemetry to a central server. Exploration runs on depth-first search; routing on Dijkstra.
The robot had to explore a randomly generated maze until a central server assigned it a destination coordinate, then navigate there efficiently, all under strict memory and timing constraints.
We built a modular Python codebase around a finite state machine. An MQTT communication layer negotiates with the server and parses target coordinates. Depth-first search drives exploration; once the target arrives, a shortest-path algorithm computes the route.
The robot passed the final examination under time pressure: it received the server payload, mapped the maze, and navigated to the destination without errors or memory leaks.
The software runs on the ev3dev Linux kernel. A main event loop polls the color, distance, and gyro sensors and feeds a central logic controller. An asynchronous MQTT client handles the negotiation with the server for target coordinates.
Requests, parses, and validates target coordinates from the central server via MQTT.
Proportional-Integral-Derivative control for smooth line tracing and wall alignment.
Robust switching between exploration and target navigation modes.
Maps the maze in memory and computes the shortest path to the assigned goal.
Calibrated the sensors and established telemetry sessions via MQTT.
Built the state machine and depth-first exploration loops.
Refined the routing algorithms to compute paths quickly.
The rover completed the formal evaluation under real-time constraints.