## 1st subplot
ax = fig.add_subplot(121)
ax.set_aspect("equal")
- ax.set_title("RRT* final path")
- ax.set_xlabel("Longitudinal direction [m]")
- ax.set_ylabel("Lateral direction [m]")
+ ax.set_title("Final path")
+ ax.set_xlabel("x [m]")
+ ax.set_ylabel("y [m]")
# plot here
for o in s["obst"]:
try:
ax.add_artist(plt.Circle((o["circle"][0], o["circle"][1]),
o["circle"][2],
- color="black", fill=False))
+ color="black", fill=False, hatch="/"))
except:
pass
if PLOT["node"]:
label=t["cost"][traj])
except:
print("No trajectory")
- plt.plot(*plot_nodes([s["init"]]), color=COLOR["start"], marker=".")
- plt.plot(*plot_nodes([s["goal"]]), color=COLOR["goal"], marker=".")
+ plt.plot(*car_frame(s["init"]), color="red", lw=2)
+ plt.plot(*car_frame(s["goal"]), color="red", lw=2)
+ plt.plot(*plot_nodes([s["init"]]), color="red", marker="+", ms=12)
+ plt.plot(*plot_nodes([s["goal"]]), color="red", marker="+", ms=12)
# end plot here
handles, labels = ax.get_legend_handles_labels()
## 2nd subplot
ax = fig.add_subplot(122)
ax.set_aspect("equal")
- ax.set_title("RRT* all edges")
- ax.set_xlabel("Longitudinal direction [m]")
- ax.set_ylabel("Lateral direction [m]")
+ ax.set_title("All edges")
+ ax.set_xlabel("x [m]")
+ ax.set_ylabel("y [m]")
# plot here
for o in s["obst"]:
pass
try:
ax.add_artist(plt.Circle((o["circle"][0], o["circle"][1]),
- o["circle"][2],
- color="black", fill=False))
+ o["circle"][2],
+ color="black", fill=False))
except:
pass
if PLOT["node"]:
label=t["cost"][traj])
except:
print("No trajectory")
- plt.plot(*plot_nodes([s["init"]]), color=COLOR["start"], marker=".")
- plt.plot(*plot_nodes([s["goal"]]), color=COLOR["goal"], marker=".")
+ plt.plot(*car_frame(s["init"]), color="red", lw=2)
+ plt.plot(*car_frame(s["goal"]), color="red", lw=2)
+ plt.plot(*plot_nodes([s["init"]]), color="red", marker="+", ms=12)
+ plt.plot(*plot_nodes([s["goal"]]), color="red", marker="+", ms=12)
# end plot here
handles, labels = ax.get_legend_handles_labels()