summaryrefslogtreecommitdiff
path: root/digital
diff options
context:
space:
mode:
authorJérémy Dufour2009-05-22 06:07:55 +0200
committerJérémy Dufour2009-05-22 06:07:55 +0200
commit85d96233455b890c83638583da11e7aa6e989e72 (patch)
treeb266724499c06a2a07a13bc2704e5146c90a33f2 /digital
parentf93c8db7b26b7128d779e9b0dcb9239ab3a60459 (diff)
* digital/io/src:
- add a timeout when trying to get puck from the distributor, - reduce temporisation to unload pucks (wrong value).
Diffstat (limited to 'digital')
-rw-r--r--digital/io/src/top.fsm6
-rw-r--r--digital/io/src/top_cb.c19
2 files changed, 23 insertions, 2 deletions
diff --git a/digital/io/src/top.fsm b/digital/io/src/top.fsm
index fd514478..d59eea08 100644
--- a/digital/io/src/top.fsm
+++ b/digital/io/src/top.fsm
@@ -9,7 +9,7 @@ States:
waiting for the end of init.
GET_PUCK_FROM_THE_GROUND [timeout=1575]
get some pucks from the ground.
- GET_PUCK_FROM_DISTRIBUTOR
+ GET_PUCK_FROM_DISTRIBUTOR [timeout=2250]
get some pucks from the distributor.
STOP_TO_GO_TO_UNLOAD_AREA
stop the move FSM before starting a new one.
@@ -19,7 +19,7 @@ States:
when going to unload area.
FUCK_UNLOAD_AREA
when going backward in position for unload.
- UNLOAD_PUCKS [timeout=11250]
+ UNLOAD_PUCKS [timeout=1125]
when unloading all pucks from the bot.
ELEVATOR_READY_TO_GO_AWAY_TO_RETRY_UNLOAD [timeout=1125]
wait for the elevator to be ready for a bot movement.
@@ -157,6 +157,8 @@ GET_PUCK_FROM_DISTRIBUTOR:
move_fsm_failed: some_pucks_and_no_more_time -> GO_TO_UNLOAD_AREA
compute an unload area.
ask move FSM to go there.
+ state_timeout -> .
+ get the next distributor position and launch move FSM to go there.
CLEAN_FRONT_OF_DISTRIBUTOR:
move_fsm_succeed -> FUCK_THE_DISTRIBUTOR
diff --git a/digital/io/src/top_cb.c b/digital/io/src/top_cb.c
index 4315515b..3dd7bafe 100644
--- a/digital/io/src/top_cb.c
+++ b/digital/io/src/top_cb.c
@@ -247,6 +247,25 @@ top__GET_PUCK_FROM_DISTRIBUTOR__move_fsm_failed (void)
}
/*
+ * GET_PUCK_FROM_DISTRIBUTOR =state_timeout=>
+ * => GET_PUCK_FROM_DISTRIBUTOR
+ * get the next distributor position and launch move FSM to go there.
+ */
+fsm_branch_t
+top__GET_PUCK_FROM_DISTRIBUTOR__state_timeout (void)
+{
+ /* Close cylinder. */
+ cylinder_close_order = 1;
+ /* Get next position. */
+ asserv_position_t position;
+ /* Go to distributor. */
+ top_get_next_position_to_get_distributor (&position, &front_position);
+ /* Go there. */
+ move_start (position, ASSERV_BACKWARD);
+ return top_next (GET_PUCK_FROM_DISTRIBUTOR, state_timeout);
+}
+
+/*
* STOP_TO_GO_TO_UNLOAD_AREA =move_fsm_stopped=>
* => GO_TO_UNLOAD_AREA
* compute an unload area.