ukmars / mazerunner-core

Core micromouse software for the ukmarsbot robot
MIT License
20 stars 8 forks source link

Possible bug in maze.h code if using different maze sizes #6

Open paulbuzzby opened 1 year ago

paulbuzzby commented 1 year ago

In my process to convert over the python, I see that a constant value of 64 is used on line 400 of Maze.h. I think this should be set to MAZE_CELL_COUNT.

Probably won't cause a problem if a smaller maze is defined but might as well match with the other maze constants

micromouseonline commented 1 year ago

When the maze is being flooded, there is a queue of 'frontier' cells. These are the cells that are waiting to be checked for neighbours. I believe the maximum size that this queue can possibly be for a classic maze is 64 (MAZE_CELL_COUNT/4) cells. Hence the magic number. However, I have not proven that to be the case.

I do need to add this as a comment in the source though.

micromouseonline commented 1 year ago

Done