summaryrefslogtreecommitdiffhomepage
path: root/digital/io/src/init.fsm
diff options
context:
space:
mode:
authorJérémy Dufour2009-05-16 21:02:59 +0200
committerJérémy Dufour2009-05-16 21:02:59 +0200
commit6fe853aa2498e51142c4e6d799f9951a41c456d3 (patch)
tree1728e8ece583a4f6d2c4e9092617208b85f9d481 /digital/io/src/init.fsm
parent3860bdf2741dd36ce395c80f4ea28c0257814e83 (diff)
* digital/io/src:
- use timeout in init FSM rather than using main and a timer, - use the macro to compute angle and Y position by using the color contact, - use relative rotation rather than absolute, - set position before last rotation, - do some cleaning.
Diffstat (limited to 'digital/io/src/init.fsm')
-rw-r--r--digital/io/src/init.fsm14
1 files changed, 6 insertions, 8 deletions
diff --git a/digital/io/src/init.fsm b/digital/io/src/init.fsm
index fda5247a..8b9aa4dc 100644
--- a/digital/io/src/init.fsm
+++ b/digital/io/src/init.fsm
@@ -9,7 +9,7 @@ States:
waiting for the beginning of the top FSM
WAIT_JACK_IN
waiting for the jack to be inserted into the bot
- WAIT_2_SEC
+ WAIT_2_SEC [timeout=450]
waiting for operator's hand not on jack anymore
GOTO_THE_WALL
go to the wall for the first time
@@ -31,8 +31,6 @@ Events:
initialize the FSM
jack_inserted_into_bot
the jack is inserted into the bot
- init_tempo_ended
- the tempo is finished
move_done
the move is finished
state_timeout
@@ -46,7 +44,7 @@ WAIT_JACK_IN:
wait for the operator hand disappears
WAIT_2_SEC:
- init_tempo_ended -> GOTO_THE_WALL
+ state_timeout -> GOTO_THE_WALL
go to the first wall
GOTO_THE_WALL:
@@ -66,9 +64,9 @@ GOTO_THE_WALL_AGAIN:
go backward for INIT_DIST millimeters again
GO_BACKWARD_AGAIN:
- move_done -> TURN_180_DEGREES_CCW
- turn bot for 180 degrees counterclockwise
-
-TURN_180_DEGREES_CCW:
move_done -> SET_POSITION
set real position to asserv
+
+SET_POSITION:
+ move_done -> TURN_90_DEGREES_CCW
+ turn bot for 180 degrees counterclockwise