mirror of
https://github.com/apirrone/Open_Duck_Mini_Runtime.git
synced 2025-09-03 03:33:54 +00:00
plot recorded data
This commit is contained in:
parent
087bb271cd
commit
0bcc715b9f
1 changed files with 34 additions and 0 deletions
34
scripts/plot_recorded_data.py
Normal file
34
scripts/plot_recorded_data.py
Normal file
|
@ -0,0 +1,34 @@
|
|||
import pickle
|
||||
import argparse
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-f", "--file", type=str, required=True)
|
||||
args = parser.parse_args()
|
||||
|
||||
data = pickle.load(open(args.file, "rb"))
|
||||
|
||||
|
||||
plt.figure()
|
||||
|
||||
plt.subplot(4, 1, 1)
|
||||
plt.plot(data["times"], data["positions"], label="positions (rad)")
|
||||
plt.plot(data["times"], data["goal_positions"], label="goal_positions (rad)")
|
||||
plt.legend()
|
||||
|
||||
plt.subplot(4, 1, 2)
|
||||
plt.plot(data["times"], data["speeds"], label="speed (rad/s)")
|
||||
plt.legend()
|
||||
|
||||
plt.subplot(4, 1, 3)
|
||||
plt.plot(data["times"], data["loads"], label="load")
|
||||
plt.legend()
|
||||
|
||||
plt.subplot(4, 1, 4)
|
||||
plt.plot(data["times"], data["currents"], label="current (mA)")
|
||||
plt.legend()
|
||||
|
||||
plt.suptitle(f"Acceleration: {data['acceleration']}, KP: {data['kp']}, KD: {data['kd']}")
|
||||
plt.tight_layout()
|
||||
|
||||
plt.show()
|
Loading…
Reference in a new issue