1 from FlightGear import FlightGear
5 fg = FlightGear('localhost', 5500)
7 # Wait five seconds for simulator to settle down
8 while fg['/sim/time/elapsed-ms'] < 5000:
12 fg['/controls/parking-brake'] = 1
14 heading = fg['/orientation/heading-deg']
16 # Switch to external view for for 'walk around'.
19 fg['/sim/current-view/goal-heading-offset-deg'] = 180.0
20 fg.wait_for_prop_eq('/sim/current-view/heading-offset-deg', 180.0)
22 fg['/sim/current-view/goal-heading-offset-deg'] = 90.0
23 fg.wait_for_prop_eq('/sim/current-view/heading-offset-deg', 90.0)
25 fg['/sim/current-view/goal-heading-offset-deg'] = 0.0
26 fg.wait_for_prop_eq('/sim/current-view/heading-offset-deg', 0.0)
30 # Switch back to cockpit view
35 # Flaps to take off position
36 fg['/controls/flaps'] = 0.34
37 fg.wait_for_prop_eq('/surface-positions/flap-pos-norm', 0.34)
41 if __name__ == '__main__':