def run_tests():
    path = []
    path_name = gui.get_field(5)
    gp = importlib.import_module(path_name)
    # for steer_eta in [FT(0.1), FT(0.2), FT(0.3), FT(0.4), FT(0.5), FT(0.6), FT(0.7), FT(0.8), FT(0.9), FT(1.0), FT(1.1), FT(1.2), FT(1.3), FT(1.4), FT(1.5)]:
    #   for i in range(10):
    gp.generate_path(path, ps.robots, ps.obstacles, ps.destinations)
    # print("Generated path via", path_name + ".generate_path")


if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    gui = GUI()
    ps = Polygons_scene()
    gui.set_program_name("Multi-robot Motion Planning")
    gui.set_field(0, "data/scenes/scene3_very_hard_multi")
    # gui.set_field(0, "data/scenes/warehouse0")
    gui.set_field(3, "srm_drrt")
    gui.set_field(4, "path0.txt")
    gui.set_field(5, "run_tests")
    #gui.set_field(5, "path_out.txt")
    gui.set_logic(0, set_up_scene)
    gui.set_button_text(0, "Load scene")
    gui.set_logic(1, run_and_animate)
    gui.set_button_text(1, "run_and_animate")
    gui.set_logic(2, set_destinations)
    gui.set_button_text(2, "Set destinations")
    gui.set_logic(3, generate_path)
    gui.set_button_text(3, "Generate path")
    gui.set_logic(4, load_path)
Пример #2
0
def set_solution_field():
    s = getfile()
    if s:
        gui.set_field(1, s)


if __name__ == "__main__":
    instance = ""
    solution = ""
    if len(sys.argv) > 1:
        instance = sys.argv[1]
    if len(sys.argv) > 2:
        solution = sys.argv[2]
    app = QtWidgets.QApplication(sys.argv)
    gui = GUI()
    gui.set_program_name("CMP simulation")
    gui.set_logic(0, set_up_scene)
    gui.set_logic(1, run_simulation)
    gui.set_logic(2, set_scene_field)
    gui.set_logic(3, set_solution_field)
    gui.set_button_text(0, "Initialize")
    gui.set_button_text(1, "Run")
    gui.set_button_text(2, "...")
    gui.set_button_text(3, "...")
    gui.set_field(0, instance)
    gui.set_field(1, solution)
    gui.set_label(0, "Input file:")
    gui.set_label(1, "Solution file:")
    gui.set_animation_finished_action(lambda: None)
    gui.MainWindow.show()
    sys.exit(app.exec_())
Пример #3
0
def set_destination():
    s = gui.get_field(2).split(" ")
    destination = (int(s[0]), int(s[1]))
    ps.set_destination(destination)


def animate_path():
    gui.play_queue()


if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    gui = GUI()
    ps = Polygons_scene()
    gui.set_program_name("Polygon Scene Motion Planning")
    gui.set_field(0, "scene_hole_error.txt")
    gui.set_field(1, "output_scene0.txt")
    gui.set_field(3, "ex23")
    gui.set_field(4, "path0.txt")
    gui.set_field(5, "path_out.txt")
    gui.set_logic(0, set_up_scene)
    gui.set_button_text(0, "Load scene")
    gui.set_logic(1, save_scene)
    gui.set_button_text(1, "Save scene")
    gui.set_logic(2, set_destination)
    gui.set_button_text(2, "Set destination")
    gui.set_logic(3, generate_path)
    gui.set_button_text(3, "Generate path")
    gui.set_logic(4, load_path)
    gui.set_button_text(4, "Load path")
Пример #4
0
        gui.turn_button_on(n, options[key])
        ps.set_up_animation()

    gui.set_logic(n, update_button)
    gui.set_button_text(n, key)
    gui.turn_button_on(n, value)
    options[key] = float(value)


if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    gui = GUI()
    OPTIONS = {}
    ps = Polygons_scene()
    gui.set_program_name("Kinodynamics- Dor Israeli")
    gui.set_button_text(0, "Load scene")
    gui.set_field(0, "scene0")
    gui.set_logic(0, set_up_scene)
    gui.set_button_text(1, "Generate path")
    gui.set_field(1, "rrt")
    gui.set_logic(1, generate_path)
    ez_option_text(OPTIONS, gui, 2, "K", 1000)
    ez_option_text(OPTIONS, gui, 3, "dt", 1)
    ez_option_text(OPTIONS, gui, 4, "g", -0.1)
    ez_option_text(OPTIONS, gui, 5, "epsilon", 1)
    ez_option_text(OPTIONS, gui, 6, "thrust", 1)
    ez_option_text(OPTIONS, gui, 7, "mass", 1)
    ez_option_button(OPTIONS, gui, 8, "re/draw", True)
    ez_option_button(OPTIONS, gui, 9, "two-sided", True)
    gui.MainWindow.show()