Below is my first and second working simulation in week 4, we can see big progress in work, the robot got few new options
Goal – First time we can set the goal
End of the program – If we reach the goal
The robot is divided into two parts on the right-side range of the direction goes from (front 0 to back 180) on the left direction goes from (front -0 to back -180) we can use both 180 and -180 it doesn’t change anything.
When finding a wall we decide where we want to go (left-right) it chooses it by calculating direction in which way the goal is if it is more then 0 then its right otherwise left. Then we follow the wall until we reach the end or find the corner. If we find a corner we are changing the wall that we follow to the new one. If we find the end of the wall we try to go on the other side of the wall.