The power of State Machines. Gapped and Crossed Line Following with LEGO Mindstorms EV3
There comes a time when you need to program the robot to "follow a line, but if another sensor detects something you would like to stop, do some work, and then continue following the line". This is applicable to competition robots as it is applicable to real-life robots.
There comes the State Machine Pattern. An advanced and very powerful concept that allows you to easily implement complex robot behaviours with a simple, well-organized, extensible, bug-free program where the robot could be in 1,2, 10 or 100 states and you will still be able to manage the complexity of the world around the robot.
- 12
- 92:11
- 0