I think the issue is due to task 2 not running straight, so it ends up rotated more than 90 degrees relative to the start pose. This makes the robot hit the wall and get stuck:
Looks like it hit the wall, that will stop it from rotating properly. Maybe be a bit more conservative with the front distance? Really depends on the update frequency of the simulation
The robot does not drive straight in task 2 - That’s a problem I’ve seen from other people on the forum too. I only use the move_straight command. It does not hit the wall.
Due to the pose from task 2, the robot will drive at an angle not equal to 90 degrees in task 3, causing it to drive toward and into the wall as seen in the screenshot.
Not driving straight is not a problem, is how the robot works. You should take that into account when creating your program and act accordingly.
Robots are not computers. They deal with the real world. And the real world is messy, noisy and unpredictable. That is why we still don’t have a robot in our homes helping us.
Programming robots is way more difficult than programming computer software. This is your first taste