Something went wrong. Try again.
My monorepo ansonbiggs.com
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970import matplotlib.pyplot as pltimport pandas as pd
plt.style.use("ggplot")
df = pd.read_csv("./public/simOut.csv")
# Accelerationplt.subplot(3, 1, 1)plt.title("Acceleration, Velocity, and Altitude Plots")plt.plot(df.t, df.az)# plt.title("Acceleration vs Time")plt.xlabel("Time (s)")plt.ylabel("Acceleration (m/s)")
# Velocityplt.subplot(3, 1, 2)plt.plot(df.t, df.vz)# plt.title("Velocity vs Time")plt.xlabel("Time (s)")plt.ylabel("Velocity (m/s)")
# Altitudeplt.subplot(3, 1, 3)plt.plot(df.t, df.z)# plt.title("Altitude vs Time")plt.xlabel("Time (s)")plt.ylabel("Altitude (m)")
plt.savefig("./public/AVA.png")
# Euler Anglesplt.figure(2)
plt.subplot(2, 1, 1)plt.title("Deflection and Angular Velocity Plots")plt.plot(df.t, df.yaw, label="Yaw")plt.plot(df.t, df.pitch, label="Pitch")plt.plot(df.t, df.roll, label="Roll")plt.ylabel("Euler Angles (deg)")plt.legend()
# Angular Velocityplt.subplot(2, 1, 2)plt.plot(df.t, df.yawdot, label="Yaw")plt.plot(df.t, df.pitchdot, label="Pitch")plt.plot(df.t, df.rolldot, label="Roll")plt.ylabel("Angular Velocity (deg/s)")plt.xlabel("Time (ms)")plt.legend()
plt.savefig("./public/Angles.png")
# Servo Positionsplt.figure(3)
plt.plot(df.t, df.Servo1, label="Servo1")plt.plot(df.t, df.Servo2, label="Servo2")plt.xlabel("Time (ms)")plt.ylabel("Position (rad)")plt.legend()plt.title("Servo Positions")
plt.savefig("./public/Servos.png")
plt.show()