summaryrefslogtreecommitdiffhomepage
path: root/digital/io/src
diff options
context:
space:
mode:
Diffstat (limited to 'digital/io/src')
-rw-r--r--digital/io/src/ai_loader_cb.c18
-rw-r--r--digital/io/src/ai_top_cb.c2
-rw-r--r--digital/io/src/bot.h2
-rw-r--r--digital/io/src/loader.fsm8
4 files changed, 6 insertions, 24 deletions
diff --git a/digital/io/src/ai_loader_cb.c b/digital/io/src/ai_loader_cb.c
index 7de8a652..a51d740e 100644
--- a/digital/io/src/ai_loader_cb.c
+++ b/digital/io/src/ai_loader_cb.c
@@ -63,7 +63,7 @@ ai__LOADER_WAIT_JACK_OUT__jack_removed_from_bot (void)
asserv_motor0_zero_position (-BOT_ELEVATOR_ZERO_SPEED);
mimot_motor0_clamp (BOT_CLAMP_ZERO_SPEED, 0);
mimot_motor1_clamp (BOT_CLAMP_ZERO_SPEED, 0);
- asserv_motor1_zero_position (BOT_GATE_SPEED);
+ asserv_motor1_zero_position (-BOT_GATE_SPEED);
return ai_next (LOADER_WAIT_JACK_OUT, jack_removed_from_bot);
}
@@ -115,13 +115,11 @@ ai__LOADER_INIT_GATE_ZERO__gate_succeed (void)
/*
* LOADER_INIT_ELEVATOR_UP =elevator_succeed=>
- * => LOADER_INIT_GATE_OPEN
- * open gate
+ * => LOADER_INIT_GATE_WAIT
*/
fsm_branch_t
ai__LOADER_INIT_ELEVATOR_UP__elevator_succeed (void)
{
- asserv_move_motor1_absolute (BOT_GATE_STROKE_STEP, BOT_GATE_SPEED);
return ai_next (LOADER_INIT_ELEVATOR_UP, elevator_succeed);
}
@@ -140,16 +138,6 @@ ai__LOADER_INIT_ELEVATOR_UP__elevator_failed (void)
}
/*
- * LOADER_INIT_GATE_OPEN =gate_succeed=>
- * => LOADER_INIT_GATE_WAIT
- */
-fsm_branch_t
-ai__LOADER_INIT_GATE_OPEN__gate_succeed (void)
-{
- return ai_next (LOADER_INIT_GATE_OPEN, gate_succeed);
-}
-
-/*
* LOADER_INIT_GATE_WAIT =state_timeout=>
* => LOADER_INIT_GATE_CLOSE
* close gate
@@ -157,7 +145,7 @@ ai__LOADER_INIT_GATE_OPEN__gate_succeed (void)
fsm_branch_t
ai__LOADER_INIT_GATE_WAIT__state_timeout (void)
{
- asserv_move_motor1_absolute (0, BOT_GATE_SPEED);
+ asserv_move_motor1_absolute (BOT_GATE_STROKE_STEP, BOT_GATE_SPEED);
return ai_next (LOADER_INIT_GATE_WAIT, state_timeout);
}
diff --git a/digital/io/src/ai_top_cb.c b/digital/io/src/ai_top_cb.c
index c057bebf..6e0a0c8d 100644
--- a/digital/io/src/ai_top_cb.c
+++ b/digital/io/src/ai_top_cb.c
@@ -189,7 +189,7 @@ ai__UNLOAD_FACE_BIN__bot_move_succeed (void)
fsm_branch_t
ai__UNLOAD_BACK_BIN__bot_move_succeed (void)
{
- asserv_move_motor1_absolute (BOT_GATE_STROKE_STEP, BOT_GATE_SPEED);
+ asserv_move_motor1_absolute (0, BOT_GATE_SPEED);
return ai_next (UNLOAD_BACK_BIN, bot_move_succeed);
}
diff --git a/digital/io/src/bot.h b/digital/io/src/bot.h
index 9617ecb2..582f3261 100644
--- a/digital/io/src/bot.h
+++ b/digital/io/src/bot.h
@@ -116,7 +116,7 @@
#define BOT_GATE_SPEED 0x46
/** Gate stroke in steps. */
-#define BOT_GATE_STROKE_STEP 0x2081
+#define BOT_GATE_STROKE_STEP -0x1d6b
/**
* Definition of the colors.
diff --git a/digital/io/src/loader.fsm b/digital/io/src/loader.fsm
index 1978ef41..dd0a6a9c 100644
--- a/digital/io/src/loader.fsm
+++ b/digital/io/src/loader.fsm
@@ -19,8 +19,6 @@ States:
find gate zero
LOADER_INIT_ELEVATOR_UP
move the elevator up so that the robot can go to the wall
- LOADER_INIT_GATE_OPEN
- open gate to unload elements before start
LOADER_INIT_GATE_WAIT[timeout=225]
wait with gate open
LOADER_INIT_GATE_CLOSE
@@ -99,14 +97,10 @@ LOADER_INIT_GATE_ZERO:
gate_succeed -> LOADER_INIT_ELEVATOR_UP
LOADER_INIT_ELEVATOR_UP:
- elevator_succeed -> LOADER_INIT_GATE_OPEN
- open gate
+ elevator_succeed -> LOADER_INIT_GATE_WAIT
elevator_failed -> LOADER_IDLE
initialisation failure
-LOADER_INIT_GATE_OPEN:
- gate_succeed -> LOADER_INIT_GATE_WAIT
-
LOADER_INIT_GATE_WAIT:
state_timeout -> LOADER_INIT_GATE_CLOSE
close gate