mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-04-22 03:00:22 -04:00
replace math.degrees to np.rad2deg
This commit is contained in:
@@ -436,7 +436,7 @@ def main():
|
||||
plt.pause(0.001)
|
||||
|
||||
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.ylabel("Yaw[deg]")
|
||||
plt.grid(True)
|
||||
@@ -455,7 +455,7 @@ def main():
|
||||
plt.grid(True)
|
||||
|
||||
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.ylabel("Steering angle[deg]")
|
||||
plt.grid(True)
|
||||
|
||||
@@ -219,7 +219,7 @@ def main():
|
||||
plt.legend()
|
||||
|
||||
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.legend()
|
||||
plt.xlabel("line length[m]")
|
||||
|
||||
@@ -37,7 +37,7 @@ def LSL(alpha, beta, d):
|
||||
t = mod2pi(-alpha + tmp1)
|
||||
p = math.sqrt(p_squared)
|
||||
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
|
||||
|
||||
|
||||
@@ -219,7 +219,7 @@ def main():
|
||||
plt.legend()
|
||||
|
||||
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.legend()
|
||||
plt.xlabel("line length[m]")
|
||||
|
||||
@@ -201,7 +201,7 @@ def main():
|
||||
plt.plot(x, y, "-r")
|
||||
|
||||
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.ylabel("Yaw[deg]")
|
||||
plt.grid(True)
|
||||
|
||||
@@ -38,7 +38,7 @@ def LSL(alpha, beta, d):
|
||||
t = mod2pi(-alpha + tmp1)
|
||||
p = math.sqrt(p_squared)
|
||||
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
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ def LSL(alpha, beta, d):
|
||||
t = mod2pi(-alpha + tmp1)
|
||||
p = math.sqrt(p_squared)
|
||||
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
|
||||
|
||||
|
||||
@@ -272,7 +272,7 @@ def main():
|
||||
plt.legend()
|
||||
|
||||
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.legend()
|
||||
plt.xlabel("line length[m]")
|
||||
|
||||
@@ -271,7 +271,7 @@ def main():
|
||||
plt.legend()
|
||||
|
||||
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.legend()
|
||||
plt.xlabel("line length[m]")
|
||||
|
||||
@@ -219,7 +219,7 @@ def main():
|
||||
plt.legend()
|
||||
|
||||
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.legend()
|
||||
plt.xlabel("line length[m]")
|
||||
|
||||
Reference in New Issue
Block a user