summaryrefslogtreecommitdiff
path: root/digital/io/src/ai_top_cb.c
diff options
context:
space:
mode:
authorNicolas Schodet2010-04-13 00:21:48 +0200
committerNicolas Schodet2010-04-13 00:21:48 +0200
commitd7211fc08b077030cf7f065d3834e201d17c18a5 (patch)
tree0457b37b689c130c09304474e00dad0a7e37a3cc /digital/io/src/ai_top_cb.c
parentdad456971807158e350baa84c2c24dee1a9c69bd (diff)
digital/io/src: refactor position and angle macros
Diffstat (limited to 'digital/io/src/ai_top_cb.c')
-rw-r--r--digital/io/src/ai_top_cb.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/digital/io/src/ai_top_cb.c b/digital/io/src/ai_top_cb.c
index 91937ad2..60f2c148 100644
--- a/digital/io/src/ai_top_cb.c
+++ b/digital/io/src/ai_top_cb.c
@@ -58,10 +58,7 @@ ai__IDLE__start (void)
fsm_branch_t
ai__WAIT_INIT_TO_FINISH__init_match_is_started (void)
{
- position_t pos;
- pos.v.x = PG_X_VALUE_COMPUTING (2000);
- pos.v.y = 1000;
- pos.a = PG_A_VALUE_COMPUTING (0);
+ position_t pos = PG_POSITION_DEG (2000, 1000, 0);
move_start (pos, 0);
return ai_next (WAIT_INIT_TO_FINISH, init_match_is_started);
}
@@ -74,10 +71,7 @@ ai__WAIT_INIT_TO_FINISH__init_match_is_started (void)
fsm_branch_t
ai__GO_FAR__move_fsm_succeed (void)
{
- position_t pos;
- pos.v.x = PG_X_VALUE_COMPUTING (1000);
- pos.v.y = 1000;
- pos.a = PG_A_VALUE_COMPUTING (0);
+ position_t pos = PG_POSITION_DEG (1000, 1000, 0);
move_start (pos, 0);
return ai_next (GO_FAR, move_fsm_succeed);
}
@@ -90,10 +84,7 @@ ai__GO_FAR__move_fsm_succeed (void)
fsm_branch_t
ai__GO_NEAR__move_fsm_succeed (void)
{
- position_t pos;
- pos.v.x = PG_X_VALUE_COMPUTING (2000);
- pos.v.y = 1000;
- pos.a = PG_A_VALUE_COMPUTING (0);
+ position_t pos = PG_POSITION_DEG (2000, 1000, 0);
move_start (pos, 0);
return ai_next (GO_NEAR, move_fsm_succeed);
}