|
@@ -30,7 +30,7 @@ button.rect_transform.position = (0, 0)
|
30
|
30
|
# Set up a stream to monitor the throttle button
|
31
|
31
|
button_clicked = conn.add_stream(getattr, button, 'clicked')
|
32
|
32
|
f = open(datafile, 'w')
|
33
|
|
-f.write('timepoint, current_altitude, v_speed, h_speed, mass, fuel, available_thrust\n')
|
|
33
|
+f.write('timepoint, current_altitude, v_speed, h_speed, mass, fuel, available_thrust, current_thrust, g_force\n')
|
34
|
34
|
timepoint = 0
|
35
|
35
|
|
36
|
36
|
vessel = conn.space_center.active_vessel
|
|
@@ -44,9 +44,14 @@ while button_clicked() == False:
|
44
|
44
|
current_altitude = vessel.flight(r_frame).surface_altitude
|
45
|
45
|
v_speed = vessel.flight(r_frame).vertical_speed
|
46
|
46
|
h_speed = vessel.flight(r_frame).horizontal_speed
|
47
|
|
- f.write('{0}, {1}, {2}, {3}, {4}, {5}, {6}\n'.format(timepoint,
|
48
|
|
- current_altitude,
|
49
|
|
- v_speed, h_speed, vm, vm - dry_mass, at))
|
|
47
|
+ c_thrust = vessel.thrust
|
|
48
|
+ g_force = vessel.flight(r_frame).g_force
|
|
49
|
+ f.write('{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}\n'.format(timepoint,
|
|
50
|
+ current_altitude,
|
|
51
|
+ v_speed, h_speed,
|
|
52
|
+ vm, vm -
|
|
53
|
+ dry_mass, at,
|
|
54
|
+ c_thrust, g_force))
|
50
|
55
|
timepoint = timepoint + 1
|
51
|
56
|
time.sleep(0.1)
|
52
|
57
|
|