Skip to content

Commit eb7f733

Browse files
AlexKlimajdagar
authored andcommitted
Remove thrust from altitude graph. Check if there is a valid altitude setpoint before plotting.
1 parent 0c8589c commit eb7f733

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

app/plot_app/configured_plots.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,13 @@ def generate_plots(ulog, px4_ulog, db_data, vehicle_data, link_to_3d_page,
194194
data_plot.add_graph(['baro_alt_meter'], colors8[1:2], ['Barometer Altitude'])
195195
data_plot.change_dataset('vehicle_global_position')
196196
data_plot.add_graph(['alt'], colors8[2:3], ['Fused Altitude Estimation'])
197+
# If there is no altitude setpoint and we don't check, the Y axis always starts at 0.
197198
data_plot.change_dataset('position_setpoint_triplet')
198-
data_plot.add_circle(['current.alt'], [plot_config['mission_setpoint_color']],
199-
['Altitude Setpoint'])
200-
data_plot.change_dataset(actuator_controls_0.thrust_sp_topic)
201-
if actuator_controls_0.thrust_z_neg is not None:
202-
data_plot.add_graph([lambda data: ('thrust', actuator_controls_0.thrust_z_neg*100)],
203-
colors8[6:7], ['Thrust [0, 100]'])
199+
if 'position_setpoint_triplet' in data and 'current' in data['position_setpoint_triplet']:
200+
current = data['position_setpoint_triplet']['current']
201+
if 'alt' in current and current['alt'] is not None:
202+
data_plot.add_circle(['current.alt'], [plot_config['mission_setpoint_color']],
203+
['Altitude Setpoint'])
204204
plot_flight_modes_background(data_plot, flight_mode_changes, vtol_states)
205205

206206
if data_plot.finalize() is not None: plots.append(data_plot)

0 commit comments

Comments
 (0)