<jupyter_start><jupyter_text>Polygon Environment BuildingDevising scenarios for the polygon-based environments.<jupyter_code>%load_ext autoreload
%autoreload 2
from mpb import MPB, MultipleMPB
from plot_stats import plot_planner_stats, plot_smoother_stats
from utils import latexify
from table import latex_table
from definitions import *
import matplotlib as mpl
import sys, os
mpl.rcParams['mathtext.fontset'] = 'cm'
# make sure to not use Level-3 fonts
mpl.rcParams['pdf.fonttype'] = 42
import matplotlib.pyplot as plt
from copy import deepcopy
%config InlineBackend.figure_format='retina'<jupyter_output><empty_output><jupyter_text>Polygon Environments<jupyter_code>def visualize(scenario: str, start: {str: float}, goal: {str: float}, robot_model: str = None):
    m = MPB()
    m["max_planning_time"] = 60
    m["env.start"] = start
    m["env.goal"] = goal
    m["env.type"] = "polygon"
    m["env.polygon.source"] = "polygon_mazes/%s.svg" % scenario
    if robot_model:
        print("Using robot model %s." % robot_model)
        m["env.collision.robot_shape_source"] = robot_model
    m.set_planners(['informed_rrt_star'])
    m.set_planners(['bfmt'])
    m["steer.car_turning_radius"] = 2
#     m.set_planners(["sbpl_mha"])
    m["sbpl.scaling"] = 1
    if m.run(id="test_%s" % scenario, runs=1) == 0:
        m.visualize_trajectories(draw_start_goal_thetas=True, plot_every_nth_polygon=10, silence=True, save_file="plots/%s.pdf" % scenario)
        m.print_info()
    
# visualize("parking2",
#           {"theta": -1.57, "x": 12.3, "y": -2.73},
#           {"theta": 0, "x": 2.5, "y": -7.27})
# visualize("parking2",
#           {"theta": -1.57, "x": 12.3, "y": -2.73},
#           {"theta": 3.14, "x": 2.5, "y": -7.27})
scenarios = [
  ("parking1", {"theta": 0, "x": 2, "y": -7.27}, {"theta": -1.58, "x": 9, "y": -11.72}),
  ("parking2", {"theta": 0, "x": 2.5, "y": -7.27}, {"theta": -1.57, "x": 12, "y": -3}),
  ("parking3", {"theta": 0, "x": 3.82, "y": -13}, {"theta": 0, "x": 29, "y": -15.5}),
  ("warehouse", {"theta": -1.58, "x": 7.5, "y": -10}, {"theta": 1.58, "x": 76.5, "y": -10}, "polygon_mazes/warehouse_robot.svg"),
  ("warehouse2", {"theta": -1.58, "x": 7.5, "y": -10}, {"theta": -1.58, "x": 116, "y": -70}, "polygon_mazes/warehouse_robot.svg")
]

list(map(lambda x: visualize(*x), scenarios));<jupyter_output>Running MPB with ID test_parking1 (log file at test_parking1.log)...<jupyter_text>FigureheadFigure 1 to showcase Bench-MR.<jupyter_code>m = MPB()
scenario = "warehouse"
m["max_planning_time"] = 30
m["env.start"] = {"theta": -1.58, "x": 7.5, "y": -10}
m["env.goal"] = {"theta": 1.58, "x": 76.5, "y": -10}
m["env.type"] = "polygon"
m["env.polygon.source"] = "polygon_mazes/%s.svg" % scenario
m["env.collision.robot_shape_source"] = "polygon_mazes/warehouse_robot.svg"
m.set_planners([])
m.set_planners(['bfmt', 'cforest', 'prm', 'prm_star', 'informed_rrt_star', 'sbpl_mha'])
m["steer.car_turning_radius"] = 2
m["sbpl.scaling"] = 1
m.run(id="test_%s" % scenario, runs=1)    
m.print_info()
m.visualize_trajectories(ignore_planners='cforest, bfmt',
                         draw_start_goal_thetas=True,
                         plot_every_nth_polygon=8,
                         fig_width=8,
                         fig_height=8,
                         silence=True,
                         save_file="plots/%s.pdf" % scenario,
                         num_colors=10)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19632974075152929, 'fraction_numerical': 0.04223711039906787, 'mean_word_length': 3.5970548862115126, 'pattern_counts': {'":': 48, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '12254', 'license': 'Apache-2.0', 'n_tokens_mistral': 1441, 'n_tokens_neox': 1331, 'n_words': 273, 'path': 'python/Polygon Worlds Testing.ipynb', 'repo_name': 'pkicki/bench-mr', 'size': '3433'}