summaryrefslogtreecommitdiffhomepage
path: root/digital/io/src
diff options
context:
space:
mode:
authorNélio Laranjeiro2008-04-22 12:49:26 +0200
committerNélio Laranjeiro2008-04-22 12:49:26 +0200
commitc274ba5eb538cbca4978d3232474add42d788ec2 (patch)
tree305d29679f3f41b803919405ff9db4a04a9ff6ff /digital/io/src
parent16391322854166204fdfb7748877884b21f33d64 (diff)
move.fsm: add an event to compute the position of the robot and take the
decision to go on the left or on the right.
Diffstat (limited to 'digital/io/src')
-rw-r--r--digital/io/src/move.fsm30
1 files changed, 13 insertions, 17 deletions
diff --git a/digital/io/src/move.fsm b/digital/io/src/move.fsm
index 8feb3bcf..1608c594 100644
--- a/digital/io/src/move.fsm
+++ b/digital/io/src/move.fsm
@@ -4,13 +4,13 @@ move
States:
IDLE
DESIRED_POSITION
+ COMPUTE_POS
MOVE_ON_LEFT
MOVE_ON_RIGHT
Events:
start
reached
- failed
blocked
near_left_border
near_right_border
@@ -22,27 +22,23 @@ IDLE:
DESIRED_POSITION:
reached -> IDLE
The position provided by the user has been reached, the FSM can stop.
- failed: near_right_border -> MOVE_ON_LEFT
- The robot has failed to reach the position. It shall try another position before trying to reach this one again. It shall go to the on the left only if the left border is the farest one.
- failed: near_left_border -> MOVE_ON_RIGHT
- The robot has failed to reach the position. It shall try another position before trying to reach this one again. It shall go to the on the right only if the right border is the farest one.
- blocked: near_left_border -> MOVE_ON_RIGHT
- The robot has failed to reach the position. It shall try another position before trying to reach this one again. It shall go to the on the right only if the right border is the farest one.
- blocked: near_right_border -> MOVE_ON_LEFT
- The robot has failed to reach the position. It shall try another position before trying to reach this one again. It shall go to the on the left only if the left border is the farest one.
+ blocked -> COMPUTE_POS
+ The robot will compute the position from the border and will take the decision to go on the left or on the right.
MOVE_ON_LEFT:
reached -> DESIRED_POSITION
The position has been reached. It will now try to reach the position provided by the user.
- failed -> MOVE_ON_RIGHT
- The position is fail again, it will try to reach another one.
- blocked -> MOVE_ON_RIGHT
- The position is fail again, it will go backward to reach another one.
+ blocked -> COMPUTE_POS
+ The robot will compute the position from the border and will take the decision to go on the left or on the right.
MOVE_ON_RIGHT:
reached -> DESIRED_POSITION
The position has been reached. It will now try to reach the position provided by the user.
- failed -> MOVE_ON_LEFT
- The position is fail again, it will try to reach another one.
- blocked -> MOVE_ON_LEFT
- The position is fail again, it will go backward to reach another one.
+ blocked -> COMPUTE_POS
+ The robot will compute the position from the border and will take the decision to go on the left or on the right.
+
+COMPUTE_POS:
+ near_left_border -> MOVE_ON_RIGHT
+ The robot is near the left border it shall try to move on the right.
+ near_right_border -> MOVE_ON_LEFT
+ The robot is near the right border it shall try to move on the left.