Exemple #1
0
def shutdown_pylot(node_handle, client, world):
    node_handle.shutdown()
    if FLAGS.simulation_recording_file is not None:
        client.stop_recorder()
    set_asynchronous_mode(world)
    if pylot.flags.must_visualize():
        import pygame
        pygame.quit()
Exemple #2
0
def shutdown_pylot(node_handle, client, world):
    if node_handle:
        node_handle.shutdown()
    else:
        print('The Pylot dataflow failed to initialize.')
    if FLAGS.simulation_recording_file is not None:
        client.stop_recorder()
    set_asynchronous_mode(world)
    if pylot.flags.must_visualize():
        import pygame
        pygame.quit()
Exemple #3
0
def main(args):
    # Connect an instance to the simulator to make sure that we can turn the
    # synchronous mode off after the script finishes running.
    client, world = get_world(FLAGS.carla_host, FLAGS.carla_port,
                              FLAGS.carla_timeout)
    if client is None or world is None:
        raise ValueError("There was an issue connecting to the simulator.")

    try:
        driver()
    except KeyboardInterrupt:
        set_asynchronous_mode(world)
    except Exception:
        set_asynchronous_mode(world)
        raise
Exemple #4
0
def main(args):
    if FLAGS.visualizer_backend == 'pygame':
        import pygame
        pygame.init()
        pylot.utils.create_pygame_display(FLAGS.carla_camera_image_width,
                                          FLAGS.carla_camera_image_height)
    # Connect an instance to the simulator to make sure that we can turn the
    # synchronous mode off after the script finishes running.
    client, world = get_world(FLAGS.carla_host, FLAGS.carla_port,
                              FLAGS.carla_timeout)
    if client is None or world is None:
        raise ValueError("There was an issue connecting to the simulator.")

    try:
        driver()
    except KeyboardInterrupt:
        set_asynchronous_mode(world)
    except Exception:
        set_asynchronous_mode(world)
        raise