Skip to content

Commit

Permalink
Plot motor rpm seperately.
Browse files Browse the repository at this point in the history
  • Loading branch information
moorepants committed Jul 28, 2023
1 parent c9838dd commit d0e7603
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions scripts/plot_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,19 @@ def plot(csvfile):

df = pd.read_csv(csvfile, index_col='time', sep=";")

fig, axes = plt.subplots(5, 1, sharex=True)
fig, axes = plt.subplots(6, 1, sharex=True)

df[['ay', 'az']].plot(ax=axes[0])

if 'wm' in df.columns:
df[['wx', 'wm']].apply(np.rad2deg).plot(ax=axes[1])
else:
df['wx'].apply(np.rad2deg).plot(ax=axes[1])
df['wx'].apply(np.rad2deg).plot(ax=axes[1])

df[['theta_a', 'theta_af']].apply(np.rad2deg).plot(ax=axes[2])

df[['theta_g', 'theta_gf']].apply(np.rad2deg).plot(ax=axes[3])

df['theta'].apply(np.rad2deg).plot(ax=axes[4])
df[['theta']].apply(np.rad2deg).plot(ax=axes[4])

df[['wm']].apply(lambda radps: radps*60.0/2.0/np.pi).plot(ax=axes[5])

return axes

Expand Down

0 comments on commit d0e7603

Please sign in to comment.