Repository navigation
Add SoftMimicGen docs #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f1e1591
add init docs draft
peterd-NV a7a2825
fix and cleanup
peterd-NV 33e645d
clean up
peterd-NV 55ef768
Merge branch 'main' of github.com:isaac-sim/AutoData into peterd/smg-…
peterd-NV b511654
add visuals
peterd-NV 4745a24
add algorithm section for smg
peterd-NV 38512b4
formatting cleanup
peterd-NV 3552c10
address review bot comments
peterd-NV f93bd97
Merge branch 'main' of github.com:isaac-sim/AutoData into peterd/smg-…
peterd-NV d1d4f2c
Merge branch 'main' of github.com:isaac-sim/AutoData into peterd/smg-…
peterd-NV e54f7db
address review comments
peterd-NV File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 hidden or 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
108 changes: 108 additions & 0 deletions
108
docs/pages/workflows/franka_rope_softmimicgen/index.rst
This file contains hidden or 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,108 @@ | ||
| .. Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| .. SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| Franka Rope Manipulation with SoftMimicGen | ||
| ========================================== | ||
|
|
||
| This example demonstrates the AutoData workflow using SoftMimicGen to generate a synthetic | ||
| dataset for a Franka robot manipulating a deformable rope. It covers recording source | ||
| demonstrations by teleoperation, annotating their subtask boundaries, generating a dataset, | ||
| and validating the result. | ||
|
|
||
| The same workflow supports **Newton** and **PhysX**. Use the tabs throughout the tutorial to | ||
|
peterd-NV marked this conversation as resolved.
Resolved
|
||
| select a physics backend. Keep that backend consistent for recording, annotation, generation, | ||
| and replay. The commands use separate dataset filenames for each backend. | ||
|
peterd-NV marked this conversation as resolved.
Resolved
|
||
|
|
||
| .. figure:: ../../../images/franka_rope_softmimicgen.png | ||
| :width: 100% | ||
| :align: center | ||
| :alt: Franka arm grasping a deformable rope on the table in the Kit viewer | ||
|
|
||
| The Franka rope manipulation task. | ||
|
|
||
|
|
||
| Task Overview | ||
| ------------- | ||
|
|
||
| **Environment name:** ``Isaac-Rope-Franka-Arena-IK-Rel-v0`` | ||
|
|
||
| **Task Description:** A Franka arm grasps a deformable rope on a table and manipulates it | ||
| until its two ends are close together. | ||
|
|
||
| **Key Specifications:** | ||
|
|
||
| .. list-table:: | ||
| :widths: 30 70 | ||
| :header-rows: 1 | ||
|
|
||
| * - Property | ||
| - Value | ||
| * - **Algorithm** | ||
| - SoftMimicGen (single end-effector in this example) | ||
| * - **Physics backends** | ||
| - Newton (``--presets newton``) or PhysX (``--presets physx``) | ||
| * - **Embodiment** | ||
| - Franka, relative IK task-space actions (7-D: delta position, axis-angle rotation, and gripper open/close) | ||
| * - **Task descriptor** | ||
| - :autodata_code_link:`<autodata_examples/tasks/franka_rope_softmimicgen.yaml>` | ||
| * - **Embodiment config** | ||
| - :autodata_code_link:`<autodata_examples/embodiments/franka_ik_rel.yaml>` | ||
| * - **Subtasks** | ||
| - Approach and grasp the rope (``grasp``) → bring its ends together (``end of trajectory``) | ||
| * - **Newton source dataset** | ||
| - :autodata_code_link:`<datasets/annotated_datasets/dataset_franka_rope_newton_annotated.hdf5>` | ||
| * - **PhysX source dataset** | ||
| - :autodata_code_link:`<datasets/annotated_datasets/dataset_franka_rope_physx_annotated.hdf5>` | ||
|
|
||
|
|
||
| How SoftMimicGen Adapts Demonstrations | ||
| -------------------------------------- | ||
|
|
||
| In the :doc:`cube-stacking workflow <../franka_cube_stack_mimicgen/index>`, MimicGen transforms | ||
| each source segment relative to a rigid object's pose. A rope can change shape, so its pose | ||
| alone does not describe the geometry the gripper needs to follow. | ||
|
|
||
| SoftMimicGen uses the rope's **simulation-node positions** to compare the source and current | ||
| rope shapes. It selects a source demonstration using registration cost, then fits a | ||
| **thin-plate-spline (TPS)** transform to adapt the source end-effector trajectory to the new | ||
| shape. Annotation records the nodal positions needed for this transform along with the | ||
| subtask signals. The source data and live rope must have matching node counts and topology. | ||
|
|
||
|
|
||
| Workflow | ||
| -------- | ||
|
|
||
| Follow the whole pipeline, or skip recording and annotation by using the backend-specific | ||
| pre-annotated source dataset described in :doc:`step_3_generate_dataset`. | ||
|
|
||
| Prerequisites | ||
| ^^^^^^^^^^^^^ | ||
|
|
||
| Complete :doc:`../../quickstart/installation`, including downloading the Git LFS assets, and | ||
| start the dev container: | ||
|
|
||
| :docker_run_default: | ||
|
|
||
| Run the commands below from the repository root inside the container. Both backends use | ||
| ``--device cuda``. A SpaceMouse is recommended for recording; a keyboard also works. | ||
|
|
||
| The examples enable cameras to include the task's fixed-view and wrist RGB observations. | ||
| ``--viz kit`` opens the simulation window; ``--viz none`` runs without it. Camera recording | ||
| is controlled separately by ``--enable_cameras``. | ||
|
|
||
| Workflow Steps | ||
| ^^^^^^^^^^^^^^ | ||
|
|
||
| - :doc:`step_1_record_demonstrations` | ||
| - :doc:`step_2_annotate_demonstrations` | ||
| - :doc:`step_3_generate_dataset` | ||
| - :doc:`step_4_validate_dataset` | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 1 | ||
| :hidden: | ||
|
|
||
| step_1_record_demonstrations | ||
| step_2_annotate_demonstrations | ||
| step_3_generate_dataset | ||
| step_4_validate_dataset | ||
135 changes: 135 additions & 0 deletions
135
docs/pages/workflows/franka_rope_softmimicgen/step_1_record_demonstrations.rst
This file contains hidden or 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,135 @@ | ||
| .. Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| .. SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| Step 1: Record Source Demonstrations | ||
| ------------------------------------ | ||
|
|
||
| Record a small set of successful rope-manipulation demonstrations as Isaac Lab HDF5 | ||
| datasets. Each episode includes the robot's actions, observations, and initial state, | ||
| including the rope's deformable state. | ||
|
|
||
| .. note:: | ||
|
|
||
| To skip recording and annotation, use the backend-specific pre-annotated source dataset | ||
| in :doc:`step_3_generate_dataset`. | ||
|
|
||
|
|
||
| Recording with a SpaceMouse (Recommended) | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| Set up the SpaceMouse on the host using the device setup instructions in | ||
| :doc:`../franka_cube_stack_mimicgen/step_1_record_demonstrations`, then start the dev container: | ||
|
|
||
| :docker_run_default: | ||
|
|
||
| Run the recording command for your backend: | ||
|
|
||
| .. tabs:: | ||
|
|
||
| .. group-tab:: Newton | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| python submodules/IsaacLab-Arena/submodules/IsaacLab/scripts/tools/record_demos.py \ | ||
| --task Isaac-Rope-Franka-Arena-IK-Rel-v0 \ | ||
| --presets newton \ | ||
| --external_callback autodata_examples.envs.register_environments \ | ||
| --viz kit \ | ||
| --device cuda \ | ||
| --enable_cameras \ | ||
| --teleop_device spacemouse \ | ||
| --num_demos 3 \ | ||
| --no-reset_sim_buffer_each_episode \ | ||
| --dataset_file ./datasets/dataset_franka_rope_newton.hdf5 | ||
|
|
||
| .. note:: | ||
|
|
||
| Newton recording requires ``--no-reset_sim_buffer_each_episode``. Keep this flag | ||
| when using either a SpaceMouse or a keyboard. | ||
|
|
||
| .. group-tab:: PhysX | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| python submodules/IsaacLab-Arena/submodules/IsaacLab/scripts/tools/record_demos.py \ | ||
| --task Isaac-Rope-Franka-Arena-IK-Rel-v0 \ | ||
| --presets physx \ | ||
| --external_callback autodata_examples.envs.register_environments \ | ||
| --viz kit \ | ||
| --device cuda \ | ||
| --enable_cameras \ | ||
| --teleop_device spacemouse \ | ||
| --num_demos 3 \ | ||
| --dataset_file ./datasets/dataset_franka_rope_physx.hdf5 | ||
|
|
||
| .. figure:: ../../../images/franka_rope_teleop.gif | ||
| :width: 90% | ||
| :align: center | ||
| :alt: Recorded source demonstration of the Franka grasping one rope end and moving it toward the other | ||
|
|
||
| A source demonstration: approach the rope, grasp one end, and bring it toward the other. | ||
|
|
||
| ``--external_callback`` registers AutoData's Arena rope environment before Isaac Lab creates | ||
| it. Keep this option when recording or replaying with Isaac Lab's tools. | ||
|
|
||
| The SpaceMouse controls are the same as in the cube-stacking workflow: | ||
|
|
||
| .. list-table:: | ||
| :widths: 40 60 | ||
| :header-rows: 1 | ||
|
|
||
| * - Input | ||
| - Action | ||
| * - Move the puck laterally / vertically | ||
| - Translate the end-effector | ||
| * - Tilt / twist the puck | ||
| - Rotate the end-effector | ||
| * - Left button | ||
| - Toggle gripper (open / close) | ||
| * - Right button | ||
| - Discard the current demonstration and reset | ||
|
|
||
|
|
||
| Performing the Demonstrations | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| Approach one end of the rope, close the gripper around it, then move it toward the other | ||
| end. Hold the ends close together until the recorder recognizes success. The recorder | ||
| exports successful demonstrations and exits automatically after three have been collected. | ||
|
|
||
| Use smooth, direct motions and avoid extended pauses. Confirm that the rope stays in the | ||
| gripper as it moves. If a grasp slips or the rope falls off the table, discard the attempt | ||
| and reset. Record several demonstrations across the randomized starting rope shapes. | ||
|
|
||
|
|
||
| Recording with a Keyboard (Optional) | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| Replace ``--teleop_device spacemouse`` with ``--teleop_device keyboard`` in the command for | ||
| your backend. No additional device setup is required. | ||
|
|
||
| Use the keyboard controls printed by the recorder: ``W/S``, ``A/D``, ``Q/E`` translate the | ||
| arm; ``Z/X``, ``T/G``, ``C/V`` rotate it; ``K`` toggles the gripper; and ``R`` discards the | ||
| current demonstration and resets. | ||
|
|
||
|
|
||
| Expected Output | ||
| ^^^^^^^^^^^^^^^ | ||
|
|
||
| Check that the recorded file contains the successful episodes: | ||
|
|
||
| .. tabs:: | ||
|
|
||
| .. group-tab:: Newton | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| python scripts/validate_dataset.py ./datasets/dataset_franka_rope_newton.hdf5 | ||
|
|
||
| .. group-tab:: PhysX | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| python scripts/validate_dataset.py ./datasets/dataset_franka_rope_physx.hdf5 | ||
|
|
||
| Continue to :doc:`step_2_annotate_demonstrations`. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.