Lab 2. Manual control of object moving (1 week lab)

advertisement
Lab 2. Manual control of object moving (1 week lab)
A.G.Chefranov, 25.03.2004, Comp. Eng. Dept., EMU, Gazimagusa
In this Lab you are to write a program providing output of graphical image of cart with
inverted pendulum similar to Fig. (don’t not show l,y,u,  , sizes, directions, axes)
Lab Task:
Write a program which will
1. Provide graphical output of cart with inverted pendulum on the screen
2. Provide interface allowing user to move cart with pendulum as a whole rightwards and
leftwards (keys Right-Arrow, Left-Arrow, respectively), and rotate pendulum without
move of cart (Up-Arrow, Down-Arrow, respectively; clockwise or counter-clockwise
direction of descending from vertical position should be made by random choice).
3. Each key-stroke should lead to 1-step modification of current state (for example, 1 click
on Left-Arrow button will move cart by 5 pixels leftward – if step is 5 pixels; 1 click on
Up-Arrow button should rise pendulum by angle of 50 – if step is 50)
Defense of Lab:
1. Show and explain program
2. Submit printed report with title, task description(0.5-1 page), description of your
algorithm (1-2 pages), program description (1-2 pages), appendix with sources
3. Time for defense – 1.04.2004, 8.30-10.00, CMPE-238.
Download