summaryrefslogtreecommitdiffhomepage
path: root/digital/io/src/getsamples.fsm
diff options
context:
space:
mode:
authorJérémy Dufour2008-05-03 12:43:19 +0200
committerJérémy Dufour2008-05-03 12:43:19 +0200
commit23bce6a75a17b9cd9d3f35a251baa1b0635697a4 (patch)
treecc53e275464e9e86cf6fe705497d0212fea960f1 /digital/io/src/getsamples.fsm
parent1bcff7dbcbb284f5564ac708292b23fd447395a9 (diff)
* digital/io/src
- manage the event where the bot can be blocked (when moving) in the different FSM, by waiting and trying again ; - ensure we update the classifier (with the servos motor) even when the arm move in a state where it should not.
Diffstat (limited to 'digital/io/src/getsamples.fsm')
-rw-r--r--digital/io/src/getsamples.fsm11
1 files changed, 11 insertions, 0 deletions
diff --git a/digital/io/src/getsamples.fsm b/digital/io/src/getsamples.fsm
index 175a1824..4b54c5f8 100644
--- a/digital/io/src/getsamples.fsm
+++ b/digital/io/src/getsamples.fsm
@@ -25,6 +25,8 @@ States:
put the arm back in front of the input hole to prevent sample to enter
MOVE_BACKWARD_FROM_DISTRIBUTOR
move a little bit backward from the distributor
+ WAIT_AND_TRY_AGAIN
+ wait and try again
Events:
start
@@ -69,8 +71,10 @@ TAKE_SAMPLES:
take a new one
reset the timeout
arm_pass_noted_position: no_more -> MOVE_AWAY_FROM_DISTRIBUTOR
+ store current position
go backward
wait_finished -> MOVE_AWAY_FROM_DISTRIBUTOR
+ store current position
timed out, give up
go backward
@@ -78,6 +82,8 @@ MOVE_AWAY_FROM_DISTRIBUTOR:
bot_move_succeed -> CLOSE_INPUT_HOLE
close input hole
setup a close timeout
+ bot_move_failed -> WAIT_AND_TRY_AGAIN
+ ask to be wake up in a certain time
arm_pass_noted_position -> .
prepare the classification of the taken sample
@@ -89,3 +95,8 @@ CLOSE_INPUT_HOLE:
tell the top FSM we have finished
arm_pass_noted_position -> .
prepare the classification of the taken sample
+
+WAIT_AND_TRY_AGAIN:
+ wait_finished -> MOVE_AWAY_FROM_DISTRIBUTOR
+ compute remaining distance (protection agains 0 & 300)
+ try to move away again