Full Game HSM
This is the full hierarchical state machine that controls how the robot behaves in the game. It is, at most three level deep with each individual state machine described below
Top Level Game SM
This is the top level state machine. It control the main states that the tractor is operating in. The tractor is in StandBy whenever there are no mining permits issued available or when permits expire. It is in Mining operations whenever permits are issued. If the tractor collides with any object, it stops mining and focuses on AvoidingCollision.
Mining SM
This state machine describes the major mining operations of the tractor. The tractor begins by SearchingForMiner and when it captures the appropriate miner moves on to DroppingOffMiner. It keeps a history of where it was previously so it can resume the appropriate operations after it collides with another object or when mining permits location change.
Miner Search SM
This state machine controls the behavior of the tractor when searching for the miner. It always begins with AligningMiner and does a Repositioning attempt when it does not find the target miner one. If the tractor detects the target miner it moves forward to FetchingMiner while ZigZagging to correct the path. Upon contact with the miner, it takes a while CapturingMiner before exiting.
Miner Delivery SM
This is the state machine control miner delivery to its appropriate drop off mine zone. The tractor begins with AligningZone and once aligned moves to ApproachingMine. It realigns with zone again if it does not approach the appropriate zone within a certain period of time. This helps the tractor correct for misalignments. Once it gets to the right mine zone, the tractor stops and engages in DroppingOff the miner.
Collision SM
This state machine controls the tractor behavior once it collides with another object. The tractor is almost always moving forward or turning so after a collision it begins by BackingUp from the object. It then starts Rotating for a short while and then goes into MovingForward to move away from the collided object.