Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attitude plots: don't mark NaNs in the setpoint for fixed-wing #140

Merged
merged 1 commit into from
Nov 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions plot_app/configured_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def generate_plots(ulog, px4_ulog, db_data, vehicle_data, link_to_3d_page):
# initialize flight mode changes
flight_mode_changes = get_flight_mode_changes(ulog)

# VTOL state changes
# VTOL state changes & vehicle type
is_multicopter = False # this is False for VTOLs as well
vtol_states = None
try:
cur_dataset = ulog.get_dataset('vehicle_status')
Expand All @@ -57,6 +58,8 @@ def generate_plots(ulog, px4_ulog, db_data, vehicle_data, link_to_3d_page):
idx = np.argmax(cur_dataset.data['timestamp'] >= t) + 1
vtol_states[i] = (t, 2 + cur_dataset.data['is_rotary_wing'][idx])
vtol_states.append((ulog.last_timestamp, -1))
elif np.amax(cur_dataset.data['is_rotary_wing']) == 1:
is_multicopter = True
except (KeyError, IndexError) as error:
vtol_states = None

Expand Down Expand Up @@ -188,9 +191,10 @@ def generate_plots(ulog, px4_ulog, db_data, vehicle_data, link_to_3d_page):
data_plot.add_graph([lambda data: (axis, np.rad2deg(data[axis]))],
colors3[0:1], [axis_name+' Estimated'], mark_nan=True)
data_plot.change_dataset('vehicle_attitude_setpoint')
# in fixed-wing, the attitude setpoint is allowed to be NaN
data_plot.add_graph([lambda data: (axis+'_d', np.rad2deg(data[axis+'_d']))],
colors3[1:2], [axis_name+' Setpoint'],
mark_nan=True, use_step_lines=True)
mark_nan=is_multicopter, use_step_lines=True)
if axis == 'yaw':
data_plot.add_graph(
[lambda data: ('yaw_sp_move_rate', np.rad2deg(data['yaw_sp_move_rate']))],
Expand Down