Helicopter flight and mission
Helicopter Flight Example
This example demonstrates the control of a toy helicopter. The mission here is to paint a wall with different colors. This can be considered as an analogy to a photography mission where a particular area as to be covered.
The requirements below were added incrementally, and b-threads were added to deal with each requirement. In the simulator - the painting of the wall is by drawing a line on the screen.
- The helicopter should go up and down along the wall.
- When the helicopter reaches the ceiling or the floor it should move to the right
- Every fixed number of pixels the paint color should be changed
- Since the line drawn by the helicopter is thin, after every small vertical move, the helicopter should move right and left with horizontal brush strokes, before moving vertically again.
- The helicopter may move from its present location due to wind.
- If the helicopter is moved by wind, it should return to its last known location.
In the integration with LSC, two more requirements were added
- The amount of paint is limited. After a certain number of points is painted - the paint runs out.
- When paint of a certain color runs out, this color can no longer be used.
- When all paint colors run out, the helicopter must stop.
- Paint cans may be re-filled. This is simulated by a user clicking on a button on the screen.