Commit 3d32b75e authored by Ashwin Varghese Kuruttukulam's avatar Ashwin Varghese Kuruttukulam Committed by Kelly Guo

Prevents pinocchio import mimic (#325)

1. Move gr1mimc envs to a seperate directory and init file in order
prevent import pinocchio dependency
2. Install pinocchio 3.4.0 using conda as a fix for
https://nvbugs/5173837.
3. Sets the usdtourdf converter logger level to error
4. Add cfg parameter to `PinkIKControllerCfg` to toggle if IK solver
solution not found warnings are shown.

- Bug fix (non-breaking change which fixes an issue)

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file

---------
Signed-off-by: 's avatarKelly Guo <kellyguo123@hotmail.com>
Co-authored-by: 's avatarPeter Du <peterd@nvidia.com>
Co-authored-by: 's avatarKelly Guo <kellyg@nvidia.com>
parent 356758ef
...@@ -324,11 +324,24 @@ Optional: Collect and annotate demonstrations ...@@ -324,11 +324,24 @@ Optional: Collect and annotate demonstrations
an Apple Vision Pro, you may skip this step and continue on to the next step: `Generate the dataset`_. an Apple Vision Pro, you may skip this step and continue on to the next step: `Generate the dataset`_.
A pre-recorded annotated dataset is provided in the next step . A pre-recorded annotated dataset is provided in the next step .
.. note::
The GR1 scene utilizes the wrist poses from the Apple Vision Pro (AVP) as setpoints for a differential IK controller (Pink-IK).
The differential IK controller requires the user's wrist pose to be close to the robot's initial or current pose for optimal performance.
Rapid movements of the user's wrist may cause it to deviate significantly from the goal state, which could prevent the IK controller from finding the optimal solution.
This may result in a mismatch between the user's wrist and the robot's wrist.
You can increase the gain of the all `Pink-IK controller's FrameTasks<https://github.com/isaac-sim/IsaacLab-Internal/blob/devel/source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/pick_place/pickplace_gr1t2_env_cfg.py>`__ to track the AVP wrist poses with lower latency.
However, this may lead to more jerky motion.
Separately, the finger joints of the robot are retargeted to the user's finger joints using the `dex-retargeting <https://github.com/dexsuite/dex-retargeting>`_ library.
Set up the CloudXR Runtime and Apple Vision Pro for teleoperation by following the steps in :ref:`cloudxr-teleoperation`. Set up the CloudXR Runtime and Apple Vision Pro for teleoperation by following the steps in :ref:`cloudxr-teleoperation`.
CPU simulation is used in the following steps for better XR performance when running a single environment. CPU simulation is used in the following steps for better XR performance when running a single environment.
Collect a set of human demonstrations using the command below. Collect a set of human demonstrations using the command below.
A success demo requires the object to be placed in the bin and for the robot's right arm to be retracted to the starting position. A success demo requires the object to be placed in the bin and for the robot's right arm to be retracted to the starting position.
The Isaac Lab Mimic Env GR-1 humanoid robot is set up such that the left hand has a single subtask, while the right hand has two subtasks.
The first subtask involves the right hand remaining idle while the left hand picks up and moves the object to the position where the right hand will grasp it.
This setup allows Isaac Lab Mimic to interpolate the right hand's trajectory accurately by using the object's pose, especially when poses are randomized during data generation.
Therefore, avoid moving the right hand while the left hand picks up the object and brings it to a stable position.
We recommend 10 successful demonstrations for good data generation results. We recommend 10 successful demonstrations for good data generation results.
.. code:: bash .. code:: bash
...@@ -345,7 +358,7 @@ We recommend 10 successful demonstrations for good data generation results. ...@@ -345,7 +358,7 @@ We recommend 10 successful demonstrations for good data generation results.
on the Apple Vision Pro or via voice control by saying "reset". See :ref:`teleoperate-apple-vision-pro` for more details. on the Apple Vision Pro or via voice control by saying "reset". See :ref:`teleoperate-apple-vision-pro` for more details.
Unlike the prior Franka stacking task, the GR-1 pick and place task uses manual annotation to define subtasks. Unlike the prior Franka stacking task, the GR-1 pick and place task uses manual annotation to define subtasks.
Each demo requires a single annotation which denotes when the right robot arm finishes the "idle" subtask and begins to Each demo requires a single annotation between the first and second subtask of the right arm. This annotation ("S" button press) should be done when the right robot arm finishes the "idle" subtask and begins to
move towards the target object. Annotate the demonstrations by running the following command: move towards the target object. Annotate the demonstrations by running the following command:
.. code:: bash .. code:: bash
...@@ -372,6 +385,9 @@ move towards the target object. Annotate the demonstrations by running the follo ...@@ -372,6 +385,9 @@ move towards the target object. Annotate the demonstrations by running the follo
Press "S" to annotate subtask signals. Press "S" to annotate subtask signals.
Press "Q" to skip the episode. Press "Q" to skip the episode.
.. note::
If the object does not get placed in the bin during annotation, you can press "N" to replay the episode and annotate again. Or you can press "Q" to skip the episode and annotate the next one.
Generate the dataset Generate the dataset
^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
......
...@@ -4,3 +4,4 @@ channels: ...@@ -4,3 +4,4 @@ channels:
dependencies: dependencies:
- python=3.10 - python=3.10
- importlib_metadata - importlib_metadata
- pinocchio===3.4.0 # pip install of pinocchio==3.4.0(required by isaac sim extensions) does not work with numpy<2
...@@ -57,6 +57,9 @@ import torch ...@@ -57,6 +57,9 @@ import torch
import isaaclab_mimic.envs # noqa: F401 import isaaclab_mimic.envs # noqa: F401
if args_cli.enable_pinocchio:
import isaaclab_mimic.envs.pinocchio_envs # noqa: F401
# Only enables inputs if this script is NOT headless mode # Only enables inputs if this script is NOT headless mode
if not args_cli.headless and not os.environ.get("HEADLESS", 0): if not args_cli.headless and not os.environ.get("HEADLESS", 0):
from isaaclab.devices import Se3Keyboard from isaaclab.devices import Se3Keyboard
...@@ -68,9 +71,6 @@ from isaaclab.utils import configclass ...@@ -68,9 +71,6 @@ from isaaclab.utils import configclass
from isaaclab.utils.datasets import EpisodeData, HDF5DatasetFileHandler from isaaclab.utils.datasets import EpisodeData, HDF5DatasetFileHandler
import isaaclab_tasks # noqa: F401 import isaaclab_tasks # noqa: F401
if args_cli.enable_pinocchio:
import isaaclab_tasks.manager_based.manipulation.pick_place # noqa: F401
from isaaclab_tasks.utils.parse_cfg import parse_env_cfg from isaaclab_tasks.utils.parse_cfg import parse_env_cfg
is_paused = False is_paused = False
......
...@@ -67,6 +67,9 @@ import omni ...@@ -67,6 +67,9 @@ import omni
from isaaclab.envs import ManagerBasedRLMimicEnv from isaaclab.envs import ManagerBasedRLMimicEnv
import isaaclab_mimic.envs # noqa: F401 import isaaclab_mimic.envs # noqa: F401
if args_cli.enable_pinocchio:
import isaaclab_mimic.envs.pinocchio_envs # noqa: F401
from isaaclab_mimic.datagen.generation import env_loop, setup_async_generation, setup_env_config from isaaclab_mimic.datagen.generation import env_loop, setup_async_generation, setup_env_config
from isaaclab_mimic.datagen.utils import get_env_name_from_dataset, setup_output_paths from isaaclab_mimic.datagen.utils import get_env_name_from_dataset, setup_output_paths
......
[package] [package]
# Note: Semantic Versioning is used: https://semver.org/ # Note: Semantic Versioning is used: https://semver.org/
version = "0.36.14" version = "0.36.15"
# Description # Description
title = "Isaac Lab framework for Robot Learning" title = "Isaac Lab framework for Robot Learning"
......
Changelog Changelog
--------- ---------
0.36.14 (2025-04-09) 0.36.15 (2025-04-09)
~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
Changed Changed
...@@ -12,7 +12,7 @@ Changed ...@@ -12,7 +12,7 @@ Changed
the cuda device, which results in NCCL errors on distributed setups. the cuda device, which results in NCCL errors on distributed setups.
0.36.13 (2025-04-01) 0.36.14 (2025-04-01)
~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
Fixed Fixed
...@@ -21,7 +21,7 @@ Fixed ...@@ -21,7 +21,7 @@ Fixed
* Added check in RecorderManager to ensure that the success indicator is only set if the termination manager is present. * Added check in RecorderManager to ensure that the success indicator is only set if the termination manager is present.
0.36.12 (2025-03-24) 0.36.13 (2025-03-24)
~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
Changed Changed
...@@ -31,6 +31,15 @@ Changed ...@@ -31,6 +31,15 @@ Changed
the default settings will be used from the experience files and the double definition is removed. the default settings will be used from the experience files and the double definition is removed.
0.36.12 (2025-03-19)
~~~~~~~~~~~~~~~~~~~~
Added
^^^^^
* Added parameter to show warning if Pink IK solver fails to find a solution.
0.36.11 (2025-03-19) 0.36.11 (2025-03-19)
~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
......
...@@ -113,7 +113,10 @@ class PinkIKController: ...@@ -113,7 +113,10 @@ class PinkIKController:
if Delta_q is None: if Delta_q is None:
# Print warning and return the current joint positions as the target # Print warning and return the current joint positions as the target
# Not using omni.log since its not available in CI during docs build # Not using omni.log since its not available in CI during docs build
print("Warning: IK quadratic solver could not find a solution! Did not update the target joint positions.") if self.cfg.show_ik_warnings:
print(
"Warning: IK quadratic solver could not find a solution! Did not update the target joint positions."
)
return torch.tensor(curr_joint_pos, device=self.device, dtype=torch.float32) return torch.tensor(curr_joint_pos, device=self.device, dtype=torch.float32)
# Discard the first 6 values (for root and universal joints) # Discard the first 6 values (for root and universal joints)
......
...@@ -54,3 +54,6 @@ class PinkIKControllerCfg: ...@@ -54,3 +54,6 @@ class PinkIKControllerCfg:
base_link_name: str = "base_link" base_link_name: str = "base_link"
"""The name of the base link in the USD asset.""" """The name of the base link in the USD asset."""
show_ik_warnings: bool = True
"""Show warning if IK solver fails to find a solution."""
...@@ -14,6 +14,7 @@ from isaacsim.core.utils.extensions import enable_extension ...@@ -14,6 +14,7 @@ from isaacsim.core.utils.extensions import enable_extension
enable_extension("isaacsim.asset.exporter.urdf") enable_extension("isaacsim.asset.exporter.urdf")
import nvidia.srl.tools.logger as logger
import omni.log import omni.log
from nvidia.srl.from_usd.to_urdf import UsdToUrdf from nvidia.srl.from_usd.to_urdf import UsdToUrdf
...@@ -33,6 +34,7 @@ def convert_usd_to_urdf(usd_path: str, output_path: str, force_conversion: bool ...@@ -33,6 +34,7 @@ def convert_usd_to_urdf(usd_path: str, output_path: str, force_conversion: bool
"edge_names_to_remove": None, "edge_names_to_remove": None,
"root": None, "root": None,
"parent_link_is_body_1": None, "parent_link_is_body_1": None,
"log_level": logger.level_from_name("ERROR"),
} }
urdf_output_dir = os.path.join(output_path, "urdf") urdf_output_dir = os.path.join(output_path, "urdf")
......
[package] [package]
# Semantic Versioning is used: https://semver.org/ # Semantic Versioning is used: https://semver.org/
version = "1.0.6" version = "1.0.7"
# Description # Description
category = "isaaclab" category = "isaaclab"
......
Changelog Changelog
--------- ---------
1.0.7 (2025-03-19)
~~~~~~~~~~~~~~~~~~
Changed
^^^^^^^
* Moved the GR1T2 robot task to a separate directory to prevent import of pinocchio when not needed. This allows use of IsaacLab Mimic in windows.
1.0.6 (2025-03-10) 1.0.6 (2025-03-10)
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
......
...@@ -13,8 +13,6 @@ from .franka_stack_ik_rel_blueprint_mimic_env_cfg import FrankaCubeStackIKRelBlu ...@@ -13,8 +13,6 @@ from .franka_stack_ik_rel_blueprint_mimic_env_cfg import FrankaCubeStackIKRelBlu
from .franka_stack_ik_rel_mimic_env import FrankaCubeStackIKRelMimicEnv from .franka_stack_ik_rel_mimic_env import FrankaCubeStackIKRelMimicEnv
from .franka_stack_ik_rel_mimic_env_cfg import FrankaCubeStackIKRelMimicEnvCfg from .franka_stack_ik_rel_mimic_env_cfg import FrankaCubeStackIKRelMimicEnvCfg
from .franka_stack_ik_rel_visuomotor_mimic_env_cfg import FrankaCubeStackIKRelVisuomotorMimicEnvCfg from .franka_stack_ik_rel_visuomotor_mimic_env_cfg import FrankaCubeStackIKRelVisuomotorMimicEnvCfg
from .pickplace_gr1t2_mimic_env import PickPlaceGR1T2MimicEnv
from .pickplace_gr1t2_mimic_env_cfg import PickPlaceGR1T2MimicEnvCfg
## ##
# Inverse Kinematics - Relative Pose Control # Inverse Kinematics - Relative Pose Control
...@@ -55,12 +53,3 @@ gym.register( ...@@ -55,12 +53,3 @@ gym.register(
}, },
disable_env_checker=True, disable_env_checker=True,
) )
gym.register(
id="Isaac-PickPlace-GR1T2-Abs-Mimic-v0",
entry_point="isaaclab_mimic.envs:PickPlaceGR1T2MimicEnv",
kwargs={
"env_cfg_entry_point": pickplace_gr1t2_mimic_env_cfg.PickPlaceGR1T2MimicEnvCfg,
},
disable_env_checker=True,
)
# Copyright (c) 2025, The Isaac Lab Project Developers.
# All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
"""Sub-package with environment wrappers for Isaac Lab Mimic."""
import gymnasium as gym
from .pickplace_gr1t2_mimic_env import PickPlaceGR1T2MimicEnv
from .pickplace_gr1t2_mimic_env_cfg import PickPlaceGR1T2MimicEnvCfg
gym.register(
id="Isaac-PickPlace-GR1T2-Abs-Mimic-v0",
entry_point="isaaclab_mimic.envs.pinocchio_envs:PickPlaceGR1T2MimicEnv",
kwargs={
"env_cfg_entry_point": pickplace_gr1t2_mimic_env_cfg.PickPlaceGR1T2MimicEnvCfg,
},
disable_env_checker=True,
)
...@@ -216,6 +216,7 @@ class ActionsCfg: ...@@ -216,6 +216,7 @@ class ActionsCfg:
articulation_name="robot", articulation_name="robot",
base_link_name="base_link", base_link_name="base_link",
num_hand_joints=22, num_hand_joints=22,
show_ik_warnings=False,
variable_input_tasks=[ variable_input_tasks=[
FrameTask( FrameTask(
"GR1T2_fourier_hand_6dof_left_hand_roll_link", "GR1T2_fourier_hand_6dof_left_hand_roll_link",
......
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