-
Notifications
You must be signed in to change notification settings - Fork 38
Behavior
UPennalizers Behavior is modeled and controlled by a system of Finite State Machines. It is divided into three parts:
The game state machine controls the general flow of the game. This is specified by the SPL Rules Committee and will only change if/when the rules change. The game initializes in the Initial state and then typically transitions to Ready where the robots line up for a kick off. Once they are all in position (or time runs out), the game transitions to Set where they wait for the whistle to signal the game is in Playing. At any time, the robots may be Penalized and come back into the game at a later time. When the half is over, the game is Finished.
The head is controlled separately from the body and its primary goal is to find and track the ball. This state machine image is a bit old and still has states for looking towards the goal. We haven't used those states as much recently because we don't use the goalposts to localize anymore. If we do start using goalposts for localization again then those states might be relevant again.
The body state machine controls the general actions of each player. bodyPosition is the main state that everything revolves around as it is the state where the player decides where they should be walking/going to. If the player sees the ball and is currently the Attacker then it will move into the bodyOrbit, bodyApproach, and bodyKick states to try and kick the ball towards the goal. If the robot doesn't see the ball, it will move into the Search states to try and figure out where the ball is. The state machine image here is not current, but at least gives and idea of the general structure of the FSM. For the most current details, refer to BodyFSM and try drawing out the state diagram yourself. The goalie has a (mostly) separate state machine from the normal field players but there is some overlap. Most Goalie states are labeled as such in the file name.
For more detailed information please refer to Testing and Debugging Behavior.