|author||Jérémy Dufour||2008-04-14 12:06:01 +0200|
|committer||Jérémy Dufour||2008-04-14 12:06:01 +0200|
* build - add dependency of fsm.h for main.c (for bootstrap) ; - ensure it is building for host target. * get samples FSM - remove unneeded fields in the getsamples structures ; - rename it to be more 'private' (to prevent declaring the same one) ; * top FSM - rewrite it ; - still missing some parts to implement. * general - manage color of the bot ; - initialize the switch module in the main_init ; - add position of the gutter.
Diffstat (limited to 'digital/io/src/top.fsm')
1 files changed, 100 insertions, 41 deletions
diff --git a/digital/io/src/top.fsm b/digital/io/src/top.fsm
index 21a6923f..eed38367 100644
@@ -1,47 +1,106 @@
# 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
+ Top FSM that call others FSM
+ waiting for the beginning of the top FSM
+ waiting for the jack to be inserted into the bot
+ waiting for the jack to be removed from the bot
+ go to our distributor of samples (using the move FSM)
+ go to our ice distributor (using the move FSM)
+ go to the adverse ice distributor (using the move FSM)
+ get samples from the samples distributor (using the get samples FSM)
+ get ice from our ice distributor (using the get samples FSM)
+ get ice from adverse ice distributor (using the get samples FSM)
+ go to the gutter (using the move FSM)
+ drop all the balls contained in the bot into the gutter (using the gutter
- ok -> GET_SAMPLES
- Go to take some samples. The sequence shall be adapt to take the correct number of samples.
- samples_took -> BACKWARD
- The samples had been took and now the ice is missing.
- ice_took -> BACKWARD
- Go backward to end the take balls.
- samples_deposed -> GET_SAMPLES
- The samples had been deposed, it shall try to get more samples. This state will call the getsamples FSM and the moveFSM.
- ice_took -> BACKWARD
- The ice has been taken.
- ended -> GET_ICE
- Get ICE to end the sequence.
- collector_full -> GO_TO_GOAL
- Go the goal to depose the samples.
- ice_dist_empty -> GET_ADV_ICE
- Go to take the ice in the adversary distributor because our is empty.
+ initialize the FSM
+ when the get samples FSM returns
+ when the move FSM returns
+ when the gutter FSM returns
+ the jack is inserted into the bot
+ the jack is removed from the bot
+ start -> WAIT_JACK_IN
+ tell the main loop we want to be informed when the jack is inserted into the
+ jack_inserted_into_bot -> WAIT_JACK_OUT
+ tell the main loop we want to be informed when the jack is removed from the
+ jack_removed_from_bot -> GO_TO_SAMPLE_DISTRIBUTOR
+ the match start, start the chronometer
+ we should also initialize all the subsystems of IO (reset position, get our
+ color, ...)
+ order the bot to move to our samples distributors with the move FSM
+ move_fsm_finished -> GET_SAMPLES_FROM_SAMPLES_DISTRIBUTOR
+ we are now in front of our samples distributor, launch the get samples FSM
+ get_samples_fsm_finished -> GO_TO_OUR_ICE_DISTRIBUTOR
+ we have finished to get our samples, let's go to our ice distributor with
+ the move FSM
+ move_fsm_finished -> GET_ICE_FROM_OUR_ICE_DISTRIBUTOR
+ we are now in front of our ice distributor, launch the get samples FSM
+ get_samples_fsm_finished: full -> GO_TO_GUTTER
+ we have finished to get ice from our distributor and we have no more space
+ left, let's go the gutter with the move FSM
+ get_samples_fsm_finished: not full -> GO_TO_ADVERSE_ICE_DISTRIBUTOR
+ we have finished to get ice from our distributor and we have some space
+ left, let's go the adverse ice distributor with the move FSM
+ move_fsm_finished -> DROP_OFF_BALLS_TO_GUTTER
+ we are now at the gutter, let's drop all ours balls into it with the gutter
+ gutter_fsm_finished -> GO_TO_SAMPLE_DISTRIBUTOR
+ we have finished to drop off all the balls, let's go to our sample
+ ditributor to try the same strategy again
+ reset internal data
+ move_fsm_finished -> GET_ICE_FROM_ADVERSE_ICE_DISTRIBUTOR
+ we are now in front of the adverse ice distributor, launch the get samples
+ get_samples_fsm_finished -> GO_TO_GUTTER
+ we have finished to get ice. Even if we are not full, let's go to the gutter
+ with the move FSM