1 from FlightGear import FlightGear
5 fg = FlightGear('localhost', 5500)
7 # Wait five seconds for simulator to settle down
9 if fg['/sim/time/elapsed-sec'] > 5:
12 print fg['/sim/time/elapsed-sec']
16 fg['/controls/parking-brake'] = 1
18 heading = fg['/orientation/heading-deg']
20 # Switch to external view for for 'walk around'.
23 fg['/sim/current-view/goal-heading-offset-deg'] = 180.0
24 #fg.wait_for_prop_eq('/sim/current-view/heading-offset-deg', 180.0)
26 fg['/sim/current-view/goal-heading-offset-deg'] = 90.0
27 #fg.wait_for_prop_eq('/sim/current-view/heading-offset-deg', 90.0)
29 fg['/sim/current-view/goal-heading-offset-deg'] = 0.0
30 #fg.wait_for_prop_eq('/sim/current-view/heading-offset-deg', 0.0)
34 # Switch back to cockpit view
39 # Flaps to take off position
40 fg['/controls/flaps'] = 0.34
41 #fg.wait_for_prop_eq('/surface-positions/flap-pos-norm', 0.34)
45 if __name__ == '__main__':