Skip to main content

High-level API for the Magnebot in TDW.

Project description

Magnebot

Magnebot is a high-level robotics-like API for TDW. The Magnebot can move around the scene and manipulate objects by picking them up with "magnets". The simulation is entirely driven by physics.

Read the Magnebot API documentation here.

  • The Magnebot can be loaded into a wide variety of scenes populated by interactable objects.
  • At a low level, the Magnebot is driven by robotics commands such as set_revolute_target, which will turn a revolute drive. The high-level API combines the low-level commands into "actions", such as grasp(target_object) or move_by(distance).
  • At the end of every action, the Magnebot controller script will return scene state data, which includes an image, a depth map, a segmentation color map, and physics metadata for each body part of the robot and each object in the scene.

Requirements

See Getting Started With TDW:

  • Both the Magnebot API and the simulation executable ("the build") run on Windows, OS X, or Linux.

  • The Magnebot API requires Python 3.6 or newer.

  • The build requires a GPU.

  • The Magnebot API doesn't include audio/visual recording or Flex; you can ignore the requirements for those features.

Installation

  1. pip3 install magnebot
  2. Download the latest TDW build and unzip it.

Update an existing installation

  1. pip3 install tdw -U
  2. pip3 install magnebot -U
  3. Download the latest TDW build and unzip it.

Usage

  1. Run this controller:
from magnebot import Magnebot, Arm

m = Magnebot()

# Initialize the scene, populate it with objects, and add the Magnebot.
# This can take a few minutes to finish.
m.init_scene(scene="1a", layout=0, room=1)

# Reach for a target position.
status = m.reach_for(arm=Arm.left, target={"x": 0.1, "y": 0.6, "z": 0.4}, absolute=False)
print(status) # ActionStatus.success

# Save images.
m.state.save_images(output_directory="magnebot_test_images")

# End the simulation.
m.end()
  1. Launch the TDW build.

Documentation

Examples

Example controllers show actual examples for an actual use-case.

Controller Description
pick_up.py A simple example of how to pick up an object in the scene. You should try and review this example first.
custom_api.py An example of how to create a custom scene and a custom action. This is meant for more advanced users.

Other controllers in this repo

  • Promo controllers are meant to be use to generate promo videos or images; they include low-level TDW commands that you won't need to ordinarily use.
  • Test controllers load the Magnebot into an empty room using the TestController class and test basic functionality.

API Hierarchy

The Magnebot API relies on the tdw Python module. Every action in this API uses combinations of low-level TDW commands and output data, typically across multiple simulation steps.

This API is designed to be used as-is or as the base for an API with higher-level actions, such as the Transport Challenge. To learn how to write your own API extension, read this.

API Description
Transport Challenge Transport objects from room to room using containers as tools.

Backend

  • OccupancyMapper generates occupancy maps for each scene+layout combination, as well as floorplan and room images.
  • doc_gen.py generates API documentation using py-md-doc.

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

magnebot-1.0.0.1.tar.gz (34.8 kB view hashes)

Uploaded Source

Supported by

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