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)
ormove_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
-
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
pip3 install magnebot
- Download the latest TDW build and unzip it.
Update an existing installation
pip3 install tdw -U
pip3 install magnebot -U
- Download the latest TDW build and unzip it.
Usage
- 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_floorplan_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()
Documentation
- Magnebot API
- APIs for other classes in the Magnebot module
- How to define custom APIs
- Changelog
- Troubleshooting and debugging
- For more information regarding TDW, see the TDW repo. Relevant documentation includes:
- Benchmark
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 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 usingpy-md-doc
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.