Hi I am currently designing a path planning algorithm for a known maze map in simulink on matlab. The code is uploaded and run through an arduino uno. We have been advised to represent the maze in a matrix as in the image below, however Im not quite sure how to put this into code and make the robot move through the maze based on the matrix. We can make the robot move using serial commands, moving it forwards or backwards or rotating it by a certain angle. Is there any resources or websites that I can find examples of how to use this type of mapping?
You need to locate zeros in the matrix that are adjacent or diagonal to other zeros, accessible from the current robot location. Those cells represent at least the start of a potentially viable path through the maze.
Do you understand how to index and store/fetch values to/from a matrix, in C/C++? If not, that would be great place to start learning.
I know how to fetch and store, I'm having trouble syncing it up with the movement of the robot. Say I start in (7,1) I can't get my head around coding the movement. I'm trying to put something like:
int Start = maze [7][1]
if (maze[7][1+1] = 0) { Command to move to the right
}
but then I have no idea how to update the current position