replace math.degrees to np.rad2deg

This commit is contained in:
Atsushi Sakai
2018-10-24 18:30:52 +09:00
parent a164faa7f2
commit 97f0405ab7
10 changed files with 11 additions and 11 deletions

View File

@@ -436,7 +436,7 @@ def main():
plt.pause(0.001) plt.pause(0.001)
flg, ax = plt.subplots(1) flg, ax = plt.subplots(1)
plt.plot(t, [math.degrees(iyaw) for iyaw in yaw[:-1]], '-r') plt.plot(t, [np.rad2deg(iyaw) for iyaw in yaw[:-1]], '-r')
plt.xlabel("time[s]") plt.xlabel("time[s]")
plt.ylabel("Yaw[deg]") plt.ylabel("Yaw[deg]")
plt.grid(True) plt.grid(True)
@@ -455,7 +455,7 @@ def main():
plt.grid(True) plt.grid(True)
flg, ax = plt.subplots(1) flg, ax = plt.subplots(1)
plt.plot(t, [math.degrees(td) for td in d], '-r') plt.plot(t, [np.rad2deg(td) for td in d], '-r')
plt.xlabel("time[s]") plt.xlabel("time[s]")
plt.ylabel("Steering angle[deg]") plt.ylabel("Steering angle[deg]")
plt.grid(True) plt.grid(True)

View File

@@ -219,7 +219,7 @@ def main():
plt.legend() plt.legend()
flg, ax = plt.subplots(1) flg, ax = plt.subplots(1)
plt.plot(s, [math.degrees(iyaw) for iyaw in ryaw], "-r", label="yaw") plt.plot(s, [np.rad2deg(iyaw) for iyaw in ryaw], "-r", label="yaw")
plt.grid(True) plt.grid(True)
plt.legend() plt.legend()
plt.xlabel("line length[m]") plt.xlabel("line length[m]")

View File

@@ -37,7 +37,7 @@ def LSL(alpha, beta, d):
t = mod2pi(-alpha + tmp1) t = mod2pi(-alpha + tmp1)
p = math.sqrt(p_squared) p = math.sqrt(p_squared)
q = mod2pi(beta - tmp1) q = mod2pi(beta - tmp1)
# print(math.degrees(t), p, math.degrees(q)) # print(np.rad2deg(t), p, np.rad2deg(q))
return t, p, q, mode return t, p, q, mode

View File

@@ -219,7 +219,7 @@ def main():
plt.legend() plt.legend()
flg, ax = plt.subplots(1) flg, ax = plt.subplots(1)
plt.plot(s, [math.degrees(iyaw) for iyaw in ryaw], "-r", label="yaw") plt.plot(s, [np.rad2deg(iyaw) for iyaw in ryaw], "-r", label="yaw")
plt.grid(True) plt.grid(True)
plt.legend() plt.legend()
plt.xlabel("line length[m]") plt.xlabel("line length[m]")

View File

@@ -201,7 +201,7 @@ def main():
plt.plot(x, y, "-r") plt.plot(x, y, "-r")
plt.subplots() plt.subplots()
plt.plot(time, [math.degrees(i) for i in yaw], "-r") plt.plot(time, [np.rad2deg(i) for i in yaw], "-r")
plt.xlabel("Time[s]") plt.xlabel("Time[s]")
plt.ylabel("Yaw[deg]") plt.ylabel("Yaw[deg]")
plt.grid(True) plt.grid(True)

View File

@@ -38,7 +38,7 @@ def LSL(alpha, beta, d):
t = mod2pi(-alpha + tmp1) t = mod2pi(-alpha + tmp1)
p = math.sqrt(p_squared) p = math.sqrt(p_squared)
q = mod2pi(beta - tmp1) q = mod2pi(beta - tmp1)
# print(math.degrees(t), p, math.degrees(q)) # print(np.rad2deg(t), p, np.rad2deg(q))
return t, p, q, mode return t, p, q, mode

View File

@@ -33,7 +33,7 @@ def LSL(alpha, beta, d):
t = mod2pi(-alpha + tmp1) t = mod2pi(-alpha + tmp1)
p = math.sqrt(p_squared) p = math.sqrt(p_squared)
q = mod2pi(beta - tmp1) q = mod2pi(beta - tmp1)
# print(math.degrees(t), p, math.degrees(q)) # print(np.rad2deg(t), p, np.rad2deg(q))
return t, p, q, mode return t, p, q, mode

View File

@@ -272,7 +272,7 @@ def main():
plt.legend() plt.legend()
flg, ax = plt.subplots(1) flg, ax = plt.subplots(1)
plt.plot(s, [math.degrees(iyaw) for iyaw in cyaw], "-r", label="yaw") plt.plot(s, [np.rad2deg(iyaw) for iyaw in cyaw], "-r", label="yaw")
plt.grid(True) plt.grid(True)
plt.legend() plt.legend()
plt.xlabel("line length[m]") plt.xlabel("line length[m]")

View File

@@ -271,7 +271,7 @@ def main():
plt.legend() plt.legend()
flg, ax = plt.subplots(1) flg, ax = plt.subplots(1)
plt.plot(s, [math.degrees(iyaw) for iyaw in cyaw], "-r", label="yaw") plt.plot(s, [np.rad2deg(iyaw) for iyaw in cyaw], "-r", label="yaw")
plt.grid(True) plt.grid(True)
plt.legend() plt.legend()
plt.xlabel("line length[m]") plt.xlabel("line length[m]")

View File

@@ -219,7 +219,7 @@ def main():
plt.legend() plt.legend()
flg, ax = plt.subplots(1) flg, ax = plt.subplots(1)
plt.plot(s, [math.degrees(iyaw) for iyaw in cyaw], "-r", label="yaw") plt.plot(s, [np.rad2deg(iyaw) for iyaw in cyaw], "-r", label="yaw")
plt.grid(True) plt.grid(True)
plt.legend() plt.legend()
plt.xlabel("line length[m]") plt.xlabel("line length[m]")