# Top FSM. top Main FSM calling other FSM. States: *IDLE waiting for the beginning of the top FSM. WAIT_INIT_TO_FINISH waiting for the end of init. FIRST_GO_BEGIN_OF_LINE_FAST first sequence, go to start of diagonal line FIRST_GO_END_OF_LINE_FAST first sequence, go to end of line FIRST_GO_END_OF_LINE_SLOW slow down to take elements Events: start initialize the FSM. move_fsm_succeed when the move FSM returns with success. move_fsm_failed when the move FSM returns with an error. bot_move_succeed when the bot has succeed its asserv movement. bot_move_failed when the bot has failed its asserv movement. init_match_is_started when the init FSM has finished and the match start. in_field the robot is in the zone containing interesting elements. state_timeout timeout in cycle count. asserv_last_cmd_ack last command sent to the asserv board has been acquitted. import init.fsm import move.fsm import loader.fsm IDLE: start -> WAIT_INIT_TO_FINISH nothing to do. WAIT_INIT_TO_FINISH: init_match_is_started -> FIRST_GO_BEGIN_OF_LINE_FAST the match start set fast speed go to first sequence begin of line FIRST_GO_BEGIN_OF_LINE_FAST: move_fsm_succeed -> FIRST_GO_END_OF_LINE_FAST go to end of line loader down move_fsm_failed -> . set slow speed retry FIRST_GO_END_OF_LINE_FAST: in_field -> FIRST_GO_END_OF_LINE_SLOW set slow speed move_fsm_succeed -> IDLE set slow speed move_fsm_failed -> FIRST_GO_END_OF_LINE_SLOW set slow speed retry FIRST_GO_END_OF_LINE_SLOW: move_fsm_succeed -> IDLE move_fsm_failed -> FIRST_GO_END_OF_LINE_SLOW retry