imporve covergage ratio

This commit is contained in:
Atsushi Sakai
2019-02-10 20:52:17 +09:00
parent e156fe1e69
commit fa374c7477
20 changed files with 34 additions and 58 deletions

View File

@@ -131,15 +131,15 @@ def closed_loop_prediction(cx, cy, cyaw, speed_profile, goal):
a.append(ai)
d.append(di)
if target_ind % 1 == 0 and animation:
if target_ind % 1 == 0 and animation: # pragma: no cover
plt.cla()
plt.plot(cx, cy, "-r", label="course")
plt.plot(x, y, "ob", label="trajectory")
plt.plot(cx[target_ind], cy[target_ind], "xg", label="target")
plt.axis("equal")
plt.grid(True)
plt.title("speed:" + str(round(state.v, 2)) +
"tind:" + str(target_ind))
plt.title("speed:" + str(round(state.v, 2))
+ "tind:" + str(target_ind))
plt.pause(0.0001)
else:
@@ -196,7 +196,7 @@ def calc_speed_profile(cx, cy, cyaw, target_speed):
speed_profile, d = set_stop_point(target_speed, cx, cy, cyaw)
if animation:
if animation: # pragma: no cover
plt.plot(speed_profile, "xb")
return speed_profile
@@ -220,7 +220,7 @@ def extend_path(cx, cy, cyaw):
return cx, cy, cyaw
def main():
def main(): # pragma: no cover
# target course
cx = np.arange(0, 50, 0.1)
cy = [math.sin(ix / 5.0) * ix / 2.0 for ix in cx]
@@ -277,7 +277,7 @@ def main():
plt.axis("equal")
plt.grid(True)
subplots(1)
plt.subplots(1)
plt.plot(t, [iv * 3.6 for iv in v], "-r")
plt.xlabel("Time[s]")
plt.ylabel("Speed[km/h]")
@@ -285,7 +285,7 @@ def main():
plt.show()
def main2():
def main2(): # pragma: no cover
import pandas as pd
data = pd.read_csv("rrt_course.csv")
cx = np.array(data["x"])
@@ -321,7 +321,7 @@ def main2():
plt.show()
if __name__ == '__main__':
if __name__ == '__main__': # pragma: no cover
print("Pure pursuit path tracking simulation start")
# main()
main2()