It has been while since I last wrote to you, but now I've run into a big problem regarding the mapping of the board and nodes. We were trying to force the map reading at first, but got an awful answer from the teacher as he wants us to use heurestic search rather than forcing it through.
I came here to ask for some examples or tutorials that teach how the node class of ev3 works.
My goal is to map the whole board, ignoring the red borders with a color sensor ( these are classed as walls ). To remove the node from its neigbour i was thinking of using node.removeNeigbour. Also I need to ignore going into two tiles that have Sheeps (two objects regonizable by ultrasonic sensor).
After the whole map is visited at least one time(or marked that there was an obstacle in that tile), it has to return to the starting position.
After this he has to get the two objects to the final position across the map.
I was wondering if anyone has worked this way with the node class and could give me some tips and tricks.
My idea was trying to check it tile by tile, row by row until whole map is cleared of obstacles.
I will add a pseudocode.
Code: Select all
Move East until on border
check Walls and Sheeps
go around them
Move tile up and continue until:
finished map horizontally.
Go through map vertically to assure every connection between nodes has been checked.
return to start
The map is a 6x6 square with possible positions of walls in all between them ( including a case where a tile might be blocked by 4 walls (deleting the node? ))