From 6e20027eb8418ef632b581e7053609750c48671e Mon Sep 17 00:00:00 2001 From: Jiri Vlasak Date: Mon, 3 May 2021 16:49:10 +0200 Subject: [PATCH] Rewrite plot possible entry configurations --- scripts/plot_json_objects_scenario.py | 53 ++++++++++++++------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/scripts/plot_json_objects_scenario.py b/scripts/plot_json_objects_scenario.py index 6016e90..c1f7bdf 100644 --- a/scripts/plot_json_objects_scenario.py +++ b/scripts/plot_json_objects_scenario.py @@ -196,8 +196,9 @@ if __name__ == "__main__": ax.set_ylabel("y [m]") # For Possible Entry Points (Possible Entry Configurations) use: - #ax.set_xlim([35.6, 46.4]) - #ax.set_ylim([2.9, 2.9 + 6.84]) + #ax.set_xlim([37.6, 45.6]) + #ax.set_ylim([2.4, 8.0]) + #ax.set_title("Possible Entry Configurations") # For Last Maneuver use: #ax.set_xlim([38, 44]) @@ -265,6 +266,30 @@ if __name__ == "__main__": #for s in scenario["slot"]: # plt.plot(*plot_nodes(s), color="black") + # For the Possible Entry Configurations from the paper, use: + if False and "inits" in scenario: + max_i = len(scenario["inits"]) - 1 + ii = 0 + i = scenario["inits"][ii] + plt.plot(*plot_car(i), color="gray") + plt.plot(i[0] - MINX, i[1] - MINY, color="gray", marker="+", ms=12) + ii = int(max_i / 4) + i = scenario["inits"][ii] + plt.plot(*plot_car(i), color="gray") + plt.plot(i[0] - MINX, i[1] - MINY, color="gray", marker="+", ms=12) + ii = int(max_i / 2) + i = scenario["inits"][ii] + plt.plot(*plot_car(i), color="gray") + plt.plot(i[0] - MINX, i[1] - MINY, color="gray", marker="+", ms=12) + ii = int(max_i * 3/4) + i = scenario["inits"][ii] + plt.plot(*plot_car(i), color="gray") + plt.plot(i[0] - MINX, i[1] - MINY, color="gray", marker="+", ms=12) + ii = max_i + i = scenario["inits"][ii] + plt.plot(*plot_car(i), color="gray") + plt.plot(i[0] - MINX, i[1] - MINY, color="gray", marker="+", ms=12) + # Plot `init`, `entry`, and `goal` configurations. if "init" in scenario and len(scenario["init"]) == 3: plt.plot(*plot_car(scenario["init"]), color="red") @@ -369,30 +394,6 @@ if __name__ == "__main__": # ms=12 #) - # For the Possible Entry Configurations from the paper, use: - #if "inits" in scenario: - # #for i in scenario["inits"]: - # for j in range(0, len(scenario["inits"]), 110): - # i = scenario["inits"][j] - # print(i) - # if len(i) == 3: - # plt.plot(*plot_car(i), color="gray") - # plt.plot( - # i[0] - MINX, - # i[1] - MINY, - # color="gray", - # marker="+", - # ms=12, - # ) - # #plt.plot(*plot_car(scenario["inits"][0]), color="magenta") - # #plt.plot( - # # scenario["inits"][0][0] - MINX, - # # scenario["inits"][0][1] - MINY, - # # color="magenta", - # # marker="+", - # # ms=12, - # #) - # Plot `path` and `max_path`. if sc2 and "path" in sc2 and len(sc2["path"]) > 0: plt.plot(*plot_nodes(sc2["path"]), color="orange") -- 2.39.2