summaryrefslogtreecommitdiff
path: root/digital/io/src/ai_top_cb.c
diff options
context:
space:
mode:
authorNicolas Schodet2010-05-14 13:06:29 +0200
committerNicolas Schodet2010-05-14 13:06:29 +0200
commitcfc72a8fea2d8ce7f442f7f7612e1b50eb5664fc (patch)
tree7e631ce7a2b8d107ce0ab0c5ccfd80d645a69f3f /digital/io/src/ai_top_cb.c
parente916ca27604842a8cd25c2158a941b9c3fda83b8 (diff)
digital/io/src: add blocking handlingeurobot-2010-3
Diffstat (limited to 'digital/io/src/ai_top_cb.c')
-rw-r--r--digital/io/src/ai_top_cb.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/digital/io/src/ai_top_cb.c b/digital/io/src/ai_top_cb.c
index 2041ab7b..65895afe 100644
--- a/digital/io/src/ai_top_cb.c
+++ b/digital/io/src/ai_top_cb.c
@@ -190,6 +190,18 @@ ai__UNLOAD_LOADER_UP__loader_uped (void)
}
/*
+ * UNLOAD_LOADER_UP =loader_errored=>
+ * => UNLOAD_FACE_BIN
+ * turn toward bin
+ */
+fsm_branch_t
+ai__UNLOAD_LOADER_UP__loader_errored (void)
+{
+ asserv_goto_angle (PG_A_DEG (90));
+ return ai_next (UNLOAD_LOADER_UP, loader_errored);
+}
+
+/*
* UNLOAD_FACE_BIN =bot_move_succeed=>
* => UNLOAD_BACK_BIN
* go backward to bin
@@ -202,6 +214,42 @@ ai__UNLOAD_FACE_BIN__bot_move_succeed (void)
}
/*
+ * UNLOAD_FACE_BIN =bot_move_failed=>
+ * => UNLOAD_FACE_BIN_UNBLOCK
+ * move backward
+ */
+fsm_branch_t
+ai__UNLOAD_FACE_BIN__bot_move_failed (void)
+{
+ asserv_move_linearly (-40);
+ return ai_next (UNLOAD_FACE_BIN, bot_move_failed);
+}
+
+/*
+ * UNLOAD_FACE_BIN_UNBLOCK =bot_move_succeed=>
+ * => UNLOAD_FACE_BIN
+ * turn toward bin
+ */
+fsm_branch_t
+ai__UNLOAD_FACE_BIN_UNBLOCK__bot_move_succeed (void)
+{
+ asserv_goto_angle (PG_A_DEG (90));
+ return ai_next (UNLOAD_FACE_BIN_UNBLOCK, bot_move_succeed);
+}
+
+/*
+ * UNLOAD_FACE_BIN_UNBLOCK =bot_move_failed=>
+ * => UNLOAD_FACE_BIN
+ * turn toward bin
+ */
+fsm_branch_t
+ai__UNLOAD_FACE_BIN_UNBLOCK__bot_move_failed (void)
+{
+ asserv_goto_angle (PG_A_DEG (90));
+ return ai_next (UNLOAD_FACE_BIN_UNBLOCK, bot_move_failed);
+}
+
+/*
* UNLOAD_BACK_BIN =bot_move_succeed=>
* => UNLOAD_UNLOAD
* unload