# Top FSM. # Some remarks on this FSM. # Maybe we can make only one state for the all the GO_TO_*DISTRIBUTOR. It is # more complicated, but it can be cleaner... # We do not manage some cases like, we have not get any balls from any # distributors. top Top FSM with the Marcel's strategy States: IDLE waiting for the beginning of the top FSM WAIT_JACK_IN waiting for the jack to be inserted into the bot WAIT_JACK_OUT waiting for the jack to be removed from the bot CONFIGURE_ASSERV configuring the asserv board MOVE_FORWARD move forward MOVE_BACKWARD move backward Events: start initialize the FSM move_fsm_finished when the move FSM returns jack_inserted_into_bot the jack is inserted into the bot jack_removed_from_bot the jack is removed from the bot settings_acknowledged the asserv board has acknowledged the settings sent state_timeout IDLE: start -> WAIT_JACK_IN wait for the jack to be inserted into the bot WAIT_JACK_IN: jack_inserted_into_bot -> WAIT_JACK_OUT wait for the jack to be removed from the bot WAIT_JACK_OUT: jack_removed_from_bot -> CONFIGURE_ASSERV the match start, start the chronometer we should also initialize all the subsystems of IO (get our color, ...) set the settings of the asserv board (especially the position) CONFIGURE_ASSERV: settings_acknowledged -> MOVE_FORWARD move the bot forward MOVE_FORWARD: move_fsm_finished -> MOVE_BACKWARD return to initial position (yep it's useless but it's for test) MOVE_BACKWARD: move_fsm_finished -> MOVE_FORWARD move forward again