]> rtime.felk.cvut.cz Git - hubacji1/iamcar2.git/commitdiff
Reorder plot
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Wed, 14 Aug 2019 07:46:35 +0000 (09:46 +0200)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Fri, 23 Aug 2019 12:33:34 +0000 (14:33 +0200)
The order counts. Show obstacles first, then path and finally init and
goal.

scripts/plot_json_objects_scenario.py

index 5aff3ecd0f82bc008f5a86057d07269e9617d2ce..e68a4503bc4429fd76e60c69cd32d82b6523d085 100644 (file)
@@ -102,19 +102,19 @@ if __name__ == "__main__":
     ax.set_xlabel("x [m]")
     ax.set_ylabel("y [m]")
 
-    if "init" in scenario and len(scenario["init"]) == 3:
-        plt.plot(*plot_car(scenario["init"]), color="red")
-    if "goal" in scenario and len(scenario["goal"]) == 3:
-        plt.plot(*plot_car(scenario["goal"]), color="green")
-    if "slot" in scenario and len(scenario["slot"]) > 0:
-        for s in scenario["slot"]:
-            plt.plot(*plot_nodes(s), color="gray")
     if "obst" in scenario and  len(scenario["obst"]) > 0:
         for o in scenario["obst"]:
             plt.plot(*plot_nodes(o), color="blue")
     if "path" in scenario and  len(scenario["path"]) > 0:
         for n in scenario["path"]:
             plt.plot(*plot_car(n), color="orange")
+    if "slot" in scenario and len(scenario["slot"]) > 0:
+        for s in scenario["slot"]:
+            plt.plot(*plot_nodes(s), color="gray")
+    if "init" in scenario and len(scenario["init"]) == 3:
+        plt.plot(*plot_car(scenario["init"]), color="red")
+    if "goal" in scenario and len(scenario["goal"]) == 3:
+        plt.plot(*plot_car(scenario["goal"]), color="green")
     print("possible starts:")
     if "starts" in scenario and len(scenario["starts"]) > 0:
         for p in scenario["starts"]: