summaryrefslogtreecommitdiff
path: root/digital/io/src/ai_top_cb.c
diff options
context:
space:
mode:
authorNicolas Schodet2010-04-01 23:57:49 +0200
committerNicolas Schodet2010-04-01 23:57:49 +0200
commit00daa402978eb67ffcff2b6751425c26ce55c716 (patch)
tree23122389d51e5c4acebb03a09641b38d96e1e8e1 /digital/io/src/ai_top_cb.c
parent1259814c98dd4bf146138057b6d65569c2503855 (diff)
digital/io/src: add very basic top behaviour to test move FSM
Diffstat (limited to 'digital/io/src/ai_top_cb.c')
-rw-r--r--digital/io/src/ai_top_cb.c42
1 files changed, 40 insertions, 2 deletions
diff --git a/digital/io/src/ai_top_cb.c b/digital/io/src/ai_top_cb.c
index 5fbe703f..9c47e5ca 100644
--- a/digital/io/src/ai_top_cb.c
+++ b/digital/io/src/ai_top_cb.c
@@ -51,12 +51,50 @@ ai__IDLE__start (void)
/*
* WAIT_INIT_TO_FINISH =init_match_is_started=>
- * => WAIT_INIT_TO_FINISH
- * the match start, place something interresting here
+ * => GO_FAR
+ * the match start
+ * go to a far point
*/
fsm_branch_t
ai__WAIT_INIT_TO_FINISH__init_match_is_started (void)
{
+ asserv_position_t pos;
+ pos.x = PG_X_VALUE_COMPUTING (2000);
+ pos.y = 1000;
+ pos.a = PG_A_VALUE_COMPUTING (0);
+ move_start (pos, 0);
return ai_next (WAIT_INIT_TO_FINISH, init_match_is_started);
}
+/*
+ * GO_FAR =move_fsm_succeed=>
+ * => GO_NEAR
+ * go to a near point
+ */
+fsm_branch_t
+ai__GO_FAR__move_fsm_succeed (void)
+{
+ asserv_position_t pos;
+ pos.x = PG_X_VALUE_COMPUTING (1000);
+ pos.y = 1000;
+ pos.a = PG_A_VALUE_COMPUTING (0);
+ move_start (pos, 0);
+ return ai_next (GO_FAR, move_fsm_succeed);
+}
+
+/*
+ * GO_NEAR =move_fsm_succeed=>
+ * => GO_FAR
+ * restart
+ */
+fsm_branch_t
+ai__GO_NEAR__move_fsm_succeed (void)
+{
+ asserv_position_t pos;
+ pos.x = PG_X_VALUE_COMPUTING (2000);
+ pos.y = 1000;
+ pos.a = PG_A_VALUE_COMPUTING (0);
+ move_start (pos, 0);
+ return ai_next (GO_NEAR, move_fsm_succeed);
+}
+