]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/commitdiff
Fix plot labels and poses markers
authorJiri Hubacek <hubacji1@fel.cvut.cz>
Fri, 9 Nov 2018 13:43:34 +0000 (14:43 +0100)
committerJiri Hubacek <hubacji1@fel.cvut.cz>
Fri, 9 Nov 2018 14:03:14 +0000 (15:03 +0100)
plot.py

diff --git a/plot.py b/plot.py
index 43f75259fa1c0441ae60edb174be2f4a09a5ddb6..e7c04b69150ba998c7dd8d6bb9264905be8ba84a 100644 (file)
--- a/plot.py
+++ b/plot.py
@@ -139,9 +139,9 @@ if __name__ == "__main__":
     ## 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"]:
@@ -152,7 +152,7 @@ if __name__ == "__main__":
         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"]:
@@ -205,8 +205,10 @@ if __name__ == "__main__":
                                 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()
@@ -215,9 +217,9 @@ if __name__ == "__main__":
     ## 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"]:
@@ -227,8 +229,8 @@ if __name__ == "__main__":
             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"]:
@@ -281,8 +283,10 @@ if __name__ == "__main__":
                                 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()