summaryrefslogtreecommitdiffhomepage
path: root/digital/io/src/top.fsm
diff options
context:
space:
mode:
Diffstat (limited to 'digital/io/src/top.fsm')
-rw-r--r--digital/io/src/top.fsm162
1 files changed, 0 insertions, 162 deletions
diff --git a/digital/io/src/top.fsm b/digital/io/src/top.fsm
deleted file mode 100644
index 277f0a5a..00000000
--- a/digital/io/src/top.fsm
+++ /dev/null
@@ -1,162 +0,0 @@
-# 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
- UNLOAD
- go to unloading position
- UNLOAD_LOADER_UP
- move loader to up position
- UNLOAD_FACE_BIN
- orient robot to unload angle
- UNLOAD_FACE_BIN_UNBLOCK
- move backward to unblock
- UNLOAD_BACK_BIN
- move back to unload bin
- UNLOAD_UNLOAD[timeout=225]
- unloading, wait
- COLLECT
- collecting elements
- COLLECT_SLOW_MOTION[timeout=450]
- picking element before bumper contact
- COLLECT_BLACK
- moving backward after trying to collect a black corn
-
-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.
- clamp_succeed
- asserv success result
-
-import init.fsm
-import hola.fsm
-import loader.fsm
-import move.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 -> UNLOAD_LOADER_UP
- set slow speed
- move loader up
- move_fsm_failed -> FIRST_GO_END_OF_LINE_SLOW
- set slow speed
- retry
-
-FIRST_GO_END_OF_LINE_SLOW:
- move_fsm_succeed -> UNLOAD_LOADER_UP
- move loader up
- move_fsm_failed -> FIRST_GO_END_OF_LINE_SLOW
- retry
-
-UNLOAD:
- move_fsm_succeed -> UNLOAD_LOADER_UP
- move loader up
- move_fsm_failed -> .
- retry
-
-UNLOAD_LOADER_UP:
- loader_uped -> UNLOAD_FACE_BIN
- turn toward bin
- loader_errored -> UNLOAD_FACE_BIN
- turn toward bin
-
-UNLOAD_FACE_BIN:
- bot_move_succeed -> UNLOAD_BACK_BIN
- go backward to bin
- bot_move_failed -> UNLOAD_FACE_BIN_UNBLOCK
- move backward
-
-UNLOAD_FACE_BIN_UNBLOCK:
- bot_move_succeed -> UNLOAD_FACE_BIN
- turn toward bin
- bot_move_failed -> UNLOAD_FACE_BIN
- turn toward bin
-
-UNLOAD_BACK_BIN:
- bot_move_succeed -> UNLOAD_UNLOAD
- unload
- bot_move_failed -> UNLOAD_UNLOAD
- unload
-
-UNLOAD_UNLOAD:
- state_timeout -> COLLECT
- close gate
- loader down
- choose best food to collect
-
-COLLECT:
- move_fsm_succeed: unload -> UNLOAD
- move_fsm_succeed: collect -> COLLECT
- move_fsm_succeed: slow_motion -> COLLECT_SLOW_MOTION
- post loader_element event
- move_fsm_failed: unload -> UNLOAD
- move_fsm_failed: collect -> COLLECT
- cancel this element
- loader_black -> COLLECT_BLACK
- move backward
- mark as black
-
-COLLECT_SLOW_MOTION:
- loader_downed: unload -> UNLOAD
- loader_downed: collect -> COLLECT
- collect
- loader_errored: unload -> UNLOAD
- loader_errored: collect -> COLLECT
- same as above
- state_timeout: unload -> UNLOAD
- state_timeout: collect -> COLLECT
- same as above
- loader_black -> COLLECT_BLACK
- move backward
- mark as black
-
-COLLECT_BLACK:
- bot_move_succeed: unload -> UNLOAD
- bot_move_succeed: collect -> COLLECT
- bot_move_failed: unload -> UNLOAD
- bot_move_failed: collect -> COLLECT