Thymio Bulldozer
Solution
Click on the card to discover the solution
In its initial state (white-white-grey-grey), Thymio follow a line on the ground. That's the role of the 4 first lines.
When Thymio detects something in front of it (line 5), it changes its state (orange-white-grey-grey) and go backwards to gain momentum. It goes back for 2 seconds and after that (line 6), it goes straight-forward and change its state again (orange-orange-grey-grey). It will move forward longer than it went back to push the object out of the track.
Once the object out of the track, Thymio changes its state (white-orange-grey-grey) and goes back (line 9) until it finds the track again. When it sees it with one of its ground sensors (line 8 or 9), it goes back to the start state (white-white-grey-grey) and resume the line following algorithm.
Share
Show us your results! You can share your own Thymio ambulance.
Click here to go to the creation section.