How trhoaq/mms works
Micromouse Simulator is a PyQt5 application for editing mazes and trying two robot-control modes. In algorithm mode, a user-supplied algorithm receives a perfect-information maze view; the controller applies its moves to a grid turtle and reports progress. In physical mode, a user control function receives simulated IR, encoder, and yaw readings, then commands differential-drive motors; physics handles movement and collisions. The editor supports maze creation and JSON save/load, with edited mazes synchronized across both modes. The graph follows shown calls and README capabilities; dashboard internals and user algorithms are not sampled.
Main entry points: main_window.py Main Window · maze.py Maze Model · physics.py Robot Physics · controller.py Algorithm Controller
Components 18
Maze Model
- Maze Model
core/maze.py - Grid Constants
core/const.py - Maze JSON Files
mazes
Algorithm Mode
- User Algorithm
user_code/my_algo.py - Algorithm Interface
core/algorithms/base.py - Algorithm Controller
sim_algo/controller.py - Grid Turtle
sim_algo/turtle_qt.py
Physical Mode
- User Control
user_code/my_control.py - Robot Controller
sim_real/controller.py - IR and IMU
sim_real/sensors.py - Robot Physics
sim_real/physics.py - Motors and Encoders
sim_real/motors.py
Application UI
- Application Entry
main.py - Main Window
ui/main_window.py - Maze Editor
ui/maze_editor.py - Robot View
ui/robot_view.py - Telemetry Dashboard
ui/dashboard.py
Other components
- User
Connections 27
- User → Application Entry: launches
main.py - Application Entry → Main Window: opens
main.py - Main Window → Maze Model: creates and loads
ui/main_window.py - Main Window → Maze Editor: creates
ui/main_window.py - Maze Editor → Maze Model: toggles walls
ui/maze_editor.py - Main Window → Maze JSON Files: saves and opens
ui/main_window.py - Main Window → User Algorithm: loads dynamically
ui/main_window.py - Main Window → Algorithm Controller: configures
ui/main_window.py - Main Window → Grid Turtle: creates
ui/main_window.py - Algorithm Controller → User Algorithm: requests moves
- Algorithm Controller → Algorithm Interface: builds maze view
sim_algo/controller.py - Algorithm Controller → Grid Turtle: applies actions
sim_algo/controller.py - Grid Turtle → Maze Model: reads walls and flood
sim_algo/turtle_qt.py - Maze Model → Grid Constants: uses grid definitions
core/maze.py - Main Window → User Control: loads dynamically
ui/main_window.py - Main Window → Robot Controller: configures
ui/main_window.py - Main Window → Robot Physics: creates robot
ui/main_window.py - Main Window → Robot View: creates
ui/main_window.py - Main Window → Telemetry Dashboard: creates
ui/main_window.py - Robot Controller → User Control: requests motor commands
- Robot Controller → IR and IMU: reads sensor values
sim_real/controller.py - Robot Controller → Robot Physics: steps robot
sim_real/controller.py - Robot Physics → IR and IMU: builds wall segments
sim_real/physics.py - Robot Physics → Motors and Encoders: updates motors and encoders
sim_real/physics.py - Robot Physics → Maze Model: builds collision geometry
- Robot View → IR and IMU: draws IR readings
ui/robot_view.py - Robot View → Maze Model: draws maze walls