summaryrefslogtreecommitdiffhomepage
path: root/digital/io/src/move.fsm
blob: 5e2f877bb0d14f8d589f97c39077b20a3f502931 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#Move FSM.
move

States:
 IDLE
 DESIRED_POSITION
 MOVE_ON_LEFT
 MOVE_ON_RIGHT

Events:
 start
 reached
 blocked

IDLE:
 start -> DESIRED_POSITION
  Tries to reach a position provided by the user. If the position desired can not be reached, it all try to move on the right or the left.

DESIRED_POSITION:
 reached -> IDLE
  The position provided by the user has been reached, the FSM can stop.
 blocked:near_left_border -> MOVE_ON_RIGHT
  The robot will compute the position from the border and will take the decision to go on the right because the left border is too near.
 blocked:near_right_border -> MOVE_ON_LEFT
  The robot will compute the position from the border and will take the decision to go on the left because the right border is too near.

MOVE_ON_LEFT:
 reached -> DESIRED_POSITION
  The position has been reached. It will now try to reach the position provided by the user.
 blocked -> MOVE_ON_RIGHT
  The robot will try to go on the left because the previous movement block 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.
 blocked -> MOVE_ON_LEFT
  The robot will try to go on the left because the previous movement block on the left.