Commit b8b42fde authored by peterd-NV's avatar peterd-NV Committed by Kelly Guo

Adds how to create new Mimic envs to Isaac Lab Mimic docs (#197)

# Description

<!--
Thank you for your interest in sending a pull request. Please make sure
to check the contribution guidelines.

Link: https://isaac-sim.github.io/IsaacLab/source/refs/contributing.html
-->

Adding a section on how to create a Mimic compatible env to the Isaac
Lab Mimic docs.

Fixes # (issue)

<!-- As a practice, it is recommended to open an issue to have
discussions on the proposed pull request.
This makes it easier for the community to keep track of what is being
developed or added, and if a given feature
is demanded by more than one party. -->

## Type of change

<!-- As you go through the list, delete the ones that are not
applicable. -->

- Documentation change


<!--
Example:

| Before | After |
| ------ | ----- |
| _gif/png before_ | _gif/png after_ |

To upload images to a PR -- simply drag and drop an image while in edit
mode and it should upload the image directly. You can then paste that
source into the above before/after sections.
-->

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [ ] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

<!--
As you go through the checklist above, you can mark something as done by
putting an x character in it

For example,
- [x] I have done this task
- [ ] I have not done this task
-->
parent 2ac0e5bd
...@@ -138,3 +138,36 @@ learning from demonstrations (LfD). For this, we provide scripts to collect data ...@@ -138,3 +138,36 @@ learning from demonstrations (LfD). For this, we provide scripts to collect data
.. code:: bash .. code:: bash
./isaaclab.sh -p source/standalone/workflows/robomimic/play.py --task Isaac-Stack-Cube-Franka-IK-Rel-v0 --checkpoint /PATH/TO/desired_model_checkpoint.pth ./isaaclab.sh -p source/standalone/workflows/robomimic/play.py --task Isaac-Stack-Cube-Franka-IK-Rel-v0 --checkpoint /PATH/TO/desired_model_checkpoint.pth
Creating Your Own Isaac Lab Mimic Compatible Environments
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In order to use Isaac Lab Mimic to generate additional demonstrations automatically with an existing Isaac Lab environment, the environment
needs to be made "Mimic compatible" by implementing additional functions which are used during data generation.
Mimic compatible environments are derived from the ``ManagerBasedRLMimicEnv`` base class and must implement the following functions:
* ``get_robot_eef_pose``: Returns the current robot end effector pose in the same frame as used by the robot end effector controller.
* ``target_eef_pose_to_action``: Takes a target pose for the end effector controller and returns an action which achieves the target pose.
* ``action_to_target_eef_pos``: Takes an action and returns a target pose for the end effector controller.
* ``action_to_gripper_action``: Takes an action and returns the gripper actuation part of the action.
* ``get_object_poses``: Returns the pose of each object in the scene that is used for data generation.
* ``get_subtask_term_signals``: Returns a dictionary of binary flags for each subtask in a task. The flag of 1 is set when the subtask has been completed and 0 otherwise.
* ``is_success``: Returns a boolean indicator of whether the task has been successfully completed.
The class ``FrankaCubeStackIKRelMimicEnv`` shows an example of creating a Mimic compatible environment from an existing Isaac Lab environment.
It can be found under ``source/extensions/omni.isaac.lab_mimic/omni/isaac/lab_mimic/envs``.
A Mimic compatible environment config class must also be created by extending the existing environment config with additional Mimic required parameters.
All Mimic required config parameters are specified in the ``MimicEnvCfg`` class found under ``source/extensions/omni.isaac.lab/omni/isaac/lab/envs``.
The config class ``FrankaCubeStackIKRelMimicEnvCfg`` shows an example of creating a Mimic compatible environment config class for the Franka stacking task
and can be found under ``source/extensions/omni.isaac.lab_mimic/omni/isaac/lab_mimic/envs``.
Once both Mimic compatible environment and environment config classes have been created, a new Mimic compatible environment can be registered using ``gym.register`` and used
with Isaac Lab Mimic data generation. For the Franka stacking task in the examples above, the Mimic environment is registered as ``Isaac-Stack-Cube-Franka-IK-Rel-Mimic-v0``.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment