Skip to main content

A simple GUI to create 2D scenes with obstacles and drone paths for multi-agent path planning algorithms

Project description

SceneBuilder

Overview

SceneBuilder is a Python package that provides a Matplotlib-based GUI for designing 2D test environments in a 10x10m grid for use in multiagent path planning algorithms. Users can draw polygons to represent obstacles and arrows to indicate the starting and ending points of each agent's path.

Installation

To install SceneBuilder, run the following command:

pip install scenebuilder

This command installs SceneBuilder along with all required dependencies, ensuring that everything needed to run the GUI is properly set up.

Getting Started

Prerequisites

SceneBuilder's prerequisites are defined in the pyproject.toml file and include Matplotlib and numpy.

Quick Start Guide

To start using SceneBuilder, you need to create an instance of the SceneBuilder class and invoke the draw_scene() method. Below is a simple example to get you started:

from scenebuilder import SceneBuilder

# Create an instance of the SceneBuilder
scene = SceneBuilder()

# Open the GUI to draw a scene
scene.draw_scene()

Load in an existing compatible json file for modification:

scene.load_scene("path/to/your_file.json")
scene.draw_scene()

Specify the path to save your output json to:

scene.set_output_path("path/to/output.json")
scene.draw_scene()

Using Command-Line Options

You can also use SceneBuilder directly from the command line with the following options:

  • -o, --output: Specify the path where the scene should be saved as a JSON file.
  • -l, --load: Specify a JSON file path to load an existing scene.

Example usage:

scenebuilder --load path/to/scene.json --output path/to/output.json

Features

  • Draw Obstacles: Click within the GUI to place vertices of polygons that represent obstacles. Press Tab to complete an obstacle.
  • Add new obstacle vertices: To add new vertices, click somewhere on the polygon's perimeter and drag to move the vertex to its desired location.
  • Set Drone Paths: Click once to place the starting point, and again to place the goal of an agent/drone. An arrow will automatically be drawn from start to goal.
  • Move or adjust existing obstacles/drones: Obstacles and drones can be moved by clicking and dragging. Drone start and goal points, as well as existing obstacle vertices can be moved in the same way.
  • Switch between Obstacle and Drone Modes: Press b to switch to building/obstacle mode. Press d to switch to drone/agent mode. Alternatively click the Switch button on the bottom left of the gui.
  • Remove unwanted points: To remove unwanted points (either obstacle vertices or a drone start point), press escape.
  • Undo drone/obstacle placement: To remove the last obstacle or drone, press ctrl+z.
  • Reset Scene: To reset the scene to a blank canvas, click the Reset button in the gui.

Saving Scenes

Once you have created a scene, you can save it to a JSON file by clicking the 'Create JSON' button in the GUI. This file can then be used as input for path planning algorithms that require predefined scenes with obstacles and paths.

Unless otherwise specified, the file is saved as "scenebuilder.json" in the current working directory.

Contributing

Contributions to SceneBuilder are welcome! If you have suggestions for improvements or new features, feel free to create an issue or pull request on our GitHub repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scenebuilder-0.1.3.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scenebuilder-0.1.3-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file scenebuilder-0.1.3.tar.gz.

File metadata

  • Download URL: scenebuilder-0.1.3.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.7 Darwin/23.0.0

File hashes

Hashes for scenebuilder-0.1.3.tar.gz
Algorithm Hash digest
SHA256 88634cf85efee16ca27f472dd6164da1e3496d0681c0aa2f5d74078c982aa0ec
MD5 e9ffaf0cd7b1760be3896b85e815a124
BLAKE2b-256 ad0bb313887b78aa39a3638c159e2e4e25f2b9a3e2f2929375d8b1acddf37595

See more details on using hashes here.

File details

Details for the file scenebuilder-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: scenebuilder-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.7 Darwin/23.0.0

File hashes

Hashes for scenebuilder-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fe2a4f079618d10cdaf1dc8a4d2c1c9a6f5f64c596e22a2673b04d96a528d419
MD5 19cb1f650b8df536f6348401a5abc777
BLAKE2b-256 ddb5254759c86f946f853f9216d443fe36ac56d8a31339f2c8939a907fa46914

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page