Skip to content

Commit

Permalink
Trailing whitespece
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed May 23, 2024
1 parent 4dc05ff commit 3642248
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 4 additions & 2 deletions app/plot_app/configured_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ def generate_plots(ulog, px4_ulog, db_data, vehicle_data, link_to_3d_page,

# VTOL tailistter orientation conversion, if relevant
if is_vtol_tailsitter:
[tailsitter_attitude, tailsitter_rates, tailsitter_rates_setpoint] = tailsitter_orientation(ulog, vtol_states)
[tailsitter_attitude, tailsitter_rates, tailsitter_rates_setpoint] = tailsitter_orientation(
ulog, vtol_states)

# Roll/Pitch/Yaw angle & angular rate
for index, axis in enumerate(['roll', 'pitch', 'yaw']):
Expand Down Expand Up @@ -253,7 +254,8 @@ def generate_plots(ulog, px4_ulog, db_data, vehicle_data, link_to_3d_page,
np.rad2deg(tailsitter_rates[axis]))],
colors3[0:1], [axis_name+' Rate Estimated'], mark_nan=True)
data_plot.change_dataset('vehicle_rates_setpoint')
data_plot.add_graph([lambda data: (axis, np.rad2deg(tailsitter_rates_setpoint[axis]))],
data_plot.add_graph([lambda data: (axis, np.rad2deg(
tailsitter_rates_setpoint[axis]))],
colors3[1:2], [axis_name+' Rate Setpoint'],
mark_nan=True, use_step_lines=True)
else:
Expand Down
11 changes: 5 additions & 6 deletions app/plot_app/vtol_tailsitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def tailsitter_orientation(ulog, vtol_states):
w_y = cur_dataset.data['xyz[2]']
w_t = cur_dataset.data['timestamp']

#fw rates and setpoints(roll and yaw swap, roll is negative axis)
# fw rates and setpoints(roll and yaw swap, roll is negative axis)
w_r_fw = w_y*-1
w_y_fw = w_r*1 # *1 to get python to copy not reference
# temporary variables for storing VTOL states
Expand Down Expand Up @@ -113,19 +113,18 @@ def tailsitter_orientation(ulog, vtol_states):
except (KeyError, IndexError) as error:
vtol_rates = {'roll': None, 'pitch': None, 'yaw': None}
print("ERROR: Tailsitter rate ")


# correct rates setpoint for VTOL tailsitter in FW mode
try:

setp_dataset = ulog.get_dataset('vehicle_rates_setpoint')
setp_r = setp_dataset.data['roll']
setp_p = setp_dataset.data['pitch']
setp_y = setp_dataset.data['yaw']
w_t = setp_dataset.data['timestamp']

# fw setpoints(roll and yaw swap, roll is negative axis)

setp_r_fw = setp_y*-1
setp_y_fw = setp_r*1
# temporary variables for storing VTOL states
Expand All @@ -138,7 +137,7 @@ def tailsitter_orientation(ulog, vtol_states):
# states: 1=transition, 2=FW, 3=MC
# if in FW mode then used FW conversions
if is_vtol_fw:
fw_end = i[0]
fw_end = i[0]
setp_r[np.logical_and(w_t > fw_start, w_t < fw_end)] = \
setp_r_fw[np.logical_and(w_t > fw_start, w_t < fw_end)]
setp_y[np.logical_and(w_t > fw_start, w_t < fw_end)] = \
Expand Down

0 comments on commit 3642248

Please sign in to comment.