-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtakeoff.py
More file actions
32 lines (28 loc) · 722 Bytes
/
takeoff.py
File metadata and controls
32 lines (28 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
Start up and take off from simulator reset
"""
from fgclient import FgClient
c = FgClient()
c.set_prop('/controls/engines/engine/magnetos',3)
c.set_prop('/controls/engines/engine/throttle',0.75)
c.set_prop('/controls/gear/brake-parking',0)
c.set_prop('/sim/hud/visibility[0]',1)
c.set_aileron(0.0)
c.set_elevator(0.0)
c.set_prop('/controls/engines/engine/starter',1)
for kk in range(30):
c.tic()
sp = c.get_prop_float('/velocities/airspeed-kt')
print(sp)
if sp>50:
c.set_elevator(-0.1)
c.toc(1.0)
for kk in range(30):
c.tic()
alt = c.altitude_ft()
print(alt)
if alt>200:
c.set_elevator(0.0)
c.ap_roll_hdg(180)
c.ap_pitch_vs(10)
c.toc(1.0)