modify some unused utils such as log record
This commit is contained in:
@@ -1,18 +1,17 @@
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
import os
|
||||
|
||||
if __name__ == '__main__':
|
||||
file_path = "/home/lu/flightmare/flightmare/run/utils/dist.csv"
|
||||
temp = np.loadtxt(file_path, dtype=float, delimiter=",")
|
||||
file_path = "/home/lu/flightmare/flightmare/run/utils/dist_x.csv"
|
||||
tempX = np.loadtxt(file_path, dtype=float, delimiter=",")
|
||||
plt.plot(tempX, temp)
|
||||
file_path = os.environ["FLIGHTMARE_PATH"] + "/run/utils/dist_log.csv"
|
||||
dist_log = np.loadtxt(file_path, dtype=float, delimiter=",")
|
||||
plt.plot(dist_log[:, 0], dist_log[:, 2])
|
||||
plt.show()
|
||||
print("dist min:", np.min(temp))
|
||||
file_path = "/home/lu/flightmare/flightmare/run/utils/ctrl_log.csv"
|
||||
print("dist min:", np.min(dist_log[:, 2]))
|
||||
|
||||
file_path = os.environ["FLIGHTMARE_PATH"] + "/run/utils/ctrl_log.csv"
|
||||
ctrl_log = np.loadtxt(file_path, dtype=float, delimiter=",")
|
||||
v_total = np.sqrt(
|
||||
ctrl_log[:, 3] * ctrl_log[:, 3] + ctrl_log[:, 4] * ctrl_log[:, 4] + ctrl_log[:, 5] * ctrl_log[:, 5])
|
||||
v_total = np.sqrt(ctrl_log[:, 3] * ctrl_log[:, 3] + ctrl_log[:, 4] * ctrl_log[:, 4] + ctrl_log[:, 5] * ctrl_log[:, 5])
|
||||
print("v max: ", np.max(v_total))
|
||||
plt.plot(ctrl_log[:, 3], label='vx')
|
||||
plt.plot(ctrl_log[:, 4], label='vy')
|
||||
|
||||
Reference in New Issue
Block a user