GMU:StateMachine: Difference between revisions

From Medien Wiki
No edit summary
Line 48: Line 48:
- a list that includes every situation (state) in connection to one specific action (output) that is carried out as soon as the corresponding state arrives
- a list that includes every situation (state) in connection to one specific action (output) that is carried out as soon as the corresponding state arrives
—> looking for food / move around, eating / stop, ..
—> looking for food / move around, eating / stop, ..
==Example: developing the control mechanism of an autonomous vacuum cleaner==
All of the above will become much clearer if we look at an practical example of an autonomous vacuum cleaner robot.
Step by step we will think of everything the robot has to do, put it in the right order and draw an appropriate diagram.
1) Turned on
The robot stands still and waits for further instructions.
It is now in standby mode.
—— BILD ——
2) „On / Off“ - button pushed
The robot starts to clean the room.
It moves forward and activates the air pump.
— BILD —
3) Approaching a wall
The robot would bump into the next wall if it would only be able to move forward.
It therefore needs a function that recognizes walls and makes the robot turn around.
— BILD —
4) Turning around
So far the robot turns randomly in any direction.
We have to define a parameter that tells the robot if it turned enough in order to continue cleaning.
This parameter can be a time delay, a certain amount of wheel revolutions or the value of a (distance, ..) sensor.
— BILD —
5) Turned off
The final missing part is the off-button.
— BILD —