summaryrefslogtreecommitdiff
path: root/digital/io-hub/src/robospierre/clamp.c
diff options
context:
space:
mode:
authorNicolas Schodet2011-05-31 22:42:33 +0200
committerNicolas Schodet2011-05-31 22:44:18 +0200
commit5ad4761bb3fc9b4d96d470630ee89b5a5bbd14e7 (patch)
treefc3ad42af0788d02b9e62b679358178f422096d3 /digital/io-hub/src/robospierre/clamp.c
parent8350707ab8e1cbea3a83ddc82bbdc814210b0e66 (diff)
digital/io-hub: move clamp to idle position once match started
Diffstat (limited to 'digital/io-hub/src/robospierre/clamp.c')
-rw-r--r--digital/io-hub/src/robospierre/clamp.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/digital/io-hub/src/robospierre/clamp.c b/digital/io-hub/src/robospierre/clamp.c
index a9a1680b..979cc3c4 100644
--- a/digital/io-hub/src/robospierre/clamp.c
+++ b/digital/io-hub/src/robospierre/clamp.c
@@ -59,6 +59,10 @@ FSM_STATES (
CLAMP_INIT_FINDING_ROTATION_EDGE,
/* Initialisation sequence: finding top switch. */
CLAMP_INIT_FINDING_TOP,
+ /* Initialisation sequence: going to rest position. */
+ CLAMP_INIT_GOING_REST,
+ /* Clamp ready, waiting in rest position. */
+ CLAMP_INIT_READY,
/* Returning to idle position. */
CLAMP_GOING_IDLE,
@@ -434,12 +438,23 @@ FSM_TRANS (CLAMP_INIT_FINDING_ROTATION_EDGE, clamp_rotation_success,
}
FSM_TRANS (CLAMP_INIT_FINDING_TOP, clamp_elevation_success,
- CLAMP_GOING_IDLE)
+ CLAMP_INIT_GOING_REST)
{
clamp_move (CLAMP_BAY_SIDE_ENTER_LEAVE);
return FSM_NEXT (CLAMP_INIT_FINDING_TOP, clamp_elevation_success);
}
+FSM_TRANS (CLAMP_INIT_GOING_REST, clamp_move_success, CLAMP_INIT_READY)
+{
+ return FSM_NEXT (CLAMP_INIT_GOING_REST, clamp_move_success);
+}
+
+FSM_TRANS (CLAMP_INIT_READY, init_start_round, CLAMP_GOING_IDLE)
+{
+ clamp_move (logistic_global.clamp_pos_idle);
+ return FSM_NEXT (CLAMP_INIT_READY, init_start_round);
+}
+
FSM_TRANS (CLAMP_GOING_IDLE, clamp_move_success, CLAMP_IDLE)
{
ctx.working = 0;