Skip to content

Commit

Permalink
Added amps to plot.
Browse files Browse the repository at this point in the history
  • Loading branch information
moorepants committed Jul 28, 2023
1 parent d0e7603 commit 6363cab
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/plot_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,17 @@ def plot(csvfile):
theta_af : low pass filtered accelerometer angle [rad]
theta_gf : band pass filtered gyroscope angle [rad]
theta : complementary filtered roll angle estimate [rad]
i : command motor current [A]
"""

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

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

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

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])

Expand All @@ -53,6 +54,8 @@ def plot(csvfile):

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

df[['i']].plot(ax=axes[6])

return axes


Expand Down

0 comments on commit 6363cab

Please sign in to comment.