2002-05-15 21:45:39 +00:00
|
|
|
from FlightGear import FlightGear
|
|
|
|
import time
|
|
|
|
|
|
|
|
def main():
|
|
|
|
fg = FlightGear('localhost', 5500)
|
|
|
|
|
|
|
|
# Wait five seconds for simulator to settle down
|
2006-10-29 12:34:26 +00:00
|
|
|
while 1:
|
|
|
|
if fg['/sim/time/elapsed-sec'] > 5:
|
|
|
|
break
|
2002-05-15 21:45:39 +00:00
|
|
|
time.sleep(1.0)
|
2006-10-29 12:34:26 +00:00
|
|
|
print fg['/sim/time/elapsed-sec']
|
|
|
|
|
2002-05-15 21:45:39 +00:00
|
|
|
|
|
|
|
# parking brake on
|
|
|
|
fg['/controls/parking-brake'] = 1
|
|
|
|
|
|
|
|
heading = fg['/orientation/heading-deg']
|
|
|
|
|
|
|
|
# Switch to external view for for 'walk around'.
|
|
|
|
fg.view_next()
|
|
|
|
|
|
|
|
fg['/sim/current-view/goal-heading-offset-deg'] = 180.0
|
2006-10-29 12:34:26 +00:00
|
|
|
#fg.wait_for_prop_eq('/sim/current-view/heading-offset-deg', 180.0)
|
|
|
|
|
2002-05-15 21:45:39 +00:00
|
|
|
fg['/sim/current-view/goal-heading-offset-deg'] = 90.0
|
2006-10-29 12:34:26 +00:00
|
|
|
#fg.wait_for_prop_eq('/sim/current-view/heading-offset-deg', 90.0)
|
|
|
|
|
2002-05-15 21:45:39 +00:00
|
|
|
fg['/sim/current-view/goal-heading-offset-deg'] = 0.0
|
2006-10-29 12:34:26 +00:00
|
|
|
#fg.wait_for_prop_eq('/sim/current-view/heading-offset-deg', 0.0)
|
|
|
|
|
2002-05-15 21:45:39 +00:00
|
|
|
time.sleep(2.0)
|
|
|
|
|
|
|
|
# Switch back to cockpit view
|
|
|
|
fg.view_prev()
|
|
|
|
|
|
|
|
time.sleep(2.0)
|
|
|
|
|
|
|
|
# Flaps to take off position
|
|
|
|
fg['/controls/flaps'] = 0.34
|
2006-10-29 12:34:26 +00:00
|
|
|
#fg.wait_for_prop_eq('/surface-positions/flap-pos-norm', 0.34)
|
2002-05-15 21:45:39 +00:00
|
|
|
|
|
|
|
fg.quit()
|
2006-10-29 12:34:26 +00:00
|
|
|
|
2002-05-15 21:45:39 +00:00
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|