SmartMaze is an robotics project that integrates procedural maze generation, intelligent pathfinding, and realistic physical simulation in a 3D environment. The system generates configurable random mazes and uses AI algorithms to plan optimal paths for a robot to collect objects and reach the exit.
- 3D mazes generated dynamically
- Manual or autonomous robot control
- Collectible objects placed in the maze
- Real-time visualization of the optimal path
Wilson’s Algorithm (godotProject/src/algorithms/wilson_algorithm.gd
):
- Produces unbiased uniform mazes
- Based on random walk with loop detection
- Ensures full connectivity between cells
Configurable parameters:
maze_width
,maze_height
– grid sizecell_size
– physical cell sizeseed_value
– deterministic generation (optional)
Optimized A* (godotProject/src/pathfinding/astar_pathfinding.gd
):
- Shortest path computation between points
- TSP-like optimization for object collection
Optimization strategy:
- Precompute distances between key points
- Brute force for small instances (≤5 objects)
- Greedy nearest-neighbor heuristic for larger mazes
- Path reconstruction from optimal segments
Implemented in Python (notebook/lib/system/cart.py
):
- Cart2D: Basic cylindrical robot
- TwoWheelsCart2D: Differential drive
- TwoWheelsCart2DEncoders: Encoders for odometry
- TwoWheelsCart2DEncodersOdometry: Full odometry integration
- AckermannSteering: Ackermann vehicle model
Features:
- Force and torque dynamics
- Linear and angular friction
- Inertia-based motion
- Odometry estimation
PID Controllers (notebook/lib/system/controllers.py
):
- P, PI (with anti-windup), and PID control
DDS Communication:
- Real-time data exchange between Godot and Python
- Waypoint transmission with acknowledgment
- Continuous telemetry updates
-
Initialization
- Godot generates maze and objects
- A* with TSP optimization computes the route
-
Communication
- DDS handshake between Godot and Python
- Waypoints sent, acknowledgments received
-
Simulation
- Python simulates robot motion with physical models
- PID controllers ensure path following
-
Visualization
- Godot updates robot position in 3D
- Displays real-time path progress
- F – Follow view
- P – Top-down view
- Enter – Regenerate maze
- Esc – Toggle solution path