Skip to content

Commit

Permalink
[update] update readme and setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
yzqin committed May 17, 2024
1 parent 8feed85 commit 20252d4
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ imgui.ini
/log
/site/
/bunny_teleop.egg-info/

# Examples
/examples/retargeting/data/
!examples/retargeting/data/offline_avp_stream.pkl
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ instructions.

- [x] Tutorial for initialization
- [x] Tutorial for tips and troubleshooting
- [ ] Tutorial for retargeting
- [x] Tutorial for retargeting
- [ ] Robot collision avoidance
- [ ] Robot arm singularity avoidance
- [ ] Collision-free retargeting
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/visualization.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ progress, transitioning to two smaller 3D gizmos indicating the end effector pos
After initialization, the robot will begin moving inside the web visualizer. The two small gizmo shows the end effector
pose from human.

![](../assets/videos/output_file.webp)
![](../assets/videos/gizmo.webp)

File renamed without changes.
Binary file added docs/assets/videos/teaser.webp
Binary file not shown.
56 changes: 56 additions & 0 deletions docs/example/retargeting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Hand Retargeting

This example demonstrates how to use data exclusively from Apple Vision Pro to manipulate bimanual robot hands, omitting
the robot arm component. We capture some offline Vision Pro data and employ it to create retargeting visualizations as
shown below.

![bimanual_retargeting](../assets/videos/teaser.webp)

## Installation

We provide an offline data file, `data/offline_avp_stream.pkl`, which contains
recorded Vision Pro streams. This data is used to generate trajectories for robot hand joints. To process the data, you
will need specific robot hand
models.

```shell
cd examples/retargeting

# Download robot hand models
git clone https://github.com/dexsuite/dex-urdf

# Install additional Python dependencies needed for this example
pip install sapien dex_retargeting tyro opencv-python
```

## Retargeting Human Hand Data

Use the following commands to convert recorded human hand data into robot hand joint
trajectories:

```shell
python retargeting.py --robot-name allegro --data-path data/offline_avp_stream.pkl --output-path data/allegro.pkl

# You can also do that for other robot hands.
python retargeting.py --robot-name ability --data-path data/offline_avp_stream.pkl --output-path data/ability.pkl
python retargeting.py --robot-name svh --data-path data/offline_avp_stream.pkl --output-path data/svh.pkl
```

## Visualize Retargeting Results

We also provide scripts to convert the retargeting data into videos for visualization, such
as `data/allegro.mp4`. Check out the video to see the results!

```shell
python render_retargeting.py --pickle-path data/allegro.pkl --output_video_path data/allegro.mp4

# You can also do that for other robot hands.
python render_retargeting.py --pickle-path data/ability.pkl --output_video_path data/ability.mp4
python render_retargeting.py --pickle-path data/svh.pkl --output_video_path data/svh.mp4
```

!!! tip "Record Your Own Vision Pro Data"

If you have a Vision Pro, you can record your own data by opening the Tracking Stream App as described in the [Basic Usage Section](https://dingry.github.io/BunnyVisionPro/getstarted/usage/#3-launch-tracking-streamer-app).
Then, run the command below to save your data: `python save_offline_avp_stream.py --avp_ip=YOUR_VISION_PRO_IP`
This will generate a file `data/your_offline_avp_stream.pkl` in the provided format.
9 changes: 2 additions & 7 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ plugins:
# - minify:
# minify_html: true

# # Hooks
# hooks:
# - material/overrides/hooks/shortcodes.py
# - material/overrides/hooks/translations.py

# Additional configuration
extra:
status:
Expand Down Expand Up @@ -146,5 +141,5 @@ nav:
- system/overview.md
- advanced/initialization.md
- advanced/visualization.md
# - Reference:
# - reference/index.md
- Example:
- example/retargeting.md
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@
"mypy",
]

example_requirements = [""]
example_requirements = [
"dex_retargeting",
"tyro",
"sapien==3.0.0b0",
"opencv-python",
]

classifiers = [
"Development Status :: 3 - Alpha",
Expand Down

0 comments on commit 20252d4

Please sign in to comment.