Skip to content

Commit

Permalink
Merge pull request #131 from threedworld-mit/urdf
Browse files Browse the repository at this point in the history
Urdf
  • Loading branch information
alters-mit authored Feb 22, 2021
2 parents 61d8afd + 4d73703 commit ab4dfa9
Show file tree
Hide file tree
Showing 15 changed files with 1,368 additions and 95 deletions.
43 changes: 43 additions & 0 deletions Documentation/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,49 @@

To upgrade from TDW v1.7 to v1.8, read [this guide](Documentation/upgrade_guides/v1.7_to_v1.8).

## v1.8.2

### `tdw` module

### `Controller`

- Fixed: When checking for TDW updates, the recommendation to upgrade gives the incorrect release version if the third number in the version is above 9 (e.g. 1.7.16)

#### `RobotCreator`

- Added: `robot_creator.py` **Frontend users can now add robots to TDW, given the URL of a .urdf or .xacro file.** See: `tdw/Documenation/misc_frontend/robotics.md` and `tdw/Documentation/python/robot_creator.md`

#### Backend

- Added: `asset_bundle_creator_base.py` Shared code between `asset_bundle_creator.py` and `robot_creator.py`

### Robot Library

- Added new robots: Baxter, Sawyer, Niryo One, Fetch, Shadowhand, UR5, and UR10

### Build

- Upgraded to Unity 2020.2.5

### Example Controllers

- `robot_arm.py` uses the UR5 robot instead of the UR3 robot

### Documentation

#### New Documentation

| Document | Description |
| --- | --- |
| `robot_creator.md` | API documentation for `RobotCreator` as well as installation instructions and troubleshooting tips. |
| `asset_bundle_creator_base.md` | API documentation for `AssetBundleCreatorBase` |

#### Modified Documentation

| Document | Modification |
| ------------------------------ | ------------------------------------------------------------ |
| `robots.md` | Added a section for how to start using the new `RobotCreator` |

## v1.8.1

### Command API
Expand Down
53 changes: 53 additions & 0 deletions Documentation/misc_frontend/robots.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,59 @@ TDW has a built-in concept of what an "Avatar" is, which has implications for wh

Robots by default don't have cameras. However, you can add a camera to a robot by first creating an avatar and then parenting that avatar to the robot. See: `example_controllers/robot_camera.py` for example implementation.

## Robots Currently in TDW

TDW includes many real-world robots by default. Metadata records of each robot are stored in a [`RobotLibrarian`](../python/librarian/robot_librarian.md).

To get a list of available robots:

```python
from tdw.librarian import RobotLibrarian

lib = RobotLibrarian()
for record in lib.records:
print(record.name)
```

To search for a robot:

```python
from tdw.librarian import RobotLibrarian

lib = RobotLibrarian()

record = lib.get_record("ur3")
if record is not None:
print(record.name, record.urls)

records = lib.search_records("ur3")
for record in records:
print(record)
```

To add a robot:

```python
from tdw.controller import Controller
from tdw.tdw_utils import TDWUtils
from tdw.librarian import RobotLibrarian

c = Controller(launch_build=False)
c.start()

lib = RobotLibrarian()
record = lib.get_record(name="ur3")

c.communicate([TDWUtils.create_empty_room(12, 12),
c.get_add_robot(name=record.name,
robot_id=0,
position={"x": 0.5, "y": 0, "z": 2})])
```

## How to Add a Robot to TDW

**It is possible to import any robot into TDW, given a .urdf or .xacro file.** To do so, use a `RobotCreator`. [Read this document to learn more about the API and installation requirements](../python/robot_creator.md).

## Magnebot API

The Magnebot is a specialized robot in TDW that can use "magnets" to pick up objects.
Expand Down
10 changes: 9 additions & 1 deletion Documentation/python/asset_bundle_creator.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `asset_bundle_creator.py`

## `AssetBundleCreator`
## `AssetBundleCreator(AssetBundleCreatorBase)`

`from tdw.asset_bundle_creator import AssetBundleCreator`

Expand Down Expand Up @@ -97,6 +97,14 @@ _Returns:_ The path to the asset_bundle_creator Unity project.

***

#### `get_project_path() -> Path`

_This is a static function._

_Returns:_ The expected path of the Unity project.

***

#### `fbx_to_obj(self, model_path: Path) -> Tuple[Path, bool]`

Convert a .fbx file to a .obj file with assimp
Expand Down
50 changes: 50 additions & 0 deletions Documentation/python/asset_bundle_creator_base.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# `asset_bundle_creator_base.py`

## `AssetBundleCreatorBase(ABC)`

`from tdw.asset_bundle_creator_base import AssetBundleCreatorBase`

Base class for creating asset bundles.

***

#### `__init__(self, quiet: bool = False, display: str = ":0")`


| Parameter | Description |
| --- | --- |
| quiet | If true, don't print any messages to console. |
| display | The display to launch Unity Editor on. Ignored if this isn't Linux. |

***

#### `get_base_unity_call(self) -> List[str]`

_Returns:_ The call to launch Unity Editor silently in batchmode, execute something, and then quit.

***

#### `get_editor_path() -> Path`

_This is a static function._

Build the asset_bundle_creator Unity project.

_Returns:_ The path to the asset_bundle_creator Unity project.

***

#### `get_unity_project(self) -> Path`

Build the asset_bundle_creator Unity project.

_Returns:_ The path to the asset_bundle_creator Unity project.

***

#### `get_project_path() -> Path`

_Returns:_ The expected path of the Unity project.

***

Loading

0 comments on commit ab4dfa9

Please sign in to comment.