-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Isaac extensions for Recording and Replaying trajectories (#4)
- Loading branch information
Showing
47 changed files
with
1,609 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
This file was deleted.
Oops, something went wrong.
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# all folders starting with _ are local | ||
_*/ | ||
|
||
.DS_Store | ||
**/.vscode/ipch | ||
|
||
# byte-compiled python files | ||
*.py[cod] | ||
|
||
/.vs | ||
|
||
/app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Extension Project Template | ||
|
||
This project was automatically generated. | ||
|
||
- `app` - It is a folder link to the location of your *Omniverse Kit* based app. | ||
- `exts` - It is a folder where you can add new extensions. It was automatically added to extension search path. (Extension Manager -> Gear Icon -> Extension Search Path). | ||
|
||
Open this folder using Visual Studio Code. It will suggest you to install few extensions that will make python experience better. | ||
|
||
Look for "trajectory_synth" extension in extension manager and enable it. Try applying changes to any python files, it will hot-reload and you can observe results immediately. | ||
|
||
Alternatively, you can launch your app from console with this folder added to search path and your extension enabled, e.g.: | ||
|
||
``` | ||
> app\omni.code.bat --ext-folder exts --enable company.hello.world | ||
``` | ||
|
||
# App Link Setup | ||
|
||
If `app` folder link doesn't exist or broken it can be created again. For better developer experience it is recommended to create a folder link named `app` to the *Omniverse Kit* app installed from *Omniverse Launcher*. Convenience script to use is included. | ||
|
||
Run: | ||
|
||
``` | ||
> link_app.bat | ||
``` | ||
|
||
If successful you should see `app` folder link in the root of this repo. | ||
|
||
If multiple Omniverse apps is installed script will select recommended one. Or you can explicitly pass an app: | ||
|
||
``` | ||
> link_app.bat --app create | ||
``` | ||
|
||
You can also just pass a path to create link to: | ||
|
||
``` | ||
> link_app.bat --path "C:/Users/bob/AppData/Local/ov/pkg/create-2021.3.4" | ||
``` | ||
|
||
|
||
# Sharing Your Extensions | ||
|
||
This folder is ready to be pushed to any git repository. Once pushed direct link to a git repository can be added to *Omniverse Kit* extension search paths. | ||
|
||
Link might look like this: `git://github.com/[user]/[your_repo].git?branch=main&dir=exts` | ||
|
||
Notice `exts` is repo subfolder with extensions. More information can be found in "Git URL as Extension Search Paths" section of developers manual. | ||
|
||
To add a link to your *Omniverse Kit* based app go into: Extension Manager -> Gear Icon -> Extension Search Path | ||
|
47 changes: 47 additions & 0 deletions
47
isaac_src/extensions/trajectory_synth/exts/trajectory_synth/config/extension.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
[package] | ||
# Semantic Versioning is used: https://semver.org/ | ||
version = "1.0.0" | ||
|
||
# Lists people or organizations that are considered the "authors" of the package. | ||
authors = ["NVIDIA"] | ||
|
||
# The title and description fields are primarily for displaying extension info in UI | ||
title = "trajectory_synth" | ||
description="An extension for recording and augmenting robot trajectories" | ||
|
||
# Path (relative to the root) or content of readme markdown file for UI. | ||
readme = "docs/README.md" | ||
|
||
# URL of the extension source repository. | ||
repository = "" | ||
|
||
# One of categories for UI. | ||
category = "Synthetic Trajectories" | ||
|
||
# Keywords for the extension | ||
keywords = ["trajectory", "synthesis", "robotics", "simulation"] | ||
|
||
# Location of change log file in target (final) folder of extension, relative to the root. | ||
# More info on writing changelog: https://keepachangelog.com/en/1.0.0/ | ||
changelog="docs/CHANGELOG.md" | ||
|
||
# Preview image and icon. Folder named "data" automatically goes in git lfs (see .gitattributes file). | ||
# Preview image is shown in "Overview" of Extensions window. Screenshot of an extension might be a good preview image. | ||
preview_image = "data/preview.png" | ||
|
||
# Icon is shown in Extensions window, it is recommended to be square, of size 256x256. | ||
icon = "data/icon.png" | ||
|
||
# Use omni.ui to build simple UI | ||
[dependencies] | ||
"omni.kit.uiapp" = {} | ||
|
||
# Main python module this extension provides, it will be publicly available as "import trajectory_synth". | ||
[[python.module]] | ||
name = "trajectory_synth" | ||
|
||
[[test]] | ||
# Extra dependencies only to be used during test run | ||
dependencies = [ | ||
"omni.kit.ui_test" # UI testing extension | ||
] |
3 changes: 3 additions & 0 deletions
3
isaac_src/extensions/trajectory_synth/exts/trajectory_synth/data/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
isaac_src/extensions/trajectory_synth/exts/trajectory_synth/data/preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions
8
isaac_src/extensions/trajectory_synth/exts/trajectory_synth/docs/CHANGELOG.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Changelog | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). | ||
|
||
|
||
## [1.0.0] - 2021-04-26 | ||
- Initial version of extension UI template with a window | ||
|
6 changes: 6 additions & 0 deletions
6
isaac_src/extensions/trajectory_synth/exts/trajectory_synth/docs/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Python Extension Example [trajectory_synth] | ||
|
||
This is my (Alex) first extension. It serves as an interface for starting & stopping | ||
trajectory recording, playback, and augmentation. | ||
|
||
The core purpose is to generate thousands of trajectories from a single human demonstration. |
20 changes: 20 additions & 0 deletions
20
isaac_src/extensions/trajectory_synth/exts/trajectory_synth/docs/index.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
trajectory_synth | ||
############################# | ||
|
||
Example of Python only extension | ||
|
||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
README | ||
CHANGELOG | ||
|
||
|
||
.. automodule::"trajectory_synth" | ||
:platform: Windows-x86_64, Linux-x86_64 | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
:imported-members: | ||
:exclude-members: contextmanager |
2 changes: 2 additions & 0 deletions
2
isaac_src/extensions/trajectory_synth/exts/trajectory_synth/trajectory_synth/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from .traj_recorder import TrajectoryRecorderExtension | ||
from .traj_replayer import TrajectoryReplayerExtension |
3 changes: 3 additions & 0 deletions
3
isaac_src/extensions/trajectory_synth/exts/trajectory_synth/trajectory_synth/schema.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
TIMESTEPS_FILENAME = "timesteps" | ||
SCENE_FILENAME = "scene" | ||
DEFAULT_RECORDINGS_DIR = "/robot/synthetic-output/recordings/" |
1 change: 1 addition & 0 deletions
1
..._src/extensions/trajectory_synth/exts/trajectory_synth/trajectory_synth/tests/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .test_hello_world import * |
44 changes: 44 additions & 0 deletions
44
...ensions/trajectory_synth/exts/trajectory_synth/trajectory_synth/tests/test_hello_world.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# NOTE: | ||
# omni.kit.test - std python's unittest module with additional wrapping to add suport for async/await tests | ||
# For most things refer to unittest docs: https://docs.python.org/3/library/unittest.html | ||
import omni.kit.test | ||
|
||
# Extnsion for writing UI tests (simulate UI interaction) | ||
from omni.kit import ui_test | ||
|
||
# Import extension python module we are testing with absolute import path, as if we are external user (other extension) | ||
import trajectory_synth | ||
|
||
|
||
# Having a test class dervived from omni.kit.test.AsyncTestCase declared on the root of module will make it auto-discoverable by omni.kit.test | ||
class Test(omni.kit.test.AsyncTestCase): | ||
# Before running each test | ||
async def setUp(self): | ||
pass | ||
|
||
# After running each test | ||
async def tearDown(self): | ||
pass | ||
|
||
# Actual test, notice it is "async" function, so "await" can be used if needed | ||
async def test_hello_public_function(self): | ||
result = trajectory_synth.some_public_function(4) | ||
self.assertEqual(result, 256) | ||
|
||
async def test_window_button(self): | ||
# Find a label in our window | ||
label = ui_test.find("My Window//Frame/**/Label[*]") | ||
|
||
# Find buttons in our window | ||
add_button = ui_test.find("My Window//Frame/**/Button[*].text=='Add'") | ||
reset_button = ui_test.find("My Window//Frame/**/Button[*].text=='Reset'") | ||
|
||
# Click reset button | ||
await reset_button.click() | ||
self.assertEqual(label.widget.text, "empty") | ||
|
||
await add_button.click() | ||
self.assertEqual(label.widget.text, "count: 1") | ||
|
||
await add_button.click() | ||
self.assertEqual(label.widget.text, "count: 2") |
Oops, something went wrong.