summaryrefslogtreecommitdiffhomepage
path: root/digital/io/src/filterbridge.fsm
diff options
context:
space:
mode:
authorNicolas Haller2009-05-09 00:10:04 +0200
committerNicolas Haller2009-05-09 00:10:04 +0200
commitb76073669f43dca5e10cc1127d0818a05859058f (patch)
tree7d454c3b946b687861e44c7d035a5c03256a560c /digital/io/src/filterbridge.fsm
parent1901265a3ea59267f92fe2e923184fce3d689f72 (diff)
* digital/io/src
- modification on filterbridge FSM due to meca changes - implementing filterbridge FSM - fix init FSM to add the timeout feature
Diffstat (limited to 'digital/io/src/filterbridge.fsm')
-rw-r--r--digital/io/src/filterbridge.fsm75
1 files changed, 30 insertions, 45 deletions
diff --git a/digital/io/src/filterbridge.fsm b/digital/io/src/filterbridge.fsm
index 97bcfa54..2a87ab05 100644
--- a/digital/io/src/filterbridge.fsm
+++ b/digital/io/src/filterbridge.fsm
@@ -5,66 +5,51 @@ filterbridge
States:
IDLE
waiting the lift is ready to accept new puck
+ WAIT_JACK_IN
+ waiting for the jack to be inserted into the bot
+ CLOSE_DOOR[timeout=225]
+ close access to the lift (and wait 1 sec)
WAIT_A_PUCK
waiting for a new puck
- WAIT_RGB_PROBE
- waiting for RGB probe the first puck
- EJECT_PUCK
- eject a bad puck
- RETURN_NORMAL_POS
- move the bridge to his normal position
- OPEN_DOOR
+ OPEN_DOOR[timeout=225]
release puck to the lift and block a new puck on pos1
- CLOSE_DOOR
- release pos1 puck and close access to the lift
+ PUSH_PUCK
+ push the puck to the lift
Events:
- lift_ready
- lift ready to accept new puck
+ start
+ robot start
+ jack_inserted_into_bot
+ jack into the bot
puck_on_pos2
a puck has been detected on bridge's position 2
no_puck_on_pos2
there is no puck on position 2
- bridge_in_position
- bridge is in his normal position
- door_opened
- puck 1 blocked and puck 2 release to the lift
- ejection_done
- the ejection procedure is completed
- color_probed
- the result of the investigation will be revealed (suspens!!)
- door_closed
- ready to test a new puck
state_timeout
+ timeout used to wait the end of servo move
IDLE:
- lift_ready -> WAIT_A_PUCK
- the lift is ready to get pucks, we can begin testing procedure
+ start -> WAIT_JACK_IN
+ we wait for the jack
-WAIT_A_PUCK:
- puck_on_pos2: too_much_puck -> EJECT_PUCK
- we have too much puck, eject the puck quickly and whistle
- puck_on_pos2: nb_puck_ok -> WAIT_RGB_PROBE
- probe color of the new puck
-
-WAIT_RGB_PROBE:
- color_probed: bad_color -> EJECT_PUCK
- eject bad puck
- color_probed: good_color -> OPEN_DOOR
- put puck to the lift
+WAIT_JACK_IN:
+ jack_inserted_into_bot -> CLOSE_DOOR
+ we init the bridge
-EJECT_PUCK:
- ejection_done -> RETURN_NORMAL_POS
- put bridge on normal position after puck ejection
+CLOSE_DOOR:
+ state_timeout -> WAIT_A_PUCK
+ we are ready, we wait a puck
-RETURN_NORMAL_POS:
- bridge_in_position -> CLOSE_DOOR
- make bridge ready to test a new puck
+WAIT_A_PUCK:
+ puck_on_pos2: lift_not_ready -> .
+ Lift not ready, we stand by
+ puck_on_pos2: lift_ready -> OPEN_DOOR
+ Lift ok, we deliver
OPEN_DOOR:
- no_puck_on_pos2 -> CLOSE_DOOR
- release puck to the lift
+ state_timeout -> PUSH_PUCK
+ we push the puck to the lift
-CLOSE_DOOR:
- door_closed -> IDLE
- filter bridge ready
+PUSH_PUCK:
+ no_puck_on_pos2 -> CLOSE_DOOR
+ the puck disappears, we close doors