├── .gitignore ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── config └── extension.toml ├── isaacLab └── manipulation │ ├── __init__.py │ ├── assets │ ├── __init__.py │ ├── config │ │ ├── __init__.py │ │ ├── allegro.py │ │ ├── franka.py │ │ ├── kinova_gripper.py │ │ ├── shadow_hand.py │ │ └── universal_robots.py │ ├── urdf │ │ └── kinova_robotiq │ │ │ ├── .thumbs │ │ │ └── 256x256 │ │ │ │ └── kinova_chair.usd.png │ │ │ ├── CMakeLists.txt │ │ │ ├── build │ │ │ ├── .cmake │ │ │ │ └── api │ │ │ │ │ └── v1 │ │ │ │ │ └── query │ │ │ │ │ └── client-vscode │ │ │ │ │ └── query.json │ │ │ ├── CMakeCache.txt │ │ │ └── CMakeFiles │ │ │ │ ├── 3.16.3 │ │ │ │ ├── CMakeCCompiler.cmake │ │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ │ ├── CMakeSystem.cmake │ │ │ │ ├── CompilerIdC │ │ │ │ │ ├── CMakeCCompilerId.c │ │ │ │ │ └── a.out │ │ │ │ └── CompilerIdCXX │ │ │ │ │ ├── CMakeCXXCompilerId.cpp │ │ │ │ │ └── a.out │ │ │ │ ├── CMakeOutput.log │ │ │ │ └── cmake.check_cache │ │ │ ├── config │ │ │ ├── gazebo_initial_joint_positions.yaml │ │ │ ├── joint_limits.yaml │ │ │ └── twist_limits.yaml │ │ │ ├── launch │ │ │ └── load_wheelchair.launch │ │ │ ├── meshes │ │ │ ├── collision │ │ │ │ ├── base_link.STL │ │ │ │ ├── bracelet_no_vision_link.STL │ │ │ │ ├── bracelet_with_vision_link.STL │ │ │ │ ├── forearm_link.STL │ │ │ │ ├── half_arm_1_link.STL │ │ │ │ ├── half_arm_2_link.STL │ │ │ │ ├── robotiq_arg2f_85_base_link.stl │ │ │ │ ├── robotiq_arg2f_85_inner_finger.dae │ │ │ │ ├── robotiq_arg2f_85_inner_knuckle.dae │ │ │ │ ├── robotiq_arg2f_85_outer_finger.dae │ │ │ │ ├── robotiq_arg2f_85_outer_knuckle.dae │ │ │ │ ├── robotiq_arg2f_base_link.stl │ │ │ │ ├── shoulder_link.STL │ │ │ │ ├── spherical_wrist_1_link.STL │ │ │ │ └── spherical_wrist_2_link.STL │ │ │ └── visual │ │ │ │ ├── base_link.STL │ │ │ │ ├── bracelet_no_vision_link.STL │ │ │ │ ├── bracelet_with_vision_link.STL │ │ │ │ ├── forearm_link.STL │ │ │ │ ├── half_arm_1_link.STL │ │ │ │ ├── half_arm_2_link.STL │ │ │ │ ├── robotiq_arg2f_85_base_link.dae │ │ │ │ ├── robotiq_arg2f_85_inner_finger.dae │ │ │ │ ├── robotiq_arg2f_85_inner_knuckle.dae │ │ │ │ ├── robotiq_arg2f_85_outer_finger.dae │ │ │ │ ├── robotiq_arg2f_85_outer_knuckle.dae │ │ │ │ ├── robotiq_arg2f_85_pad.dae │ │ │ │ ├── robotiq_gripper_coupling.stl │ │ │ │ ├── shoulder_link.STL │ │ │ │ ├── spherical_wrist_1_link.STL │ │ │ │ └── spherical_wrist_2_link.STL │ │ │ ├── package.xml │ │ │ └── urdf │ │ │ └── kinova_robotiq.urdf │ └── usd │ │ ├── .asset_hash │ │ ├── config.yaml │ │ └── kinova_robotiq.usd │ └── tasks │ ├── Dextrous_hand │ ├── __init__.py │ └── inhand │ │ ├── __init__.py │ │ ├── config │ │ ├── __init__.py │ │ └── allegro_hand │ │ │ ├── __init__.py │ │ │ ├── agents │ │ │ ├── __init__.py │ │ │ ├── rl_games_ppo_cfg.yaml │ │ │ ├── rsl_rl_ppo_cfg.py │ │ │ └── skrl_ppo_cfg.yaml │ │ │ └── allegro_env_cfg.py │ │ ├── inhand_env_cfg.py │ │ └── mdp │ │ ├── __init__.py │ │ ├── actions │ │ ├── __init__.py │ │ ├── actions_cfg.py │ │ └── your_actions.py │ │ ├── commands │ │ ├── __init__.py │ │ ├── commands_cfg.py │ │ └── orientation_command.py │ │ ├── curriculums.py │ │ ├── events.py │ │ ├── observations.py │ │ ├── rewards.py │ │ └── terminations.py │ ├── Robot_arm │ ├── __init__.py │ ├── lift │ │ ├── __init__.py │ │ ├── config │ │ │ ├── __init__.py │ │ │ └── franka │ │ │ │ ├── __init__.py │ │ │ │ ├── agents │ │ │ │ ├── __init__.py │ │ │ │ ├── rl_games_ppo_cfg.yaml │ │ │ │ ├── robomimic │ │ │ │ │ ├── bc.json │ │ │ │ │ └── bcq.json │ │ │ │ ├── rsl_rl_ppo_cfg.py │ │ │ │ ├── sb3_ppo_cfg.yaml │ │ │ │ └── skrl_ppo_cfg.yaml │ │ │ │ ├── ik_abs_env_cfg.py │ │ │ │ ├── ik_rel_env_cfg.py │ │ │ │ └── joint_pos_env_cfg.py │ │ ├── lift_env_cfg.py │ │ └── mdp │ │ │ ├── __init__.py │ │ │ ├── observations.py │ │ │ ├── rewards.py │ │ │ └── terminations.py │ └── reach │ │ ├── __init__.py │ │ ├── config │ │ ├── __init__.py │ │ ├── franka │ │ │ ├── __init__.py │ │ │ ├── agents │ │ │ │ ├── __init__.py │ │ │ │ ├── rl_games_ppo_cfg.yaml │ │ │ │ ├── rsl_rl_ppo_cfg.py │ │ │ │ └── skrl_ppo_cfg.yaml │ │ │ ├── ik_abs_env_cfg.py │ │ │ ├── ik_rel_env_cfg.py │ │ │ ├── joint_pos_env_cfg.py │ │ │ └── osc_env_cfg.py │ │ ├── kinova_gripper │ │ │ ├── __init__.py │ │ │ ├── agents │ │ │ │ ├── rl_games_ppo_cfg.yaml │ │ │ │ ├── rsl_rl_ppo_cfg.py │ │ │ │ └── skrl_ppo_cfg.yaml │ │ │ └── joint_pos_env_cfg.py │ │ └── ur_10 │ │ │ ├── __init__.py │ │ │ ├── agents │ │ │ ├── __init__.py │ │ │ ├── rl_games_ppo_cfg.yaml │ │ │ ├── rsl_rl_ppo_cfg.py │ │ │ └── skrl_ppo_cfg.yaml │ │ │ └── joint_pos_env_cfg.py │ │ ├── mdp │ │ ├── __init__.py │ │ ├── actions │ │ │ ├── __init__.py │ │ │ ├── actions_cfg.py │ │ │ └── your_actions.py │ │ ├── commands │ │ │ ├── __init__.py │ │ │ ├── commands_cfg.py │ │ │ └── your_command.py │ │ ├── curriculums.py │ │ ├── events.py │ │ ├── observations.py │ │ ├── rewards.py │ │ └── terminations.py │ │ └── reach_env_cfg.py │ └── __init__.py ├── scripts ├── environments │ ├── list_envs.py │ ├── random_agent.py │ ├── state_machine │ │ ├── lift_cube_sm.py │ │ ├── lift_teddy_bear.py │ │ └── open_cabinet_sm.py │ ├── teleoperation │ │ ├── teleop_se3_agent.py │ │ ├── teleop_se3_receiver.py │ │ └── test_socket_communication.py │ └── zero_agent.py ├── isaaclab_mimic │ ├── annotate_demos.py │ ├── consolidated_demo.py │ └── generate_dataset.py ├── list_envs.py ├── rename_template.py ├── robomimic │ ├── play.py │ └── train.py ├── rsl_rl │ ├── cli_args.py │ ├── play.py │ └── train.py └── tools │ ├── blender_obj.py │ ├── check_instanceable.py │ ├── convert_mesh.py │ ├── convert_mjcf.py │ ├── convert_urdf.py │ ├── merge_hdf5_datasets.py │ ├── pretrained_checkpoint.py │ ├── process_meshes_to_obj.py │ ├── record_demos.py │ └── replay_demos.py ├── setup.py ├── test_env_registration.py └── test_ros2_install.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | cover/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | .pybuilder/ 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | # For a library or package, you might want to ignore these files since the code is 87 | # intended to run in multiple environments; otherwise, check them in: 88 | # .python-version 89 | 90 | # pipenv 91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 94 | # install all needed dependencies. 95 | #Pipfile.lock 96 | 97 | # poetry 98 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 99 | # This is especially recommended for binary packages to ensure reproducibility, and is more 100 | # commonly ignored for libraries. 101 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 102 | #poetry.lock 103 | 104 | # pdm 105 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 106 | #pdm.lock 107 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 108 | # in version control. 109 | # https://pdm.fming.dev/latest/usage/project/#working-with-version-control 110 | .pdm.toml 111 | .pdm-python 112 | .pdm-build/ 113 | 114 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 115 | __pypackages__/ 116 | 117 | # Celery stuff 118 | celerybeat-schedule 119 | celerybeat.pid 120 | 121 | # SageMath parsed files 122 | *.sage.py 123 | 124 | # Environments 125 | .env 126 | .venv 127 | env/ 128 | venv/ 129 | ENV/ 130 | env.bak/ 131 | venv.bak/ 132 | 133 | # Spyder project settings 134 | .spyderproject 135 | .spyproject 136 | 137 | # Rope project settings 138 | .ropeproject 139 | 140 | # mkdocs documentation 141 | /site 142 | 143 | # mypy 144 | .mypy_cache/ 145 | .dmypy.json 146 | dmypy.json 147 | 148 | # Pyre type checker 149 | .pyre/ 150 | 151 | # pytype static type analyzer 152 | .pytype/ 153 | 154 | # Cython debug symbols 155 | cython_debug/ 156 | 157 | # PyCharm 158 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 159 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 160 | # and can be added to the global gitignore or merged into this file. For a more nuclear 161 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 162 | #.idea/ 163 | 164 | .isaacLab/manipulation/algorithms/rsl_rl/* 165 | .outputs/* 166 | .logs/* 167 | 168 | .isaacLab/manipulation/FractFlow/* -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // This file is a template and is automatically generated by the setup_vscode.py script. 2 | // Do not edit this file directly. 3 | // 4 | // Generated from: /home/wufisher/workspace/dev/IsaacLab/.vscode/tools/settings.template.json 5 | { 6 | "files.associations": { 7 | "*.tpp": "cpp", 8 | "*.kit": "toml", 9 | "*.rst": "restructuredtext" 10 | }, 11 | "editor.rulers": [120], 12 | 13 | // files to be ignored by the linter 14 | "files.watcherExclude": { 15 | "**/.git/objects/**": true, 16 | "**/.git/subtree-cache/**": true, 17 | "**/node_modules/**": true, 18 | "**/_isaac_sim/**": true, 19 | "**/_compiler/**": true 20 | }, 21 | // Configuration for spelling checker 22 | "spellright.language": [ 23 | "en-US-10-1." 24 | ], 25 | "spellright.documentTypes": [ 26 | "markdown", 27 | "latex", 28 | "plaintext", 29 | "cpp", 30 | "asciidoc", 31 | "python", 32 | "restructuredtext" 33 | ], 34 | "cSpell.words": [ 35 | "literalinclude", 36 | "linenos", 37 | "instanceable", 38 | "isaacSim", 39 | "jacobians", 40 | "pointcloud", 41 | "ridgeback", 42 | "rllib", 43 | "robomimic", 44 | "teleoperation", 45 | "xform", 46 | "numpy", 47 | "tensordict", 48 | "flatcache", 49 | "physx", 50 | "dpad", 51 | "gamepad", 52 | "linspace", 53 | "upsampled", 54 | "downsampled", 55 | "arange", 56 | "discretization", 57 | "trimesh", 58 | "uninstanceable" 59 | ], 60 | // This enables python language server. Seems to work slightly better than jedi: 61 | "python.languageServer": "Pylance", 62 | // We use "black" as a formatter: 63 | "python.formatting.provider": "black", 64 | "python.formatting.blackArgs": ["--line-length", "120"], 65 | // Use flake8 for linting 66 | "python.linting.pylintEnabled": false, 67 | "python.linting.flake8Enabled": true, 68 | "python.linting.flake8Args": [ 69 | "--max-line-length=120" 70 | ], 71 | // Use docstring generator 72 | "autoDocstring.docstringFormat": "google", 73 | "autoDocstring.guessTypes": true, 74 | // Python environment path 75 | // note: the default interpreter is overridden when user selects a workspace interpreter 76 | // in the status bar. For example, the virtual environment python interpreter 77 | "python.defaultInterpreterPath": "~/miniconda3/envs/isaaclab/bin/python", 78 | // ROS distribution 79 | "ros.distro": "humble", 80 | // Language specific settings 81 | "[python]": { 82 | "editor.tabSize": 4 83 | }, 84 | "[restructuredtext]": { 85 | "editor.tabSize": 2 86 | }, 87 | // Python extra paths 88 | // Note: this is filled up when "./isaaclab.sh -i" is run 89 | "python.analysis.extraPaths": [ 90 | "~/workspace/dev/IsaacLab/source/extensions/isaaclab_assets", 91 | "~/workspace/dev/IsaacLab/source/extensions/isaaclab_tasks", 92 | "~/workspace/dev/IsaacLab/source/extensions/isaaclab" 93 | ] 94 | } 95 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 NathanWu7 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Manipulation Template for IsaacLab 2 | 3 | [![IsaacSim](https://img.shields.io/badge/IsaacSim-4.5.0-silver.svg)](https://docs.omniverse.nvidia.com/isaacsim/latest/overview.html) 4 | [![IsaacLab](https://img.shields.io/badge/IsaacLab-2.0.2-silver)](https://isaac-sim.github.io/IsaacLab/) 5 | [![Python](https://img.shields.io/badge/python-3.10-blue.svg)](https://docs.python.org/3/whatsnew/3.10.html) 6 | [![Linux platform](https://img.shields.io/badge/platform-linux--64-orange.svg)](https://releases.ubuntu.com/20.04/) 7 | [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://pre-commit.com/) 8 | [![License](https://img.shields.io/badge/license-MIT-yellow.svg)](https://opensource.org/license/mit) 9 | 10 | ## Overview 11 | 12 | This repository is based on the old version (orbit) of the orbit extension repository from isaaclab and provides a template for research on robot manipulation tasks. It is independent of isaaclab and allows for customization of the details of manipulation tasks. 13 | 14 | 15 | 16 | ## Setup 17 | 18 | 19 | 20 | ### Dependencies 21 | 22 | This template depends on Isaac Sim and IsaacLab. 23 | 24 | - [Isaac Sim](https://docs.omniverse.nvidia.com/isaacsim/latest/index.html) 25 | - [Isaac Lab](https://isaac-sim.github.io/IsaacLab/) 26 | 27 | It is recommended to install in a virtual environment. IsaacLab provides a default virtual environment that can be activated directly. 28 | ```bash 29 | # Activate conda environment 30 | conda activate isaaclab 31 | ``` 32 | ### Download 33 | ```bash 34 | git clone https://github.com/NathanWu7/isaacLab.manipulation.git 35 | cd isaacLab.manipulation 36 | python -m pip install -e . 37 | ``` 38 | 39 | ### Convert urdf to usd 40 | ```bash 41 | # urdf files in isaacLab.manipulation/isaacLab/manipulation/assets/urdf 42 | # usd files in isaacLab.manipulation/isaacLab/manipulation/assets/usd 43 | python3 scripts/tools/convert_urdf.py urdf/your_urdf.urdf usd/your_usd.usd 44 | ``` 45 | ### About isaac nucleus 46 | If you dont want to use the assets in isaac nucleus, please comment the following code and replace it with your own assets path. 47 | ```bash 48 | from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR 49 | # from isaacLab.manipulation.assets.config import your_robot 50 | ``` 51 | ### RL Algorithm 52 | 53 | Install [RSL_RL](https://github.com/leggedrobotics/rsl_rl) outside of the isaacLab repository, e.g. `home/code/rsl_rl`. 54 | 55 | ```bash 56 | mkdir isaacLab.manipulation/isaacLab/manipulation/algorithms 57 | cd isaacLab.manipulation/isaacLab/manipulation/algorithms 58 | git clone https://github.com/leggedrobotics/rsl_rl.git 59 | cd rsl_rl 60 | # IMPORTANT: Use a specific version of rsl_rl that is compatible with this project 61 | git checkout 73fd7c6 # v2.0.1 release 62 | python -m pip install -e . 63 | 64 | ## refresh index 65 | cd isaacLab.manipulation 66 | python -m pip install -e . 67 | ``` 68 | You can design your own RL Algorithm by editing "modules" and "algorithms" in RSL-RL 69 | 70 | ## Usage 71 | ```bash 72 | #root of the package 73 | cd isaacLab.manipulation 74 | ``` 75 | ### 1. Convert your urdf to usd 76 | ```bash 77 | python3 scripts/tools/convert_urdf.py urdf/your_urdf.urdf usd/your_usd.usd 78 | ``` 79 | ### 2. Set up your robot or objects 80 | ```bash 81 | cd isaacLab.manipulation/isaacLab/manipulation/assets/config 82 | touch your_robot.py 83 | # kinova_gipper.py is an example. You can copy the file and change robot_usd = "kinova_robotiq.usd" to your own usd and apply some changes in ArticulationCfg 84 | ``` 85 | And add env configs for each tasks 86 | ```bash 87 | mkdir isaacLab.manipulation/isaacLab/manipulation/tasks/Robot_arm/your_tasks/config/your_robot_env 88 | # kinova_gripper in reach task is an example 89 | ``` 90 | ### 3. RL settings 91 | You can modify *actions/rewards/observations/events/terminations* in the directory "mdp" to set up your own RL settings and you can manage them uniformly in "env_cfg" outside "mdp". These files modify the functions of the original isaaclab through rewritting and overloading. 92 | 93 | ### IMPORTANT ISSUES 94 | 1. 'RigidBodyView' object has no attribute 'get_accelerations. 95 |
Solution: Update Isaac Sim to version 4.1.0. 96 | 2. argument --cpu: conflicting option string: --cpu 97 |
Solution: Annotate the following code in *play.py* and *train.py*: 98 | ```python 99 | parser.add_argument("--cpu", action="store_true", default=False, help="Use CPU pipeline.") 100 | ``` 101 |
Then remove "use_gpu = not args_cli.cpu" in the following code: 102 | ```python 103 | parse_env_cfg(args_cli.task, use_gpu=not args_cli.cpu, num_envs=args_cli.num_envs) 104 | ``` 105 | 106 | ### 4. Train a policy. 107 | 4.1 RobotArm 108 | ```bash 109 | python3 scripts/rsl_rl/train.py --task Template-Isaac-Reach-Kinova-v0 --num_envs 4096 --headless 110 | ``` 111 | ```bash 112 | python3 scripts/rsl_rl/train.py --task Template-Isaac-Reach-Franka-v0 --num_envs 4096 --headless 113 | ``` 114 | ```bash 115 | python3 scripts/rsl_rl/train.py --task Template-Isaac-Reach-UR10-v0 --num_envs 4096 --headless 116 | ``` 117 | 4.2 Dextrous Hand 118 | ```bash 119 | python3 scripts/rsl_rl/train.py --task Template-Isaac-Repose-Cube-Allegro-v0 --num_envs 4096 --headless 120 | ``` 121 | 122 | 123 | ### 5. Play the trained policy. 124 | 125 | 5.1 RobotArm 126 | ```bash 127 | python3 scripts/rsl_rl/play.py --task Template-Isaac-Reach-Kinova-Play-v0 --num_envs 16 128 | ``` 129 | ```bash 130 | # You can also use train.py if you dont need to add some additional configs. 131 | python3 scripts/rsl_rl/play.py --task Template-Isaac-Reach-Franka-Play-v0 --num_envs 16 132 | ``` 133 | ```bash 134 | python3 scripts/rsl_rl/play.py --task Template-Isaac-Reach-UR10-Play-v0 --num_envs 16 135 | ``` 136 | 5.2 Dextrous Hand 137 | ```bash 138 | python3 scripts/rsl_rl/play.py --task Template-Isaac-Repose-Cube-Allegro-Play-v0 --num_envs 16 139 | ``` 140 | 141 | ## Author 142 | **Author: Qiwei Wu
143 | Email: nathan.wuqw@gmail.com** 144 | 145 | 146 | 147 | 148 | 149 | -------------------------------------------------------------------------------- /config/extension.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | 3 | # Semantic Versioning is used: https://semver.org/ 4 | version = "0.1.0" 5 | 6 | # Description 7 | category = "isaacLab.manipulation" 8 | readme = "README.md" 9 | 10 | # TODO: Change your package specifications 11 | # ----------------------------------------------------------------- 12 | title = "Extension Template" 13 | author = "Qiwei Wu" 14 | maintainer = "Qiwei Wu/Sony Research & Development Center China" 15 | maintainer_email = "nathan.wuqw@gmail.com" 16 | description="Manipulation Extension Template for isaacLab" 17 | repository = "https://github.com/NathanWu7/isaacLab.manipulation.git" 18 | keywords = ["extension", "template", "isaacLab"] 19 | # ----------------------------------------------------------------- 20 | 21 | [dependencies] 22 | "isaaclab" = {} 23 | "isaaclab_assets" = {} 24 | "isaaclab_tasks" = {} 25 | # NOTE: Add additional dependencies here 26 | 27 | [[python.module]] 28 | # TODO: Change your package name 29 | # ----------------------------------------------------------------- 30 | name = "isaacLab.manipulation" 31 | # ----------------------------------------------------------------- 32 | 33 | [lab_settings] 34 | # TODO: Uncomment and list any apt dependencies here. 35 | # If none, leave it commented out. 36 | # apt_deps = ["example_package"] 37 | # TODO: Uncomment and provide path to a ros_ws 38 | # with rosdeps to be installed. If none, 39 | # leave it commented out. 40 | # ros_ws = "path/from/extension_root/to/ros_ws" 41 | -------------------------------------------------------------------------------- /isaacLab/manipulation/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Python module serving as a project/extension template. 3 | """ 4 | 5 | # Register Gym environments. 6 | from .tasks import * 7 | from .assets import * 8 | from .algorithms import * 9 | 10 | -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/__init__.py: -------------------------------------------------------------------------------- 1 | from .usd import * 2 | from .config import * 3 | -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/config/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | ## 7 | # Configuration for different assets. 8 | ## 9 | 10 | from .allegro import * 11 | from .franka import * 12 | from .shadow_hand import * 13 | from .universal_robots import * 14 | from .kinova_gripper import * 15 | -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/config/allegro.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Configuration for the Allegro Hand robots from Wonik Robotics. 7 | 8 | The following configurations are available: 9 | 10 | * :obj:`ALLEGRO_HAND_CFG`: Allegro Hand with implicit actuator model. 11 | 12 | Reference: 13 | 14 | * https://www.wonikrobotics.com/robot-hand 15 | 16 | """ 17 | 18 | 19 | import math 20 | 21 | import isaaclab.sim as sim_utils 22 | from isaaclab.actuators.actuator_cfg import ImplicitActuatorCfg 23 | from isaaclab.assets.articulation import ArticulationCfg 24 | from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR 25 | 26 | ## 27 | # Configuration 28 | ## 29 | 30 | ALLEGRO_HAND_CFG = ArticulationCfg( 31 | spawn=sim_utils.UsdFileCfg( 32 | usd_path=f"{ISAAC_NUCLEUS_DIR}/Robots/AllegroHand/allegro_hand_instanceable.usd", 33 | activate_contact_sensors=False, 34 | rigid_props=sim_utils.RigidBodyPropertiesCfg( 35 | disable_gravity=True, 36 | retain_accelerations=False, 37 | enable_gyroscopic_forces=False, 38 | angular_damping=0.01, 39 | max_linear_velocity=1000.0, 40 | max_angular_velocity=64 / math.pi * 180.0, 41 | max_depenetration_velocity=1000.0, 42 | max_contact_impulse=1e32, 43 | ), 44 | articulation_props=sim_utils.ArticulationRootPropertiesCfg( 45 | enabled_self_collisions=True, 46 | solver_position_iteration_count=8, 47 | solver_velocity_iteration_count=0, 48 | sleep_threshold=0.005, 49 | stabilization_threshold=0.0005, 50 | ), 51 | # collision_props=sim_utils.CollisionPropertiesCfg(contact_offset=0.005, rest_offset=0.0), 52 | ), 53 | init_state=ArticulationCfg.InitialStateCfg( 54 | pos=(0.0, 0.0, 0.5), 55 | rot=(0.257551, 0.283045, 0.683330, -0.621782), 56 | joint_pos={"^(?!thumb_joint_0).*": 0.0, "thumb_joint_0": 0.28}, 57 | ), 58 | actuators={ 59 | "fingers": ImplicitActuatorCfg( 60 | joint_names_expr=[".*"], 61 | effort_limit=0.5, 62 | velocity_limit=100.0, 63 | stiffness=3.0, 64 | damping=0.1, 65 | friction=0.01, 66 | ), 67 | }, 68 | soft_joint_pos_limit_factor=1.0, 69 | ) 70 | """Configuration of Allegro Hand robot.""" 71 | -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/config/franka.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Configuration for the Franka Emika robots. 7 | 8 | The following configurations are available: 9 | 10 | * :obj:`FRANKA_PANDA_CFG`: Franka Emika Panda robot with Panda hand 11 | * :obj:`FRANKA_PANDA_HIGH_PD_CFG`: Franka Emika Panda robot with Panda hand with stiffer PD control 12 | 13 | Reference: https://github.com/frankaemika/franka_ros 14 | """ 15 | 16 | import isaaclab.sim as sim_utils 17 | from isaaclab.actuators import ImplicitActuatorCfg 18 | from isaaclab.assets.articulation import ArticulationCfg 19 | from isaaclab.utils.assets import ISAACLAB_NUCLEUS_DIR 20 | 21 | ## 22 | # Configuration 23 | ## 24 | 25 | FRANKA_PANDA_CFG = ArticulationCfg( 26 | spawn=sim_utils.UsdFileCfg( 27 | usd_path=f"{ISAACLAB_NUCLEUS_DIR}/Robots/FrankaEmika/panda_instanceable.usd", 28 | activate_contact_sensors=False, 29 | rigid_props=sim_utils.RigidBodyPropertiesCfg( 30 | disable_gravity=False, 31 | max_depenetration_velocity=5.0, 32 | ), 33 | articulation_props=sim_utils.ArticulationRootPropertiesCfg( 34 | enabled_self_collisions=True, solver_position_iteration_count=8, solver_velocity_iteration_count=0 35 | ), 36 | # collision_props=sim_utils.CollisionPropertiesCfg(contact_offset=0.005, rest_offset=0.0), 37 | ), 38 | init_state=ArticulationCfg.InitialStateCfg( 39 | joint_pos={ 40 | "panda_joint1": 0.0, 41 | "panda_joint2": -0.569, 42 | "panda_joint3": 0.0, 43 | "panda_joint4": -2.810, 44 | "panda_joint5": 0.0, 45 | "panda_joint6": 3.037, 46 | "panda_joint7": 0.741, 47 | "panda_finger_joint.*": 0.04, 48 | }, 49 | ), 50 | actuators={ 51 | "panda_shoulder": ImplicitActuatorCfg( 52 | joint_names_expr=["panda_joint[1-4]"], 53 | effort_limit=87.0, 54 | velocity_limit=2.175, 55 | stiffness=80.0, 56 | damping=4.0, 57 | ), 58 | "panda_forearm": ImplicitActuatorCfg( 59 | joint_names_expr=["panda_joint[5-7]"], 60 | effort_limit=12.0, 61 | velocity_limit=2.61, 62 | stiffness=80.0, 63 | damping=4.0, 64 | ), 65 | "panda_hand": ImplicitActuatorCfg( 66 | joint_names_expr=["panda_finger_joint.*"], 67 | effort_limit=200.0, 68 | velocity_limit=0.2, 69 | stiffness=2e3, 70 | damping=1e2, 71 | ), 72 | }, 73 | soft_joint_pos_limit_factor=1.0, 74 | ) 75 | """Configuration of Franka Emika Panda robot.""" 76 | 77 | 78 | FRANKA_PANDA_HIGH_PD_CFG = FRANKA_PANDA_CFG.copy() 79 | FRANKA_PANDA_HIGH_PD_CFG.spawn.rigid_props.disable_gravity = True 80 | FRANKA_PANDA_HIGH_PD_CFG.actuators["panda_shoulder"].stiffness = 400.0 81 | FRANKA_PANDA_HIGH_PD_CFG.actuators["panda_shoulder"].damping = 80.0 82 | FRANKA_PANDA_HIGH_PD_CFG.actuators["panda_forearm"].stiffness = 400.0 83 | FRANKA_PANDA_HIGH_PD_CFG.actuators["panda_forearm"].damping = 80.0 84 | """Configuration of Franka Emika Panda robot with stiffer PD control. 85 | 86 | This configuration is useful for task-space control using differential IK. 87 | """ 88 | -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/config/kinova_gripper.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2024, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Configuration for the Kinova Robotics arms. 7 | 8 | The following configuration parameters are available: 9 | 10 | * :obj:`KINOVA_JACO2_N7S300_CFG`: The Kinova JACO2 (7-Dof) arm with a 3-finger gripper. 11 | * :obj:`KINOVA_JACO2_N6S300_CFG`: The Kinova JACO2 (6-Dof) arm with a 3-finger gripper. 12 | * :obj:`KINOVA_GEN3_N7_CFG`: The Kinova Gen3 (7-Dof) arm with no gripper. 13 | 14 | Reference: https://github.com/Kinovarobotics/kinova-ros 15 | """ 16 | 17 | import isaaclab.sim as sim_utils 18 | from isaaclab.actuators import ImplicitActuatorCfg 19 | from isaaclab.assets.articulation import ArticulationCfg 20 | import os 21 | 22 | BASE_DIR = os.path.dirname(os.path.abspath(__file__)) 23 | usd_dir_path = os.path.join(BASE_DIR, "../usd/") 24 | 25 | robot_usd = "kinova_robotiq.usd" 26 | 27 | ## 28 | # Configuration 29 | ## 30 | 31 | KINOVA_ROBOTIQ = ArticulationCfg( 32 | spawn=sim_utils.UsdFileCfg( 33 | usd_path=usd_dir_path + robot_usd, 34 | rigid_props=sim_utils.RigidBodyPropertiesCfg( 35 | disable_gravity=True, 36 | max_depenetration_velocity=5.0, 37 | ), 38 | articulation_props=sim_utils.ArticulationRootPropertiesCfg( 39 | enabled_self_collisions=True, solver_position_iteration_count=8, solver_velocity_iteration_count=0, 40 | fix_root_link = True 41 | ), 42 | activate_contact_sensors=False, 43 | ), 44 | init_state=ArticulationCfg.InitialStateCfg( 45 | joint_pos={ 46 | "joint_1": 0.0, 47 | "joint_2": 0.785, 48 | "joint_3": 3.14159, 49 | "joint_4": 1.4, 50 | "joint_5": 0.0, 51 | "joint_6": 1.57, 52 | "joint_7": 1.57, 53 | "finger_joint": 0.0, 54 | "left_inner_knuckle_joint": 0.0, 55 | "left_inner_finger_joint": 0.0, 56 | "right_outer_knuckle_joint": 0.0, 57 | "right_inner_knuckle_joint": 0.0, 58 | "right_inner_finger_joint": 0.0, 59 | }, 60 | ), 61 | actuators={ 62 | "arm": ImplicitActuatorCfg( 63 | joint_names_expr=["joint_[1-7]"], 64 | velocity_limit=1.2, 65 | effort_limit={ 66 | "joint_[1-4]": 39.0, 67 | "joint_[5-7]": 9.0, 68 | }, 69 | stiffness={ 70 | "joint_[1-4]": 300.0, #100 71 | "joint_[5-7]": 200.0, # 15 72 | }, 73 | damping={ 74 | "joint_[1-4]": 10.0, # 1.0 75 | "joint_[5-7]": 5.0, #0.5 76 | }, 77 | ), 78 | "hand": ImplicitActuatorCfg( 79 | joint_names_expr=["right_outer_knuckle_joint","finger_joint"], 80 | effort_limit=150.0, 81 | velocity_limit=2.24, 82 | stiffness=10.0, 83 | damping=10.0, 84 | ), 85 | "hand_mimic": ImplicitActuatorCfg( 86 | joint_names_expr=["left_inner_knuckle_joint","left_inner_finger_joint", 87 | "right_inner_knuckle_joint","right_inner_finger_joint"], 88 | effort_limit=150.0, 89 | velocity_limit=2.24, 90 | stiffness=0.0, 91 | damping=5000.0, 92 | ), 93 | }, 94 | ) 95 | 96 | """Configuration of robot with stiffer PD control.""" 97 | KINOVA_ROBOTIQ_HPD = ArticulationCfg( 98 | spawn=sim_utils.UsdFileCfg( 99 | usd_path=usd_dir_path + robot_usd, 100 | rigid_props=sim_utils.RigidBodyPropertiesCfg( 101 | disable_gravity=True, 102 | max_depenetration_velocity=5.0, 103 | ), 104 | articulation_props=sim_utils.ArticulationRootPropertiesCfg( 105 | enabled_self_collisions=True, solver_position_iteration_count=8, solver_velocity_iteration_count=0, 106 | fix_root_link = True 107 | ), 108 | activate_contact_sensors=False, 109 | ), 110 | init_state=ArticulationCfg.InitialStateCfg( 111 | joint_pos={ 112 | "joint_1": 0.0, 113 | "joint_2": 0.785, 114 | "joint_3": 3.14159, 115 | "joint_4": 1.4, 116 | "joint_5": 0.0, 117 | "joint_6": 0.0, 118 | "joint_7": -1.57, 119 | "finger_joint": 0.0, 120 | "left_inner_knuckle_joint": 0.0, 121 | "left_inner_finger_joint": 0.0, 122 | "right_outer_knuckle_joint": 0.0, 123 | "right_inner_knuckle_joint": 0.0, 124 | "right_inner_finger_joint": 0.0, 125 | }, 126 | ), 127 | actuators={ 128 | "arm": ImplicitActuatorCfg( 129 | joint_names_expr=["joint_[1-7]"], 130 | velocity_limit=2.0, 131 | effort_limit={ 132 | "joint_[1-4]": 39.0, 133 | "joint_[5-7]": 9.0, 134 | }, 135 | stiffness={ 136 | "joint_[1-4]": 600.0, #100 137 | "joint_[5-7]": 450.0, # 15 138 | }, 139 | damping={ 140 | "joint_[1-4]": 30.0, # 1.0 141 | "joint_[5-7]": 15.0, #0.5 142 | }, 143 | ), 144 | "hand": ImplicitActuatorCfg( 145 | joint_names_expr=["left_inner_knuckle_joint","left_inner_finger_joint", 146 | "right_inner_knuckle_joint","right_outer_knuckle_joint","right_inner_finger_joint","finger_joint"], 147 | effort_limit=150.0, 148 | velocity_limit=2.24, 149 | stiffness=5.0, 150 | damping=5.0, 151 | ), 152 | }, 153 | ) 154 | -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/config/shadow_hand.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Configuration for the dexterous hand from Shadow Robot. 7 | 8 | The following configurations are available: 9 | 10 | * :obj:`SHADOW_HAND_CFG`: Shadow Hand with implicit actuator model. 11 | 12 | Reference: 13 | 14 | * https://www.shadowrobot.com/dexterous-hand-series/ 15 | 16 | """ 17 | 18 | 19 | import isaaclab.sim as sim_utils 20 | from isaaclab.actuators.actuator_cfg import ImplicitActuatorCfg 21 | from isaaclab.assets.articulation import ArticulationCfg 22 | from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR 23 | 24 | ## 25 | # Configuration 26 | ## 27 | 28 | SHADOW_HAND_CFG = ArticulationCfg( 29 | spawn=sim_utils.UsdFileCfg( 30 | usd_path=f"{ISAAC_NUCLEUS_DIR}/Robots/ShadowHand/shadow_hand_instanceable.usd", 31 | activate_contact_sensors=False, 32 | rigid_props=sim_utils.RigidBodyPropertiesCfg( 33 | disable_gravity=True, 34 | retain_accelerations=True, 35 | max_depenetration_velocity=1000.0, 36 | ), 37 | articulation_props=sim_utils.ArticulationRootPropertiesCfg( 38 | enabled_self_collisions=True, 39 | solver_position_iteration_count=8, 40 | solver_velocity_iteration_count=0, 41 | sleep_threshold=0.005, 42 | stabilization_threshold=0.0005, 43 | ), 44 | # collision_props=sim_utils.CollisionPropertiesCfg(contact_offset=0.005, rest_offset=0.0), 45 | joint_drive_props=sim_utils.JointDrivePropertiesCfg(drive_type="force"), 46 | fixed_tendons_props=sim_utils.FixedTendonPropertiesCfg(limit_stiffness=30.0, damping=0.1), 47 | ), 48 | init_state=ArticulationCfg.InitialStateCfg( 49 | pos=(0.0, 0.0, 0.5), 50 | rot=(0.0, 0.0, -0.7071, 0.7071), 51 | joint_pos={".*": 0.0}, 52 | ), 53 | actuators={ 54 | "fingers": ImplicitActuatorCfg( 55 | joint_names_expr=["robot0_WR.*", "robot0_(FF|MF|RF|LF|TH)J(3|2|1)", "robot0_(LF|TH)J4", "robot0_THJ0"], 56 | effort_limit={ 57 | "robot0_WRJ1": 4.785, 58 | "robot0_WRJ0": 2.175, 59 | "robot0_(FF|MF|RF|LF)J1": 0.7245, 60 | "robot0_FFJ(3|2)": 0.9, 61 | "robot0_MFJ(3|2)": 0.9, 62 | "robot0_RFJ(3|2)": 0.9, 63 | "robot0_LFJ(4|3|2)": 0.9, 64 | "robot0_THJ4": 2.3722, 65 | "robot0_THJ3": 1.45, 66 | "robot0_THJ(2|1)": 0.99, 67 | "robot0_THJ0": 0.81, 68 | }, 69 | stiffness={ 70 | "robot0_WRJ.*": 5.0, 71 | "robot0_(FF|MF|RF|LF|TH)J(3|2|1)": 1.0, 72 | "robot0_(LF|TH)J4": 1.0, 73 | "robot0_THJ0": 1.0, 74 | }, 75 | damping={ 76 | "robot0_WRJ.*": 0.5, 77 | "robot0_(FF|MF|RF|LF|TH)J(3|2|1)": 0.1, 78 | "robot0_(LF|TH)J4": 0.1, 79 | "robot0_THJ0": 0.1, 80 | }, 81 | ), 82 | }, 83 | soft_joint_pos_limit_factor=1.0, 84 | ) 85 | """Configuration of Shadow Hand robot.""" 86 | -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/config/universal_robots.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Configuration for the Universal Robots. 7 | 8 | The following configuration parameters are available: 9 | 10 | * :obj:`UR10_CFG`: The UR10 arm without a gripper. 11 | 12 | Reference: https://github.com/ros-industrial/universal_robot 13 | """ 14 | 15 | import isaaclab.sim as sim_utils 16 | from isaaclab.actuators import ImplicitActuatorCfg 17 | from isaaclab.assets.articulation import ArticulationCfg 18 | from isaaclab.utils.assets import ISAACLAB_NUCLEUS_DIR 19 | 20 | ## 21 | # Configuration 22 | ## 23 | 24 | 25 | UR10_CFG = ArticulationCfg( 26 | spawn=sim_utils.UsdFileCfg( 27 | usd_path=f"{ISAACLAB_NUCLEUS_DIR}/Robots/UniversalRobots/UR10/ur10_instanceable.usd", 28 | rigid_props=sim_utils.RigidBodyPropertiesCfg( 29 | disable_gravity=False, 30 | max_depenetration_velocity=5.0, 31 | ), 32 | activate_contact_sensors=False, 33 | ), 34 | init_state=ArticulationCfg.InitialStateCfg( 35 | joint_pos={ 36 | "shoulder_pan_joint": 0.0, 37 | "shoulder_lift_joint": -1.712, 38 | "elbow_joint": 1.712, 39 | "wrist_1_joint": 0.0, 40 | "wrist_2_joint": 0.0, 41 | "wrist_3_joint": 0.0, 42 | }, 43 | ), 44 | actuators={ 45 | "arm": ImplicitActuatorCfg( 46 | joint_names_expr=[".*"], 47 | velocity_limit=100.0, 48 | effort_limit=87.0, 49 | stiffness=800.0, 50 | damping=40.0, 51 | ), 52 | }, 53 | ) 54 | """Configuration of UR-10 arm using implicit actuator models.""" 55 | -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/.thumbs/256x256/kinova_chair.usd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/.thumbs/256x256/kinova_chair.usd.png -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/build/.cmake/api/v1/query/client-vscode/query.json: -------------------------------------------------------------------------------- 1 | {"requests":[{"kind":"cache","version":2},{"kind":"codemodel","version":2},{"kind":"toolchains","version":1},{"kind":"cmakeFiles","version":1}]} -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/build/CMakeFiles/3.16.3/CMakeCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "/usr/bin/cc") 2 | set(CMAKE_C_COMPILER_ARG1 "") 3 | set(CMAKE_C_COMPILER_ID "GNU") 4 | set(CMAKE_C_COMPILER_VERSION "9.4.0") 5 | set(CMAKE_C_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_C_COMPILER_WRAPPER "") 7 | set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") 8 | set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") 9 | set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") 10 | set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") 11 | set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") 12 | 13 | set(CMAKE_C_PLATFORM_ID "Linux") 14 | set(CMAKE_C_SIMULATE_ID "") 15 | set(CMAKE_C_COMPILER_FRONTEND_VARIANT "") 16 | set(CMAKE_C_SIMULATE_VERSION "") 17 | 18 | 19 | 20 | set(CMAKE_AR "/usr/bin/ar") 21 | set(CMAKE_C_COMPILER_AR "/usr/bin/gcc-ar-9") 22 | set(CMAKE_RANLIB "/usr/bin/ranlib") 23 | set(CMAKE_C_COMPILER_RANLIB "/usr/bin/gcc-ranlib-9") 24 | set(CMAKE_LINKER "/usr/bin/ld") 25 | set(CMAKE_MT "") 26 | set(CMAKE_COMPILER_IS_GNUCC 1) 27 | set(CMAKE_C_COMPILER_LOADED 1) 28 | set(CMAKE_C_COMPILER_WORKS TRUE) 29 | set(CMAKE_C_ABI_COMPILED TRUE) 30 | set(CMAKE_COMPILER_IS_MINGW ) 31 | set(CMAKE_COMPILER_IS_CYGWIN ) 32 | if(CMAKE_COMPILER_IS_CYGWIN) 33 | set(CYGWIN 1) 34 | set(UNIX 1) 35 | endif() 36 | 37 | set(CMAKE_C_COMPILER_ENV_VAR "CC") 38 | 39 | if(CMAKE_COMPILER_IS_MINGW) 40 | set(MINGW 1) 41 | endif() 42 | set(CMAKE_C_COMPILER_ID_RUN 1) 43 | set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) 44 | set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 45 | set(CMAKE_C_LINKER_PREFERENCE 10) 46 | 47 | # Save compiler ABI information. 48 | set(CMAKE_C_SIZEOF_DATA_PTR "8") 49 | set(CMAKE_C_COMPILER_ABI "ELF") 50 | set(CMAKE_C_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 51 | 52 | if(CMAKE_C_SIZEOF_DATA_PTR) 53 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") 54 | endif() 55 | 56 | if(CMAKE_C_COMPILER_ABI) 57 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") 58 | endif() 59 | 60 | if(CMAKE_C_LIBRARY_ARCHITECTURE) 61 | set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 62 | endif() 63 | 64 | set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") 65 | if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) 66 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") 67 | endif() 68 | 69 | 70 | 71 | 72 | 73 | set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/9/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include") 74 | set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc;gcc_s;c;gcc;gcc_s") 75 | set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") 76 | set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 77 | -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/build/CMakeFiles/3.16.3/CMakeCXXCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_COMPILER "/usr/bin/c++") 2 | set(CMAKE_CXX_COMPILER_ARG1 "") 3 | set(CMAKE_CXX_COMPILER_ID "GNU") 4 | set(CMAKE_CXX_COMPILER_VERSION "9.4.0") 5 | set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_CXX_COMPILER_WRAPPER "") 7 | set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") 8 | set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20") 9 | set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") 10 | set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") 11 | set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") 12 | set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") 13 | set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") 14 | 15 | set(CMAKE_CXX_PLATFORM_ID "Linux") 16 | set(CMAKE_CXX_SIMULATE_ID "") 17 | set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "") 18 | set(CMAKE_CXX_SIMULATE_VERSION "") 19 | 20 | 21 | 22 | set(CMAKE_AR "/usr/bin/ar") 23 | set(CMAKE_CXX_COMPILER_AR "/usr/bin/gcc-ar-9") 24 | set(CMAKE_RANLIB "/usr/bin/ranlib") 25 | set(CMAKE_CXX_COMPILER_RANLIB "/usr/bin/gcc-ranlib-9") 26 | set(CMAKE_LINKER "/usr/bin/ld") 27 | set(CMAKE_MT "") 28 | set(CMAKE_COMPILER_IS_GNUCXX 1) 29 | set(CMAKE_CXX_COMPILER_LOADED 1) 30 | set(CMAKE_CXX_COMPILER_WORKS TRUE) 31 | set(CMAKE_CXX_ABI_COMPILED TRUE) 32 | set(CMAKE_COMPILER_IS_MINGW ) 33 | set(CMAKE_COMPILER_IS_CYGWIN ) 34 | if(CMAKE_COMPILER_IS_CYGWIN) 35 | set(CYGWIN 1) 36 | set(UNIX 1) 37 | endif() 38 | 39 | set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") 40 | 41 | if(CMAKE_COMPILER_IS_MINGW) 42 | set(MINGW 1) 43 | endif() 44 | set(CMAKE_CXX_COMPILER_ID_RUN 1) 45 | set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) 46 | set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) 47 | 48 | foreach (lang C OBJC OBJCXX) 49 | if (CMAKE_${lang}_COMPILER_ID_RUN) 50 | foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) 51 | list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) 52 | endforeach() 53 | endif() 54 | endforeach() 55 | 56 | set(CMAKE_CXX_LINKER_PREFERENCE 30) 57 | set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) 58 | 59 | # Save compiler ABI information. 60 | set(CMAKE_CXX_SIZEOF_DATA_PTR "8") 61 | set(CMAKE_CXX_COMPILER_ABI "ELF") 62 | set(CMAKE_CXX_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 63 | 64 | if(CMAKE_CXX_SIZEOF_DATA_PTR) 65 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") 66 | endif() 67 | 68 | if(CMAKE_CXX_COMPILER_ABI) 69 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") 70 | endif() 71 | 72 | if(CMAKE_CXX_LIBRARY_ARCHITECTURE) 73 | set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 74 | endif() 75 | 76 | set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") 77 | if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) 78 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") 79 | endif() 80 | 81 | 82 | 83 | 84 | 85 | set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include/c++/9;/usr/include/x86_64-linux-gnu/c++/9;/usr/include/c++/9/backward;/usr/lib/gcc/x86_64-linux-gnu/9/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include") 86 | set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc_s;gcc;c;gcc_s;gcc") 87 | set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") 88 | set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 89 | -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_C.bin -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/build/CMakeFiles/3.16.3/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Linux-5.15.0-107-generic") 2 | set(CMAKE_HOST_SYSTEM_NAME "Linux") 3 | set(CMAKE_HOST_SYSTEM_VERSION "5.15.0-107-generic") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") 5 | 6 | 7 | 8 | set(CMAKE_SYSTEM "Linux-5.15.0-107-generic") 9 | set(CMAKE_SYSTEM_NAME "Linux") 10 | set(CMAKE_SYSTEM_VERSION "5.15.0-107-generic") 11 | set(CMAKE_SYSTEM_PROCESSOR "x86_64") 12 | 13 | set(CMAKE_CROSSCOMPILING "FALSE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/build/CMakeFiles/3.16.3/CompilerIdC/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/build/CMakeFiles/3.16.3/CompilerIdC/a.out -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/build/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/config/gazebo_initial_joint_positions.yaml: -------------------------------------------------------------------------------- 1 | initial_joint_positions: "-J $(arg prefix)joint_1 1.57 2 | -J $(arg prefix)joint_2 -0.35 3 | -J $(arg prefix)joint_3 3.14 4 | -J $(arg prefix)joint_4 -2.00 5 | -J $(arg prefix)joint_5 0 6 | -J $(arg prefix)joint_6 -1.00 7 | -J $(arg prefix)joint_7 1.57" -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/config/joint_limits.yaml: -------------------------------------------------------------------------------- 1 | joint_names: 2 | - $(arg prefix)joint_1 3 | - $(arg prefix)joint_2 4 | - $(arg prefix)joint_3 5 | - $(arg prefix)joint_4 6 | - $(arg prefix)joint_5 7 | - $(arg prefix)joint_6 8 | - $(arg prefix)joint_7 9 | maximum_velocities: 10 | - 0.8727 11 | - 0.8727 12 | - 0.8727 13 | - 0.8727 14 | - 0.8727 15 | - 0.8727 16 | - 0.8727 17 | maximum_accelerations: 18 | - 1.0 19 | - 1.0 20 | - 1.0 21 | - 1.0 22 | - 10.0 23 | - 10.0 24 | - 10.0 -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/config/twist_limits.yaml: -------------------------------------------------------------------------------- 1 | maximum_linear_velocity: 0.5 2 | maximum_angular_velocity: 1.74 3 | maximum_linear_acceleration: 0.4 4 | maximum_angular_acceleration: 0.4 -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/launch/load_wheelchair.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/collision/base_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/collision/base_link.STL -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/collision/bracelet_no_vision_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/collision/bracelet_no_vision_link.STL -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/collision/bracelet_with_vision_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/collision/bracelet_with_vision_link.STL -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/collision/forearm_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/collision/forearm_link.STL -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/collision/half_arm_1_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/collision/half_arm_1_link.STL -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/collision/half_arm_2_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/collision/half_arm_2_link.STL -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/collision/robotiq_arg2f_85_base_link.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/collision/robotiq_arg2f_85_base_link.stl -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/collision/robotiq_arg2f_base_link.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/collision/robotiq_arg2f_base_link.stl -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/collision/shoulder_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/collision/shoulder_link.STL -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/collision/spherical_wrist_1_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/collision/spherical_wrist_1_link.STL -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/collision/spherical_wrist_2_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/collision/spherical_wrist_2_link.STL -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/visual/base_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/visual/base_link.STL -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/visual/bracelet_no_vision_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/visual/bracelet_no_vision_link.STL -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/visual/bracelet_with_vision_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/visual/bracelet_with_vision_link.STL -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/visual/forearm_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/visual/forearm_link.STL -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/visual/half_arm_1_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/visual/half_arm_1_link.STL -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/visual/half_arm_2_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/visual/half_arm_2_link.STL -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/visual/robotiq_arg2f_85_pad.dae: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2016-07-17T22:25:43.361178 4 | 2016-07-17T22:25:43.361188 5 | Z_UP 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 0.0 0.0 0.0 1.0 14 | 15 | 16 | 0.0 0.0 0.0 1.0 17 | 18 | 19 | 0.7 0.7 0.7 1.0 20 | 21 | 22 | 1 1 1 1.0 23 | 24 | 25 | 0.0 26 | 27 | 28 | 0.0 0.0 0.0 1.0 29 | 30 | 31 | 0.0 32 | 33 | 34 | 0.0 0.0 0.0 1.0 35 | 36 | 37 | 1.0 38 | 39 | 40 | 41 | 42 | 43 | 0 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 4.38531e-14 -1 -4.451336e-05 4.38531e-14 -1 -4.451336e-05 -4.38531e-14 1 4.451336e-05 -4.38531e-14 1 4.451336e-05 -1 -4.385301e-14 -2.011189e-15 -1 -4.385301e-14 -2.011189e-15 -2.009237e-15 -4.451336e-05 1 -2.009237e-15 -4.451336e-05 1 1 4.385301e-14 2.011189e-15 1 4.385301e-14 2.011189e-15 2.009237e-15 4.451336e-05 -1 2.009237e-15 4.451336e-05 -1 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -10 -23.90175 13.51442 10 -23.9033 48.51442 -10 -23.9033 48.51442 10 -23.90175 13.51442 -10 -18.90175 13.51464 -10 -18.9033 48.51464 10 -18.90175 13.51464 10 -18.9033 48.51464 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 |

0 0 1 0 2 0 3 1 1 1 0 1 4 2 5 2 6 2 5 3 7 3 6 3 2 4 5 4 4 4 2 5 4 5 0 5 5 6 2 6 1 6 5 7 1 7 7 7 7 8 1 8 6 8 1 9 3 9 6 9 0 10 4 10 3 10 4 11 6 11 3 11

79 |
80 |
81 |
82 |
83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 |
105 | -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/visual/robotiq_gripper_coupling.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/visual/robotiq_gripper_coupling.stl -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/visual/shoulder_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/visual/shoulder_link.STL -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/visual/spherical_wrist_1_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/visual/spherical_wrist_1_link.STL -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/visual/spherical_wrist_2_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/urdf/kinova_robotiq/meshes/visual/spherical_wrist_2_link.STL -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | kinova_wheel_urdf 4 | 0.0.0 5 | The kinova_wheel_urdf package 6 | 7 | 8 | 9 | 10 | sony 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | catkin 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/usd/.asset_hash: -------------------------------------------------------------------------------- 1 | e464ca482abdeef2d8492b24b6f98974 -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/usd/config.yaml: -------------------------------------------------------------------------------- 1 | asset_path: /home/sony/git_pkg/isaacLab.manipulation/scripts/tools/../../isaacLab/manipulation/assets/urdf/kinova_robotiq/urdf/kinova_robotiq.urdf 2 | usd_dir: /home/sony/git_pkg/isaacLab.manipulation/scripts/tools/../../isaacLab/manipulation/assets/usd 3 | usd_file_name: kinova_robotiq.usd 4 | force_usd_conversion: true 5 | make_instanceable: false 6 | import_inertia_tensor: true 7 | fix_base: false 8 | merge_fixed_joints: false 9 | self_collision: false 10 | default_drive_type: none 11 | override_joint_dynamics: false 12 | default_drive_stiffness: 0.0 13 | default_drive_damping: 0.0 14 | link_density: 0.0 15 | convex_decompose_mesh: false 16 | ## 17 | # Generated by UrdfConverter on 2024-07-10 at 13:09:33. 18 | ## 19 | -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/usd/kinova_robotiq.usd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/acf5d3731ed7abfbd2b38fc4c55d077f13ab000a/isaacLab/manipulation/assets/usd/kinova_robotiq.usd -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/__init__.py: -------------------------------------------------------------------------------- 1 | """Locomotion environments for legged robots.""" 2 | 3 | from .inhand import * # noqa 4 | 5 | #add more tasks 6 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """In-hand object reorientation environment. 7 | 8 | These environments are based on the `dexterous cube manipulation`_ environments 9 | provided in IsaacGymEnvs repository from NVIDIA. However, they contain certain 10 | modifications and additional features. 11 | 12 | .. _dexterous cube manipulation: https://github.com/NVIDIA-Omniverse/IsaacGymEnvs/blob/main/isaacgymenvs/tasks/allegro_hand.py 13 | 14 | """ 15 | from . import config -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/config/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Configurations for in-hand manipulation environments.""" 7 | 8 | # We leave this file empty since we don't want to expose any configs in this package directly. 9 | # We still need this file to import the "config" module in the parent package. 10 | 11 | from .allegro_hand import * -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/config/allegro_hand/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | import gymnasium as gym 7 | 8 | from . import agents 9 | 10 | ## 11 | # Register Gym environments. 12 | ## 13 | 14 | ## 15 | # Full kinematic state observations. 16 | ## 17 | 18 | gym.register( 19 | id="Template-Isaac-Repose-Cube-Allegro-v0", 20 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 21 | disable_env_checker=True, 22 | kwargs={ 23 | "env_cfg_entry_point": f"{__name__}.allegro_env_cfg:AllegroCubeEnvCfg", 24 | "rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:AllegroCubePPORunnerCfg", 25 | "rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml", 26 | "skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml", 27 | }, 28 | ) 29 | 30 | gym.register( 31 | id="Template-Isaac-Repose-Cube-Allegro-Play-v0", 32 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 33 | disable_env_checker=True, 34 | kwargs={ 35 | "env_cfg_entry_point": f"{__name__}.allegro_env_cfg:AllegroCubeEnvCfg_PLAY", 36 | "rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:AllegroCubePPORunnerCfg", 37 | "rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml", 38 | "skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml", 39 | }, 40 | ) 41 | 42 | ## 43 | # Kinematic state observations without velocity information. 44 | ## 45 | 46 | gym.register( 47 | id="Template-Isaac-Repose-Cube-Allegro-NoVelObs-v0", 48 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 49 | disable_env_checker=True, 50 | kwargs={ 51 | "env_cfg_entry_point": f"{__name__}.allegro_env_cfg:AllegroCubeNoVelObsEnvCfg", 52 | "rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:AllegroCubeNoVelObsPPORunnerCfg", 53 | "rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml", 54 | "skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml", 55 | }, 56 | ) 57 | 58 | gym.register( 59 | id="Template-Isaac-Repose-Cube-Allegro-NoVelObs-Play-v0", 60 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 61 | disable_env_checker=True, 62 | kwargs={ 63 | "env_cfg_entry_point": f"{__name__}.allegro_env_cfg:AllegroCubeNoVelObsEnvCfg_PLAY", 64 | "rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:AllegroCubeNoVelObsPPORunnerCfg", 65 | "rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml", 66 | "skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml", 67 | }, 68 | ) 69 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/config/allegro_hand/agents/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/config/allegro_hand/agents/rl_games_ppo_cfg.yaml: -------------------------------------------------------------------------------- 1 | params: 2 | seed: 42 3 | 4 | # environment wrapper clipping 5 | env: 6 | clip_observations: 5.0 7 | clip_actions: 1.0 8 | 9 | algo: 10 | name: a2c_continuous 11 | 12 | model: 13 | name: continuous_a2c_logstd 14 | 15 | network: 16 | name: actor_critic 17 | separate: False 18 | 19 | space: 20 | continuous: 21 | mu_activation: None 22 | sigma_activation: None 23 | mu_init: 24 | name: default 25 | sigma_init: 26 | name: const_initializer 27 | val: 0 28 | fixed_sigma: True 29 | 30 | mlp: 31 | units: [512, 256, 128] 32 | activation: elu 33 | d2rl: False 34 | 35 | initializer: 36 | name: default 37 | regularizer: 38 | name: None 39 | 40 | load_checkpoint: False 41 | load_path: '' 42 | 43 | config: 44 | name: allegro_cube 45 | env_name: rlgpu 46 | device: 'cuda:0' 47 | device_name: 'cuda:0' 48 | multi_gpu: False 49 | ppo: True 50 | mixed_precision: False 51 | normalize_input: True 52 | normalize_value: True 53 | value_bootstrap: True 54 | num_actors: -1 # configured from the script (based on num_envs) 55 | reward_shaper: 56 | scale_value: 0.1 57 | normalize_advantage: True 58 | gamma: 0.998 59 | tau: 0.95 60 | learning_rate: 5e-4 61 | lr_schedule: adaptive 62 | schedule_type: standard 63 | kl_threshold: 0.016 64 | score_to_win: 100000 65 | max_epochs: 5000 66 | save_best_after: 500 67 | save_frequency: 200 68 | print_stats: True 69 | grad_norm: 1.0 70 | entropy_coef: 0.002 71 | truncate_grads: True 72 | e_clip: 0.2 73 | horizon_length: 24 74 | minibatch_size: 16384 # 32768 75 | mini_epochs: 5 76 | critic_coef: 4 77 | clip_value: True 78 | seq_length: 4 79 | bounds_loss_coef: 0.0005 80 | 81 | player: 82 | #render: True 83 | deterministic: True 84 | games_num: 100000 85 | print_stats: True 86 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/config/allegro_hand/agents/rsl_rl_ppo_cfg.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from isaaclab.utils import configclass 7 | 8 | from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlPpoActorCriticCfg, RslRlPpoAlgorithmCfg 9 | 10 | 11 | @configclass 12 | class AllegroCubePPORunnerCfg(RslRlOnPolicyRunnerCfg): 13 | num_steps_per_env = 24 14 | max_iterations = 5000 15 | save_interval = 50 16 | experiment_name = "allegro_cube" 17 | empirical_normalization = True 18 | policy = RslRlPpoActorCriticCfg( 19 | init_noise_std=1.0, 20 | actor_hidden_dims=[512, 256, 128], 21 | critic_hidden_dims=[512, 256, 128], 22 | activation="elu", 23 | ) 24 | algorithm = RslRlPpoAlgorithmCfg( 25 | value_loss_coef=1.0, 26 | use_clipped_value_loss=True, 27 | clip_param=0.2, 28 | entropy_coef=0.002, 29 | num_learning_epochs=5, 30 | num_mini_batches=4, 31 | learning_rate=0.001, 32 | schedule="adaptive", 33 | gamma=0.998, 34 | lam=0.95, 35 | desired_kl=0.01, 36 | max_grad_norm=1.0, 37 | ) 38 | 39 | 40 | @configclass 41 | class AllegroCubeNoVelObsPPORunnerCfg(AllegroCubePPORunnerCfg): 42 | experiment_name = "allegro_cube_no_vel_obs" 43 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/config/allegro_hand/agents/skrl_ppo_cfg.yaml: -------------------------------------------------------------------------------- 1 | seed: 42 2 | 3 | 4 | # Models are instantiated using skrl's model instantiator utility 5 | # https://skrl.readthedocs.io/en/latest/api/utils/model_instantiators.html 6 | models: 7 | separate: False 8 | policy: # see gaussian_model parameters 9 | class: GaussianMixin 10 | clip_actions: False 11 | clip_log_std: True 12 | min_log_std: -20.0 13 | max_log_std: 2.0 14 | initial_log_std: 0.0 15 | network: 16 | - name: net 17 | input: STATES 18 | layers: [512, 256, 128] 19 | activations: elu 20 | output: ACTIONS 21 | value: # see deterministic_model parameters 22 | class: DeterministicMixin 23 | clip_actions: False 24 | network: 25 | - name: net 26 | input: STATES 27 | layers: [512, 256, 128] 28 | activations: elu 29 | output: ONE 30 | 31 | 32 | # Rollout memory 33 | # https://skrl.readthedocs.io/en/latest/api/memories/random.html 34 | memory: 35 | class: RandomMemory 36 | memory_size: -1 # automatically determined (same as agent:rollouts) 37 | 38 | 39 | # PPO agent configuration (field names are from PPO_DEFAULT_CONFIG) 40 | # https://skrl.readthedocs.io/en/latest/api/agents/ppo.html 41 | agent: 42 | class: PPO 43 | rollouts: 24 44 | learning_epochs: 5 45 | mini_batches: 12 46 | discount_factor: 0.998 47 | lambda: 0.95 48 | learning_rate: 5.0e-04 49 | learning_rate_scheduler: KLAdaptiveLR 50 | learning_rate_scheduler_kwargs: 51 | kl_threshold: 0.016 52 | state_preprocessor: RunningStandardScaler 53 | state_preprocessor_kwargs: null 54 | value_preprocessor: RunningStandardScaler 55 | value_preprocessor_kwargs: null 56 | random_timesteps: 0 57 | learning_starts: 0 58 | grad_norm_clip: 1.0 59 | ratio_clip: 0.2 60 | value_clip: 0.2 61 | clip_predicted_values: True 62 | entropy_loss_scale: 0.002 63 | value_loss_scale: 2.0 64 | kl_threshold: 0.0 65 | rewards_shaper_scale: 0.1 66 | time_limit_bootstrap: False 67 | # logging and checkpoint 68 | experiment: 69 | directory: "allegro_cube" 70 | experiment_name: "" 71 | write_interval: auto 72 | checkpoint_interval: auto 73 | 74 | 75 | # Sequential trainer 76 | # https://skrl.readthedocs.io/en/latest/api/trainers/sequential.html 77 | trainer: 78 | class: SequentialTrainer 79 | timesteps: 120000 80 | environment_info: log 81 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/config/allegro_hand/allegro_env_cfg.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from isaaclab.utils import configclass 7 | 8 | import isaacLab.manipulation.tasks.Dextrous_hand.inhand.inhand_env_cfg as inhand_env_cfg 9 | 10 | ## 11 | # Pre-defined configs 12 | ## 13 | from isaacLab.manipulation.assets.config.allegro import ALLEGRO_HAND_CFG # isort: skip 14 | 15 | 16 | @configclass 17 | class AllegroCubeEnvCfg(inhand_env_cfg.InHandObjectEnvCfg): 18 | def __post_init__(self): 19 | # post init of parent 20 | super().__post_init__() 21 | 22 | # switch robot to allegro hand 23 | self.scene.robot = ALLEGRO_HAND_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") 24 | 25 | 26 | @configclass 27 | class AllegroCubeEnvCfg_PLAY(AllegroCubeEnvCfg): 28 | def __post_init__(self): 29 | # post init of parent 30 | super().__post_init__() 31 | # make a smaller scene for play 32 | self.scene.num_envs = 50 33 | # disable randomization for play 34 | self.observations.policy.enable_corruption = False 35 | # remove termination due to timeouts 36 | self.terminations.time_out = None 37 | 38 | 39 | ## 40 | # Environment configuration with no velocity observations. 41 | ## 42 | 43 | 44 | @configclass 45 | class AllegroCubeNoVelObsEnvCfg(AllegroCubeEnvCfg): 46 | def __post_init__(self): 47 | # post init of parent 48 | super().__post_init__() 49 | 50 | # switch observation group to no velocity group 51 | self.observations.policy = inhand_env_cfg.ObservationsCfg.NoVelocityKinematicObsGroupCfg() 52 | 53 | 54 | @configclass 55 | class AllegroCubeNoVelObsEnvCfg_PLAY(AllegroCubeNoVelObsEnvCfg): 56 | def __post_init__(self): 57 | # post init of parent 58 | super().__post_init__() 59 | # make a smaller scene for play 60 | self.scene.num_envs = 50 61 | # disable randomization for play 62 | self.observations.policy.enable_corruption = False 63 | # remove termination due to timeouts 64 | self.terminations.time_out = None 65 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/mdp/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """This sub-module contains the functions that are specific to the in-hand manipulation environments.""" 7 | 8 | from isaaclab.envs.mdp import * # noqa: F401, F403 9 | 10 | from .commands import * # noqa: F401, F403 11 | from .events import * # noqa: F401, F403 12 | from .observations import * # noqa: F401, F403 13 | from .rewards import * # noqa: F401, F403 14 | from .terminations import * # noqa: F401, F403 15 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/mdp/actions/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Various action terms that can be used in the environment.""" 7 | 8 | from .actions_cfg import * 9 | from .your_actions import * 10 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/mdp/actions/actions_cfg.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from dataclasses import MISSING 7 | 8 | from isaaclab.managers.action_manager import ActionTerm, ActionTermCfg 9 | from isaaclab.utils import configclass 10 | 11 | from . import your_actions 12 | 13 | 14 | @configclass 15 | class YourActionCfg(ActionTermCfg): 16 | pass -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/mdp/actions/your_actions.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from __future__ import annotations 7 | 8 | import torch 9 | from collections.abc import Sequence 10 | from typing import TYPE_CHECKING 11 | 12 | 13 | import isaaclab.utils.string as string_utils 14 | from isaaclab.assets.articulation import Articulation 15 | from isaaclab.managers.action_manager import ActionTerm 16 | 17 | if TYPE_CHECKING: 18 | from isaaclab.envs import ManagerBasedEnv 19 | 20 | from . import actions_cfg 21 | 22 | 23 | class YourAction(ActionTerm): 24 | pass -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/mdp/commands/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Sub-module containing command terms for 3D orientation goals.""" 7 | 8 | from .commands_cfg import InHandReOrientationCommandCfg # noqa: F401 9 | from .orientation_command import InHandReOrientationCommand # noqa: F401 10 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/mdp/commands/commands_cfg.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from dataclasses import MISSING 7 | 8 | import isaaclab.sim as sim_utils 9 | from isaaclab.managers import CommandTermCfg 10 | from isaaclab.markers import VisualizationMarkersCfg 11 | from isaaclab.utils import configclass 12 | from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR 13 | 14 | from .orientation_command import InHandReOrientationCommand 15 | 16 | 17 | @configclass 18 | class InHandReOrientationCommandCfg(CommandTermCfg): 19 | """Configuration for the uniform 3D orientation command term. 20 | 21 | Please refer to the :class:`InHandReOrientationCommand` class for more details. 22 | """ 23 | 24 | class_type: type = InHandReOrientationCommand 25 | resampling_time_range: tuple[float, float] = (1e6, 1e6) # no resampling based on time 26 | 27 | asset_name: str = MISSING 28 | """Name of the asset in the environment for which the commands are generated.""" 29 | 30 | init_pos_offset: tuple[float, float, float] = (0.0, 0.0, 0.0) 31 | """Position offset of the asset from its default position. 32 | 33 | This is used to account for the offset typically present in the object's default position 34 | so that the object is spawned at a height above the robot's palm. When the position command 35 | is generated, the object's default position is used as the reference and the offset specified 36 | is added to it to get the desired position of the object. 37 | """ 38 | 39 | make_quat_unique: bool = MISSING 40 | """Whether to make the quaternion unique or not. 41 | 42 | If True, the quaternion is made unique by ensuring the real part is positive. 43 | """ 44 | 45 | orientation_success_threshold: float = MISSING 46 | """Threshold for the orientation error to consider the goal orientation to be reached.""" 47 | 48 | update_goal_on_success: bool = MISSING 49 | """Whether to update the goal orientation when the goal orientation is reached.""" 50 | 51 | marker_pos_offset: tuple[float, float, float] = (0.0, 0.0, 0.0) 52 | """Position offset of the marker from the object's desired position. 53 | 54 | This is useful to position the marker at a height above the object's desired position. 55 | Otherwise, the marker may occlude the object in the visualization. 56 | """ 57 | 58 | goal_pose_visualizer_cfg: VisualizationMarkersCfg = VisualizationMarkersCfg( 59 | prim_path="/Visuals/Command/goal_marker", 60 | markers={ 61 | "goal": sim_utils.UsdFileCfg( 62 | usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/Blocks/DexCube/dex_cube_instanceable.usd", 63 | scale=(1.0, 1.0, 1.0), 64 | ), 65 | }, 66 | ) 67 | """The configuration for the goal pose visualization marker. Defaults to a DexCube marker.""" 68 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/mdp/curriculums.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Common functions that can be used to create curriculum for the learning environment. 7 | 8 | The functions can be passed to the :class:`isaaclab.managers.CurriculumTermCfg` object to enable 9 | the curriculum introduced by the function. 10 | """ 11 | 12 | from __future__ import annotations 13 | 14 | import torch 15 | from collections.abc import Sequence 16 | from typing import TYPE_CHECKING 17 | 18 | from isaaclab.assets import Articulation 19 | from isaaclab.managers import SceneEntityCfg 20 | from isaaclab.terrains import TerrainImporter 21 | 22 | if TYPE_CHECKING: 23 | from isaaclab.envs import ManagerBasedRLEnv 24 | 25 | 26 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/mdp/observations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Functions specific to the in-hand dexterous manipulation environments.""" 7 | 8 | import torch 9 | from typing import TYPE_CHECKING 10 | 11 | import isaaclab.utils.math as math_utils 12 | from isaaclab.assets import RigidObject 13 | from isaaclab.envs import ManagerBasedRLEnv 14 | from isaaclab.managers import SceneEntityCfg 15 | 16 | if TYPE_CHECKING: 17 | from .commands import InHandReOrientationCommand 18 | 19 | 20 | def goal_quat_diff( 21 | env: ManagerBasedRLEnv, asset_cfg: SceneEntityCfg, command_name: str, make_quat_unique: bool 22 | ) -> torch.Tensor: 23 | """Goal orientation relative to the asset's root frame. 24 | 25 | The quaternion is represented as (w, x, y, z). The real part is always positive. 26 | """ 27 | # extract useful elements 28 | asset: RigidObject = env.scene[asset_cfg.name] 29 | command_term: InHandReOrientationCommand = env.command_manager.get_term(command_name) 30 | 31 | # obtain the orientations 32 | goal_quat_w = command_term.command[:, 3:7] 33 | asset_quat_w = asset.data.root_quat_w 34 | 35 | # compute quaternion difference 36 | quat = math_utils.quat_mul(asset_quat_w, math_utils.quat_conjugate(goal_quat_w)) 37 | # make sure the quaternion real-part is always positive 38 | return math_utils.quat_unique(quat) if make_quat_unique else quat 39 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/mdp/rewards.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Functions specific to the in-hand dexterous manipulation environments.""" 7 | 8 | import torch 9 | from typing import TYPE_CHECKING 10 | 11 | import isaaclab.utils.math as math_utils 12 | from isaaclab.assets import RigidObject 13 | from isaaclab.envs import ManagerBasedRLEnv 14 | from isaaclab.managers import SceneEntityCfg 15 | 16 | if TYPE_CHECKING: 17 | from .commands import InHandReOrientationCommand 18 | 19 | 20 | def success_bonus( 21 | env: ManagerBasedRLEnv, command_name: str, object_cfg: SceneEntityCfg = SceneEntityCfg("object") 22 | ) -> torch.Tensor: 23 | """Bonus reward for successfully reaching the goal. 24 | 25 | The object is considered to have reached the goal when the object orientation is within the threshold. 26 | The reward is 1.0 if the object has reached the goal, otherwise 0.0. 27 | 28 | Args: 29 | env: The environment object. 30 | command_name: The command term to be used for extracting the goal. 31 | object_cfg: The configuration for the scene entity. Default is "object". 32 | """ 33 | # extract useful elements 34 | asset: RigidObject = env.scene[object_cfg.name] 35 | command_term: InHandReOrientationCommand = env.command_manager.get_term(command_name) 36 | 37 | # obtain the goal orientation 38 | goal_quat_w = command_term.command[:, 3:7] 39 | # obtain the threshold for the orientation error 40 | threshold = command_term.cfg.orientation_success_threshold 41 | # calculate the orientation error 42 | dtheta = math_utils.quat_error_magnitude(asset.data.root_quat_w, goal_quat_w) 43 | 44 | return dtheta <= threshold 45 | 46 | 47 | def track_pos_l2( 48 | env: ManagerBasedRLEnv, command_name: str, object_cfg: SceneEntityCfg = SceneEntityCfg("object") 49 | ) -> torch.Tensor: 50 | """Reward for tracking the object position using the L2 norm. 51 | 52 | The reward is the distance between the object position and the goal position. 53 | 54 | Args: 55 | env: The environment object. 56 | command_term: The command term to be used for extracting the goal. 57 | object_cfg: The configuration for the scene entity. Default is "object". 58 | """ 59 | # extract useful elements 60 | asset: RigidObject = env.scene[object_cfg.name] 61 | command_term: InHandReOrientationCommand = env.command_manager.get_term(command_name) 62 | 63 | # obtain the goal position 64 | goal_pos_e = command_term.command[:, 0:3] 65 | # obtain the object position in the environment frame 66 | object_pos_e = asset.data.root_pos_w - env.scene.env_origins 67 | 68 | return torch.norm(goal_pos_e - object_pos_e, p=2, dim=-1) 69 | 70 | 71 | def track_orientation_inv_l2( 72 | env: ManagerBasedRLEnv, 73 | command_name: str, 74 | object_cfg: SceneEntityCfg = SceneEntityCfg("object"), 75 | rot_eps: float = 1e-3, 76 | ) -> torch.Tensor: 77 | """Reward for tracking the object orientation using the inverse of the orientation error. 78 | 79 | The reward is the inverse of the orientation error between the object orientation and the goal orientation. 80 | 81 | Args: 82 | env: The environment object. 83 | command_name: The command term to be used for extracting the goal. 84 | object_cfg: The configuration for the scene entity. Default is "object". 85 | rot_eps: The threshold for the orientation error. Default is 1e-3. 86 | """ 87 | # extract useful elements 88 | asset: RigidObject = env.scene[object_cfg.name] 89 | command_term: InHandReOrientationCommand = env.command_manager.get_term(command_name) 90 | 91 | # obtain the goal orientation 92 | goal_quat_w = command_term.command[:, 3:7] 93 | # calculate the orientation error 94 | dtheta = math_utils.quat_error_magnitude(asset.data.root_quat_w, goal_quat_w) 95 | 96 | return 1.0 / (dtheta + rot_eps) 97 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/mdp/terminations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Functions specific to the in-hand dexterous manipulation environments.""" 7 | 8 | import torch 9 | from typing import TYPE_CHECKING 10 | 11 | from isaaclab.envs import ManagerBasedRLEnv 12 | from isaaclab.managers import SceneEntityCfg 13 | 14 | if TYPE_CHECKING: 15 | from .commands import InHandReOrientationCommand 16 | 17 | 18 | def max_consecutive_success(env: ManagerBasedRLEnv, num_success: int, command_name: str) -> torch.Tensor: 19 | """Check if the task has been completed consecutively for a certain number of times. 20 | 21 | Args: 22 | env: The environment object. 23 | num_success: Threshold for the number of consecutive successes required. 24 | command_name: The command term to be used for extracting the goal. 25 | """ 26 | command_term: InHandReOrientationCommand = env.command_manager.get_term(command_name) 27 | 28 | return command_term.metrics["consecutive_success"] >= num_success 29 | 30 | 31 | def object_away_from_goal( 32 | env: ManagerBasedRLEnv, 33 | threshold: float, 34 | command_name: str, 35 | object_cfg: SceneEntityCfg = SceneEntityCfg("object"), 36 | ) -> torch.Tensor: 37 | """Check if object has gone far from the goal. 38 | 39 | The object is considered to be out-of-reach if the distance between the goal and the object is greater 40 | than the threshold. 41 | 42 | Args: 43 | env: The environment object. 44 | threshold: The threshold for the distance between the robot and the object. 45 | command_name: The command term to be used for extracting the goal. 46 | object_cfg: The configuration for the scene entity. Default is "object". 47 | """ 48 | # extract useful elements 49 | command_term: InHandReOrientationCommand = env.command_manager.get_term(command_name) 50 | asset = env.scene[object_cfg.name] 51 | 52 | # object pos 53 | asset_pos_e = asset.data.root_pos_w - env.scene.env_origins 54 | goal_pos_e = command_term.command[:, :3] 55 | 56 | return torch.norm(asset_pos_e - goal_pos_e, p=2, dim=1) > threshold 57 | 58 | 59 | def object_away_from_robot( 60 | env: ManagerBasedRLEnv, 61 | threshold: float, 62 | asset_cfg: SceneEntityCfg = SceneEntityCfg("robot"), 63 | object_cfg: SceneEntityCfg = SceneEntityCfg("object"), 64 | ) -> torch.Tensor: 65 | """Check if object has gone far from the robot. 66 | 67 | The object is considered to be out-of-reach if the distance between the robot and the object is greater 68 | than the threshold. 69 | 70 | Args: 71 | env: The environment object. 72 | threshold: The threshold for the distance between the robot and the object. 73 | asset_cfg: The configuration for the robot entity. Default is "robot". 74 | object_cfg: The configuration for the object entity. Default is "object". 75 | """ 76 | # extract useful elements 77 | robot = env.scene[asset_cfg.name] 78 | object = env.scene[object_cfg.name] 79 | 80 | # compute distance 81 | dist = torch.norm(robot.data.root_pos_w - object.data.root_pos_w, dim=1) 82 | 83 | return dist > threshold 84 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/__init__.py: -------------------------------------------------------------------------------- 1 | """Manipulation environments for robots.""" 2 | 3 | from .reach import * # noqa 4 | from .lift import * 5 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/lift/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Configurations for the object lift environments.""" 7 | 8 | # We leave this file empty since we don't want to expose any configs in this package directly. 9 | # We still need this file to import the "config" module in the parent package. 10 | 11 | # 导入config模块来注册环境 12 | from . import config 13 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/lift/config/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Configurations for the object lift environments.""" 7 | 8 | # We leave this file empty since we don't want to expose any configs in this package directly. 9 | # We still need this file to import the "config" module in the parent package. 10 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/lift/config/franka/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | import gymnasium as gym 6 | import os 7 | 8 | from . import agents 9 | 10 | ## 11 | # Register Gym environments. 12 | ## 13 | 14 | ## 15 | # Joint Position Control 16 | ## 17 | 18 | gym.register( 19 | id="Template-Isaac-Lift-Cube-Franka-v0", 20 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 21 | kwargs={ 22 | "env_cfg_entry_point": f"{__name__}.joint_pos_env_cfg:FrankaCubeLiftEnvCfg", 23 | "rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:LiftCubePPORunnerCfg", 24 | "skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml", 25 | "rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml", 26 | "sb3_cfg_entry_point": f"{agents.__name__}:sb3_ppo_cfg.yaml", 27 | }, 28 | disable_env_checker=True, 29 | ) 30 | 31 | gym.register( 32 | id="Template-Isaac-Lift-Cube-Franka-Play-v0", 33 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 34 | kwargs={ 35 | "env_cfg_entry_point": f"{__name__}.joint_pos_env_cfg:FrankaCubeLiftEnvCfg_PLAY", 36 | "rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:LiftCubePPORunnerCfg", 37 | "skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml", 38 | "rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml", 39 | "sb3_cfg_entry_point": f"{agents.__name__}:sb3_ppo_cfg.yaml", 40 | }, 41 | disable_env_checker=True, 42 | ) 43 | 44 | ## 45 | # Inverse Kinematics - Absolute Pose Control 46 | ## 47 | 48 | gym.register( 49 | id="Template-Isaac-Lift-Cube-Franka-IK-Abs-v0", 50 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 51 | kwargs={ 52 | "env_cfg_entry_point": f"{__name__}.ik_abs_env_cfg:FrankaCubeLiftEnvCfg", 53 | }, 54 | disable_env_checker=True, 55 | ) 56 | 57 | gym.register( 58 | id="Template-Isaac-Lift-Teddy-Bear-Franka-IK-Abs-v0", 59 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 60 | kwargs={ 61 | "env_cfg_entry_point": f"{__name__}.ik_abs_env_cfg:FrankaTeddyBearLiftEnvCfg", 62 | }, 63 | disable_env_checker=True, 64 | ) 65 | 66 | ## 67 | # Inverse Kinematics - Relative Pose Control 68 | ## 69 | 70 | gym.register( 71 | id="Template-Isaac-Lift-Cube-Franka-IK-Rel-v0", 72 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 73 | kwargs={ 74 | "env_cfg_entry_point": f"{__name__}.ik_rel_env_cfg:FrankaCubeLiftEnvCfg", 75 | "robomimic_bc_cfg_entry_point": os.path.join(agents.__path__[0], "robomimic/bc.json"), 76 | }, 77 | disable_env_checker=True, 78 | ) 79 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/lift/config/franka/agents/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/lift/config/franka/agents/rl_games_ppo_cfg.yaml: -------------------------------------------------------------------------------- 1 | params: 2 | seed: 42 3 | 4 | # environment wrapper clipping 5 | env: 6 | clip_observations: 100.0 7 | clip_actions: 100.0 8 | 9 | algo: 10 | name: a2c_continuous 11 | 12 | model: 13 | name: continuous_a2c_logstd 14 | 15 | network: 16 | name: actor_critic 17 | separate: False 18 | space: 19 | continuous: 20 | mu_activation: None 21 | sigma_activation: None 22 | 23 | mu_init: 24 | name: default 25 | sigma_init: 26 | name: const_initializer 27 | val: 0 28 | fixed_sigma: True 29 | mlp: 30 | units: [256, 128, 64] 31 | activation: elu 32 | d2rl: False 33 | 34 | initializer: 35 | name: default 36 | regularizer: 37 | name: None 38 | 39 | load_checkpoint: False # flag which sets whether to load the checkpoint 40 | load_path: '' # path to the checkpoint to load 41 | 42 | config: 43 | name: franka_lift 44 | env_name: rlgpu 45 | device: 'cuda:0' 46 | device_name: 'cuda:0' 47 | multi_gpu: False 48 | ppo: True 49 | mixed_precision: False 50 | normalize_input: True 51 | normalize_value: True 52 | value_bootstrap: False 53 | num_actors: -1 54 | reward_shaper: 55 | scale_value: 0.01 56 | normalize_advantage: True 57 | gamma: 0.99 58 | tau: 0.95 59 | learning_rate: 1e-4 60 | lr_schedule: adaptive 61 | schedule_type: legacy 62 | kl_threshold: 0.01 63 | score_to_win: 100000000 64 | max_epochs: 1500 65 | save_best_after: 100 66 | save_frequency: 50 67 | print_stats: True 68 | grad_norm: 1.0 69 | entropy_coef: 0.001 70 | truncate_grads: True 71 | e_clip: 0.2 72 | horizon_length: 24 73 | minibatch_size: 24576 74 | mini_epochs: 8 75 | critic_coef: 4 76 | clip_value: True 77 | clip_actions: False 78 | seq_len: 4 79 | bounds_loss_coef: 0.0001 80 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/lift/config/franka/agents/rsl_rl_ppo_cfg.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from isaaclab.utils import configclass 7 | 8 | from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlPpoActorCriticCfg, RslRlPpoAlgorithmCfg 9 | 10 | 11 | @configclass 12 | class LiftCubePPORunnerCfg(RslRlOnPolicyRunnerCfg): 13 | num_steps_per_env = 24 14 | max_iterations = 1500 15 | save_interval = 50 16 | experiment_name = "franka_lift" 17 | empirical_normalization = False 18 | policy = RslRlPpoActorCriticCfg( 19 | init_noise_std=1.0, 20 | actor_hidden_dims=[256, 128, 64], 21 | critic_hidden_dims=[256, 128, 64], 22 | activation="elu", 23 | ) 24 | algorithm = RslRlPpoAlgorithmCfg( 25 | value_loss_coef=1.0, 26 | use_clipped_value_loss=True, 27 | clip_param=0.2, 28 | entropy_coef=0.006, 29 | num_learning_epochs=5, 30 | num_mini_batches=4, 31 | learning_rate=1.0e-4, 32 | schedule="adaptive", 33 | gamma=0.98, 34 | lam=0.95, 35 | desired_kl=0.01, 36 | max_grad_norm=1.0, 37 | ) 38 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/lift/config/franka/agents/sb3_ppo_cfg.yaml: -------------------------------------------------------------------------------- 1 | # Reference: https://github.com/DLR-RM/rl-baselines3-zoo/blob/master/hyperparams/ppo.yml#L32 2 | seed: 42 3 | 4 | # epoch * n_steps * nenvs: 500×512*8*8 5 | n_timesteps: 16384000 6 | policy: 'MlpPolicy' 7 | n_steps: 64 8 | # mini batch size: num_envs * nsteps / nminibatches 2048×512÷2048 9 | batch_size: 192 10 | gae_lambda: 0.95 11 | gamma: 0.99 12 | n_epochs: 8 13 | ent_coef: 0.00 14 | vf_coef: 0.0001 15 | learning_rate: !!float 3e-4 16 | clip_range: 0.2 17 | policy_kwargs: "dict( 18 | activation_fn=nn.ELU, 19 | net_arch=dict(pi=[256, 128, 64], vf=[256, 128, 64]) 20 | )" 21 | target_kl: 0.01 22 | max_grad_norm: 1.0 23 | 24 | # # Uses VecNormalize class to normalize obs 25 | # normalize_input: True 26 | # # Uses VecNormalize class to normalize rew 27 | # normalize_value: True 28 | # clip_obs: 5 29 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/lift/config/franka/agents/skrl_ppo_cfg.yaml: -------------------------------------------------------------------------------- 1 | seed: 42 2 | 3 | 4 | # Models are instantiated using skrl's model instantiator utility 5 | # https://skrl.readthedocs.io/en/latest/api/utils/model_instantiators.html 6 | models: 7 | separate: False 8 | policy: # see gaussian_model parameters 9 | class: GaussianMixin 10 | clip_actions: False 11 | clip_log_std: True 12 | min_log_std: -20.0 13 | max_log_std: 2.0 14 | initial_log_std: 0.0 15 | network: 16 | - name: net 17 | input: STATES 18 | layers: [256, 128, 64] 19 | activations: elu 20 | output: ACTIONS 21 | value: # see deterministic_model parameters 22 | class: DeterministicMixin 23 | clip_actions: False 24 | network: 25 | - name: net 26 | input: STATES 27 | layers: [256, 128, 64] 28 | activations: elu 29 | output: ONE 30 | 31 | 32 | # Rollout memory 33 | # https://skrl.readthedocs.io/en/latest/api/memories/random.html 34 | memory: 35 | class: RandomMemory 36 | memory_size: -1 # automatically determined (same as agent:rollouts) 37 | 38 | 39 | # PPO agent configuration (field names are from PPO_DEFAULT_CONFIG) 40 | # https://skrl.readthedocs.io/en/latest/api/agents/ppo.html 41 | agent: 42 | class: PPO 43 | rollouts: 24 44 | learning_epochs: 8 45 | mini_batches: 4 46 | discount_factor: 0.99 47 | lambda: 0.95 48 | learning_rate: 1.0e-04 49 | learning_rate_scheduler: KLAdaptiveLR 50 | learning_rate_scheduler_kwargs: 51 | kl_threshold: 0.01 52 | state_preprocessor: RunningStandardScaler 53 | state_preprocessor_kwargs: null 54 | value_preprocessor: RunningStandardScaler 55 | value_preprocessor_kwargs: null 56 | random_timesteps: 0 57 | learning_starts: 0 58 | grad_norm_clip: 1.0 59 | ratio_clip: 0.2 60 | value_clip: 0.2 61 | clip_predicted_values: True 62 | entropy_loss_scale: 0.001 63 | value_loss_scale: 2.0 64 | kl_threshold: 0.0 65 | rewards_shaper_scale: 0.01 66 | time_limit_bootstrap: False 67 | # logging and checkpoint 68 | experiment: 69 | directory: "franka_lift" 70 | experiment_name: "" 71 | write_interval: auto 72 | checkpoint_interval: auto 73 | 74 | 75 | # Sequential trainer 76 | # https://skrl.readthedocs.io/en/latest/api/trainers/sequential.html 77 | trainer: 78 | class: SequentialTrainer 79 | timesteps: 36000 80 | environment_info: log 81 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/lift/config/franka/ik_abs_env_cfg.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from isaaclab.assets import DeformableObjectCfg, RigidObjectCfg 7 | from isaaclab.controllers.differential_ik_cfg import DifferentialIKControllerCfg 8 | from isaaclab.envs.mdp.actions.actions_cfg import DifferentialInverseKinematicsActionCfg 9 | from isaaclab.managers import EventTermCfg as EventTerm 10 | from isaaclab.managers import SceneEntityCfg 11 | from isaaclab.sensors import FrameTransformerCfg 12 | from isaaclab.sensors.frame_transformer.frame_transformer_cfg import OffsetCfg 13 | from isaaclab.sim.schemas.schemas_cfg import RigidBodyPropertiesCfg 14 | from isaaclab.sim.spawners.from_files.from_files_cfg import UsdFileCfg 15 | from isaaclab.utils import configclass 16 | from isaaclab.utils.assets import ISAACLAB_NUCLEUS_DIR 17 | 18 | from isaacLab.manipulation.tasks.Robot_arm.lift import mdp 19 | from isaacLab.manipulation.tasks.Robot_arm.lift.lift_env_cfg import LiftEnvCfg 20 | 21 | ## 22 | # Pre-defined configs 23 | ## 24 | from isaacLab.manipulation.assets.config.franka import FRANKA_PANDA_HIGH_PD_CFG # isort: skip 25 | 26 | 27 | ## 28 | # Rigid object lift environment. 29 | ## 30 | 31 | 32 | @configclass 33 | class FrankaCubeLiftEnvCfg(LiftEnvCfg): 34 | def __post_init__(self): 35 | # post init of parent 36 | super().__post_init__() 37 | 38 | # Set Franka as robot 39 | # We switch here to a stiffer PD controller for IK tracking to be better. 40 | self.scene.robot = FRANKA_PANDA_HIGH_PD_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") 41 | 42 | # Set actions for the specific robot type (franka) 43 | self.actions.arm_action = DifferentialInverseKinematicsActionCfg( 44 | asset_name="robot", 45 | joint_names=["panda_joint.*"], 46 | body_name="panda_hand", 47 | controller=DifferentialIKControllerCfg(command_type="pose", use_relative_mode=False, ik_method="dls"), 48 | body_offset=DifferentialInverseKinematicsActionCfg.OffsetCfg(pos=[0.0, 0.0, 0.107]), 49 | ) 50 | 51 | 52 | @configclass 53 | class FrankaCubeLiftEnvCfg_PLAY(FrankaCubeLiftEnvCfg): 54 | def __post_init__(self): 55 | # post init of parent 56 | super().__post_init__() 57 | # make a smaller scene for play 58 | self.scene.num_envs = 50 59 | self.scene.env_spacing = 2.5 60 | # disable randomization for play 61 | self.observations.policy.enable_corruption = False 62 | 63 | 64 | ## 65 | # Deformable object lift environment. 66 | ## 67 | 68 | 69 | @configclass 70 | class FrankaTeddyBearLiftEnvCfg(FrankaCubeLiftEnvCfg): 71 | def __post_init__(self): 72 | # post init of parent 73 | super().__post_init__() 74 | 75 | self.scene.object = DeformableObjectCfg( 76 | prim_path="{ENV_REGEX_NS}/Object", 77 | init_state=DeformableObjectCfg.InitialStateCfg(pos=(0.5, 0, 0.05), rot=(0.707, 0, 0, 0.707)), 78 | spawn=UsdFileCfg( 79 | usd_path=f"{ISAACLAB_NUCLEUS_DIR}/Objects/Teddy_Bear/teddy_bear.usd", 80 | scale=(0.01, 0.01, 0.01), 81 | ), 82 | ) 83 | 84 | # Make the end effector less stiff to not hurt the poor teddy bear 85 | self.scene.robot.actuators["panda_hand"].effort_limit = 50.0 86 | self.scene.robot.actuators["panda_hand"].stiffness = 40.0 87 | self.scene.robot.actuators["panda_hand"].damping = 10.0 88 | 89 | # Disable replicate physics as it doesn't work for deformable objects 90 | # FIXME: This should be fixed by the PhysX replication system. 91 | self.scene.replicate_physics = False 92 | 93 | # Set events for the specific object type (deformable cube) 94 | self.events.reset_object_position = EventTerm( 95 | func=mdp.reset_nodal_state_uniform, 96 | mode="reset", 97 | params={ 98 | "position_range": {"x": (-0.1, 0.1), "y": (-0.25, 0.25), "z": (0.0, 0.0)}, 99 | "velocity_range": {}, 100 | "asset_cfg": SceneEntityCfg("object"), 101 | }, 102 | ) 103 | 104 | # Remove all the terms for the state machine demo 105 | # TODO: Computing the root pose of deformable object from nodal positions is expensive. 106 | # We need to fix that part before enabling these terms for the training. 107 | self.terminations.object_dropping = None 108 | self.rewards.reaching_object = None 109 | self.rewards.lifting_object = None 110 | self.rewards.object_goal_tracking = None 111 | self.rewards.object_goal_tracking_fine_grained = None 112 | self.observations.policy.object_position = None 113 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/lift/config/franka/ik_rel_env_cfg.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from isaaclab.controllers.differential_ik_cfg import DifferentialIKControllerCfg 7 | from isaaclab.envs.mdp.actions.actions_cfg import DifferentialInverseKinematicsActionCfg 8 | from isaaclab.utils import configclass 9 | 10 | from . import joint_pos_env_cfg 11 | 12 | ## 13 | # Pre-defined configs 14 | ## 15 | from isaacLab.manipulation.assets.config.franka import FRANKA_PANDA_HIGH_PD_CFG # isort: skip 16 | 17 | 18 | @configclass 19 | class FrankaCubeLiftEnvCfg(joint_pos_env_cfg.FrankaCubeLiftEnvCfg): 20 | def __post_init__(self): 21 | # post init of parent 22 | super().__post_init__() 23 | 24 | # Set Franka as robot 25 | # We switch here to a stiffer PD controller for IK tracking to be better. 26 | self.scene.robot = FRANKA_PANDA_HIGH_PD_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") 27 | 28 | # Set actions for the specific robot type (franka) 29 | self.actions.arm_action = DifferentialInverseKinematicsActionCfg( 30 | asset_name="robot", 31 | joint_names=["panda_joint.*"], 32 | body_name="panda_hand", 33 | controller=DifferentialIKControllerCfg(command_type="pose", use_relative_mode=True, ik_method="dls"), 34 | scale=0.5, 35 | body_offset=DifferentialInverseKinematicsActionCfg.OffsetCfg(pos=[0.0, 0.0, 0.107]), 36 | ) 37 | 38 | 39 | @configclass 40 | class FrankaCubeLiftEnvCfg_PLAY(FrankaCubeLiftEnvCfg): 41 | def __post_init__(self): 42 | # post init of parent 43 | super().__post_init__() 44 | # make a smaller scene for play 45 | self.scene.num_envs = 50 46 | self.scene.env_spacing = 2.5 47 | # disable randomization for play 48 | self.observations.policy.enable_corruption = False 49 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/lift/config/franka/joint_pos_env_cfg.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from isaaclab.assets import RigidObjectCfg 7 | from isaaclab.sensors import FrameTransformerCfg 8 | from isaaclab.sensors.frame_transformer.frame_transformer_cfg import OffsetCfg 9 | from isaaclab.sim.schemas.schemas_cfg import RigidBodyPropertiesCfg 10 | from isaaclab.sim.spawners.from_files.from_files_cfg import UsdFileCfg 11 | from isaaclab.utils import configclass 12 | from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR 13 | 14 | from isaacLab.manipulation.tasks.Robot_arm.lift import mdp 15 | from isaacLab.manipulation.tasks.Robot_arm.lift.lift_env_cfg import LiftEnvCfg 16 | 17 | ## 18 | # Pre-defined configs 19 | ## 20 | from isaaclab.markers.config import FRAME_MARKER_CFG # isort: skip 21 | from isaacLab.manipulation.assets.config.franka import FRANKA_PANDA_CFG # isort: skip 22 | 23 | 24 | @configclass 25 | class FrankaCubeLiftEnvCfg(LiftEnvCfg): 26 | def __post_init__(self): 27 | # post init of parent 28 | super().__post_init__() 29 | 30 | # Set Franka as robot 31 | self.scene.robot = FRANKA_PANDA_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") 32 | 33 | # Set actions for the specific robot type (franka) 34 | self.actions.arm_action = mdp.JointPositionActionCfg( 35 | asset_name="robot", joint_names=["panda_joint.*"], scale=0.5, use_default_offset=True 36 | ) 37 | self.actions.gripper_action = mdp.BinaryJointPositionActionCfg( 38 | asset_name="robot", 39 | joint_names=["panda_finger.*"], 40 | open_command_expr={"panda_finger_.*": 0.04}, 41 | close_command_expr={"panda_finger_.*": 0.0}, 42 | ) 43 | # Set the body name for the end effector 44 | self.commands.object_pose.body_name = "panda_hand" 45 | 46 | # Set Cube as object 47 | self.scene.object = RigidObjectCfg( 48 | prim_path="{ENV_REGEX_NS}/Object", 49 | init_state=RigidObjectCfg.InitialStateCfg(pos=[0.5, 0, 0.055], rot=[1, 0, 0, 0]), 50 | spawn=UsdFileCfg( 51 | usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/Blocks/DexCube/dex_cube_instanceable.usd", 52 | scale=(0.8, 0.8, 0.8), 53 | rigid_props=RigidBodyPropertiesCfg( 54 | solver_position_iteration_count=16, 55 | solver_velocity_iteration_count=1, 56 | max_angular_velocity=1000.0, 57 | max_linear_velocity=1000.0, 58 | max_depenetration_velocity=5.0, 59 | disable_gravity=False, 60 | ), 61 | ), 62 | ) 63 | 64 | # Listens to the required transforms 65 | marker_cfg = FRAME_MARKER_CFG.copy() 66 | marker_cfg.markers["frame"].scale = (0.1, 0.1, 0.1) 67 | marker_cfg.prim_path = "/Visuals/FrameTransformer" 68 | self.scene.ee_frame = FrameTransformerCfg( 69 | prim_path="{ENV_REGEX_NS}/Robot/panda_link0", 70 | debug_vis=False, 71 | visualizer_cfg=marker_cfg, 72 | target_frames=[ 73 | FrameTransformerCfg.FrameCfg( 74 | prim_path="{ENV_REGEX_NS}/Robot/panda_hand", 75 | name="end_effector", 76 | offset=OffsetCfg( 77 | pos=[0.0, 0.0, 0.1034], 78 | ), 79 | ), 80 | ], 81 | ) 82 | 83 | 84 | @configclass 85 | class FrankaCubeLiftEnvCfg_PLAY(FrankaCubeLiftEnvCfg): 86 | def __post_init__(self): 87 | # post init of parent 88 | super().__post_init__() 89 | # make a smaller scene for play 90 | self.scene.num_envs = 50 91 | self.scene.env_spacing = 2.5 92 | # disable randomization for play 93 | self.observations.policy.enable_corruption = False 94 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/lift/mdp/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """This sub-module contains the functions that are specific to the lift environments.""" 7 | 8 | from isaaclab.envs.mdp import * # noqa: F401, F403 9 | 10 | from .observations import * # noqa: F401, F403 11 | from .rewards import * # noqa: F401, F403 12 | from .terminations import * # noqa: F401, F403 13 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/lift/mdp/observations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from __future__ import annotations 7 | 8 | import torch 9 | from typing import TYPE_CHECKING 10 | 11 | from isaaclab.assets import RigidObject 12 | from isaaclab.managers import SceneEntityCfg 13 | from isaaclab.utils.math import subtract_frame_transforms 14 | 15 | if TYPE_CHECKING: 16 | from isaaclab.envs import ManagerBasedRLEnv 17 | 18 | 19 | def object_position_in_robot_root_frame( 20 | env: ManagerBasedRLEnv, 21 | robot_cfg: SceneEntityCfg = SceneEntityCfg("robot"), 22 | object_cfg: SceneEntityCfg = SceneEntityCfg("object"), 23 | ) -> torch.Tensor: 24 | """The position of the object in the robot's root frame.""" 25 | robot: RigidObject = env.scene[robot_cfg.name] 26 | object: RigidObject = env.scene[object_cfg.name] 27 | object_pos_w = object.data.root_pos_w[:, :3] 28 | object_pos_b, _ = subtract_frame_transforms( 29 | robot.data.root_state_w[:, :3], robot.data.root_state_w[:, 3:7], object_pos_w 30 | ) 31 | return object_pos_b 32 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/lift/mdp/rewards.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from __future__ import annotations 7 | 8 | import torch 9 | from typing import TYPE_CHECKING 10 | 11 | from isaaclab.assets import RigidObject 12 | from isaaclab.managers import SceneEntityCfg 13 | from isaaclab.sensors import FrameTransformer 14 | from isaaclab.utils.math import combine_frame_transforms 15 | 16 | if TYPE_CHECKING: 17 | from isaaclab.envs import ManagerBasedRLEnv 18 | 19 | 20 | def object_is_lifted( 21 | env: ManagerBasedRLEnv, minimal_height: float, object_cfg: SceneEntityCfg = SceneEntityCfg("object") 22 | ) -> torch.Tensor: 23 | """Reward the agent for lifting the object above the minimal height.""" 24 | object: RigidObject = env.scene[object_cfg.name] 25 | return torch.where(object.data.root_pos_w[:, 2] > minimal_height, 1.0, 0.0) 26 | 27 | 28 | def object_ee_distance( 29 | env: ManagerBasedRLEnv, 30 | std: float, 31 | object_cfg: SceneEntityCfg = SceneEntityCfg("object"), 32 | ee_frame_cfg: SceneEntityCfg = SceneEntityCfg("ee_frame"), 33 | ) -> torch.Tensor: 34 | """Reward the agent for reaching the object using tanh-kernel.""" 35 | # extract the used quantities (to enable type-hinting) 36 | object: RigidObject = env.scene[object_cfg.name] 37 | ee_frame: FrameTransformer = env.scene[ee_frame_cfg.name] 38 | # Target object position: (num_envs, 3) 39 | cube_pos_w = object.data.root_pos_w 40 | # End-effector position: (num_envs, 3) 41 | ee_w = ee_frame.data.target_pos_w[..., 0, :] 42 | # Distance of the end-effector to the object: (num_envs,) 43 | object_ee_distance = torch.norm(cube_pos_w - ee_w, dim=1) 44 | 45 | return 1 - torch.tanh(object_ee_distance / std) 46 | 47 | 48 | def object_goal_distance( 49 | env: ManagerBasedRLEnv, 50 | std: float, 51 | minimal_height: float, 52 | command_name: str, 53 | robot_cfg: SceneEntityCfg = SceneEntityCfg("robot"), 54 | object_cfg: SceneEntityCfg = SceneEntityCfg("object"), 55 | ) -> torch.Tensor: 56 | """Reward the agent for tracking the goal pose using tanh-kernel.""" 57 | # extract the used quantities (to enable type-hinting) 58 | robot: RigidObject = env.scene[robot_cfg.name] 59 | object: RigidObject = env.scene[object_cfg.name] 60 | command = env.command_manager.get_command(command_name) 61 | # compute the desired position in the world frame 62 | des_pos_b = command[:, :3] 63 | des_pos_w, _ = combine_frame_transforms(robot.data.root_state_w[:, :3], robot.data.root_state_w[:, 3:7], des_pos_b) 64 | # distance of the end-effector to the object: (num_envs,) 65 | distance = torch.norm(des_pos_w - object.data.root_pos_w[:, :3], dim=1) 66 | # rewarded if the object is lifted above the threshold 67 | return (object.data.root_pos_w[:, 2] > minimal_height) * (1 - torch.tanh(distance / std)) 68 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/lift/mdp/terminations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Common functions that can be used to activate certain terminations for the lift task. 7 | 8 | The functions can be passed to the :class:`isaaclab.managers.TerminationTermCfg` object to enable 9 | the termination introduced by the function. 10 | """ 11 | 12 | from __future__ import annotations 13 | 14 | import torch 15 | from typing import TYPE_CHECKING 16 | 17 | from isaaclab.assets import RigidObject 18 | from isaaclab.managers import SceneEntityCfg 19 | from isaaclab.utils.math import combine_frame_transforms 20 | 21 | if TYPE_CHECKING: 22 | from isaaclab.envs import ManagerBasedRLEnv 23 | 24 | 25 | def object_reached_goal( 26 | env: ManagerBasedRLEnv, 27 | command_name: str = "object_pose", 28 | threshold: float = 0.02, 29 | robot_cfg: SceneEntityCfg = SceneEntityCfg("robot"), 30 | object_cfg: SceneEntityCfg = SceneEntityCfg("object"), 31 | ) -> torch.Tensor: 32 | """Termination condition for the object reaching the goal position. 33 | 34 | Args: 35 | env: The environment. 36 | command_name: The name of the command that is used to control the object. 37 | threshold: The threshold for the object to reach the goal position. Defaults to 0.02. 38 | robot_cfg: The robot configuration. Defaults to SceneEntityCfg("robot"). 39 | object_cfg: The object configuration. Defaults to SceneEntityCfg("object"). 40 | 41 | """ 42 | # extract the used quantities (to enable type-hinting) 43 | robot: RigidObject = env.scene[robot_cfg.name] 44 | object: RigidObject = env.scene[object_cfg.name] 45 | command = env.command_manager.get_command(command_name) 46 | # compute the desired position in the world frame 47 | des_pos_b = command[:, :3] 48 | des_pos_w, _ = combine_frame_transforms(robot.data.root_state_w[:, :3], robot.data.root_state_w[:, 3:7], des_pos_b) 49 | # distance of the end-effector to the object: (num_envs,) 50 | distance = torch.norm(des_pos_w - object.data.root_pos_w[:, :3], dim=1) 51 | 52 | # rewarded if the object is lifted above the threshold 53 | return distance < threshold 54 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Fixed-arm environments with end-effector pose tracking commands.""" 7 | 8 | # 导入config模块来注册环境 9 | from . import config 10 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Configurations for arm-based reach-tracking environments.""" 7 | 8 | # We leave this file empty since we don't want to expose any configs in this package directly. 9 | # We still need this file to import the "config" module in the parent package. 10 | from .franka import * 11 | from .kinova_gripper import * 12 | from .ur_10 import * -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/franka/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | import gymnasium as gym 7 | 8 | from . import agents 9 | 10 | ## 11 | # Register Gym environments. 12 | ## 13 | 14 | ## 15 | # Joint Position Control 16 | ## 17 | 18 | gym.register( 19 | id="Template-Isaac-Reach-Franka-v0", 20 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 21 | disable_env_checker=True, 22 | kwargs={ 23 | "env_cfg_entry_point": f"{__name__}.joint_pos_env_cfg:FrankaReachEnvCfg", 24 | "rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml", 25 | "rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:FrankaReachPPORunnerCfg", 26 | "skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml", 27 | }, 28 | ) 29 | 30 | gym.register( 31 | id="Template-Isaac-Reach-Franka-Play-v0", 32 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 33 | disable_env_checker=True, 34 | kwargs={ 35 | "env_cfg_entry_point": f"{__name__}.joint_pos_env_cfg:FrankaReachEnvCfg_PLAY", 36 | "rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml", 37 | "rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:FrankaReachPPORunnerCfg", 38 | "skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml", 39 | }, 40 | ) 41 | 42 | 43 | ## 44 | # Inverse Kinematics - Absolute Pose Control 45 | ## 46 | 47 | gym.register( 48 | id="Template-Isaac-Reach-Franka-IK-Abs-v0", 49 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 50 | kwargs={ 51 | "env_cfg_entry_point": f"{__name__}.ik_abs_env_cfg:FrankaReachEnvCfg", 52 | }, 53 | disable_env_checker=True, 54 | ) 55 | 56 | ## 57 | # Inverse Kinematics - Relative Pose Control 58 | ## 59 | 60 | gym.register( 61 | id="Template-Isaac-Reach-Franka-IK-Rel-v0", 62 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 63 | kwargs={ 64 | "env_cfg_entry_point": f"{__name__}.ik_rel_env_cfg:FrankaReachEnvCfg", 65 | }, 66 | disable_env_checker=True, 67 | ) 68 | 69 | ## 70 | # Operational Space Control 71 | ## 72 | 73 | gym.register( 74 | id="Template-Isaac-Reach-Franka-OSC-v0", 75 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 76 | disable_env_checker=True, 77 | kwargs={ 78 | "env_cfg_entry_point": f"{__name__}.osc_env_cfg:FrankaReachEnvCfg", 79 | "rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:FrankaReachPPORunnerCfg", 80 | }, 81 | ) 82 | 83 | gym.register( 84 | id="Template-Isaac-Reach-Franka-OSC-Play-v0", 85 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 86 | disable_env_checker=True, 87 | kwargs={ 88 | "env_cfg_entry_point": f"{__name__}.osc_env_cfg:FrankaReachEnvCfg_PLAY", 89 | "rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:FrankaReachPPORunnerCfg", 90 | }, 91 | ) 92 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/franka/agents/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/franka/agents/rl_games_ppo_cfg.yaml: -------------------------------------------------------------------------------- 1 | params: 2 | seed: 42 3 | 4 | # environment wrapper clipping 5 | env: 6 | clip_observations: 100.0 7 | clip_actions: 100.0 8 | 9 | algo: 10 | name: a2c_continuous 11 | 12 | model: 13 | name: continuous_a2c_logstd 14 | 15 | network: 16 | name: actor_critic 17 | separate: False 18 | space: 19 | continuous: 20 | mu_activation: None 21 | sigma_activation: None 22 | 23 | mu_init: 24 | name: default 25 | sigma_init: 26 | name: const_initializer 27 | val: 0 28 | fixed_sigma: True 29 | mlp: 30 | units: [64, 64] 31 | activation: elu 32 | d2rl: False 33 | 34 | initializer: 35 | name: default 36 | regularizer: 37 | name: None 38 | 39 | load_checkpoint: False # flag which sets whether to load the checkpoint 40 | load_path: '' # path to the checkpoint to load 41 | 42 | config: 43 | name: reach_franka 44 | env_name: rlgpu 45 | device: 'cuda:0' 46 | device_name: 'cuda:0' 47 | multi_gpu: False 48 | ppo: True 49 | mixed_precision: False 50 | normalize_input: True 51 | normalize_value: True 52 | value_bootstrap: True 53 | num_actors: -1 54 | reward_shaper: 55 | scale_value: 1.0 56 | normalize_advantage: True 57 | gamma: 0.99 58 | tau: 0.95 59 | learning_rate: 1e-3 60 | lr_schedule: adaptive 61 | schedule_type: legacy 62 | kl_threshold: 0.01 63 | score_to_win: 10000 64 | max_epochs: 1000 65 | save_best_after: 200 66 | save_frequency: 100 67 | print_stats: True 68 | grad_norm: 1.0 69 | entropy_coef: 0.01 70 | truncate_grads: True 71 | e_clip: 0.2 72 | horizon_length: 24 73 | minibatch_size: 24576 74 | mini_epochs: 5 75 | critic_coef: 2 76 | clip_value: True 77 | clip_actions: False 78 | bounds_loss_coef: 0.0001 79 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/franka/agents/rsl_rl_ppo_cfg.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from isaaclab.utils import configclass 7 | 8 | from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlPpoActorCriticCfg, RslRlPpoAlgorithmCfg 9 | 10 | 11 | @configclass 12 | class FrankaReachPPORunnerCfg(RslRlOnPolicyRunnerCfg): 13 | num_steps_per_env = 24 14 | max_iterations = 1000 15 | save_interval = 50 16 | experiment_name = "franka_reach" 17 | run_name = "" 18 | resume = False 19 | empirical_normalization = False 20 | policy = RslRlPpoActorCriticCfg( 21 | init_noise_std=1.0, 22 | actor_hidden_dims=[64, 64], 23 | critic_hidden_dims=[64, 64], 24 | activation="elu", 25 | ) 26 | algorithm = RslRlPpoAlgorithmCfg( 27 | value_loss_coef=1.0, 28 | use_clipped_value_loss=True, 29 | clip_param=0.2, 30 | entropy_coef=0.001, 31 | num_learning_epochs=8, 32 | num_mini_batches=4, 33 | learning_rate=1.0e-3, 34 | schedule="adaptive", 35 | gamma=0.99, 36 | lam=0.95, 37 | desired_kl=0.01, 38 | max_grad_norm=1.0, 39 | ) 40 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/franka/agents/skrl_ppo_cfg.yaml: -------------------------------------------------------------------------------- 1 | seed: 42 2 | 3 | 4 | # Models are instantiated using skrl's model instantiator utility 5 | # https://skrl.readthedocs.io/en/latest/api/utils/model_instantiators.html 6 | models: 7 | separate: False 8 | policy: # see gaussian_model parameters 9 | class: GaussianMixin 10 | clip_actions: False 11 | clip_log_std: True 12 | min_log_std: -20.0 13 | max_log_std: 2.0 14 | initial_log_std: 0.0 15 | network: 16 | - name: net 17 | input: STATES 18 | layers: [64, 64] 19 | activations: elu 20 | output: ACTIONS 21 | value: # see deterministic_model parameters 22 | class: DeterministicMixin 23 | clip_actions: False 24 | network: 25 | - name: net 26 | input: STATES 27 | layers: [64, 64] 28 | activations: elu 29 | output: ONE 30 | 31 | 32 | # Rollout memory 33 | # https://skrl.readthedocs.io/en/latest/api/memories/random.html 34 | memory: 35 | class: RandomMemory 36 | memory_size: -1 # automatically determined (same as agent:rollouts) 37 | 38 | 39 | # PPO agent configuration (field names are from PPO_DEFAULT_CONFIG) 40 | # https://skrl.readthedocs.io/en/latest/api/agents/ppo.html 41 | agent: 42 | class: PPO 43 | rollouts: 24 44 | learning_epochs: 5 45 | mini_batches: 4 46 | discount_factor: 0.99 47 | lambda: 0.95 48 | learning_rate: 1.0e-03 49 | learning_rate_scheduler: KLAdaptiveLR 50 | learning_rate_scheduler_kwargs: 51 | kl_threshold: 0.01 52 | state_preprocessor: RunningStandardScaler 53 | state_preprocessor_kwargs: null 54 | value_preprocessor: RunningStandardScaler 55 | value_preprocessor_kwargs: null 56 | random_timesteps: 0 57 | learning_starts: 0 58 | grad_norm_clip: 1.0 59 | ratio_clip: 0.2 60 | value_clip: 0.2 61 | clip_predicted_values: True 62 | entropy_loss_scale: 0.01 63 | value_loss_scale: 1.0 64 | kl_threshold: 0.0 65 | rewards_shaper_scale: 1.0 66 | time_limit_bootstrap: False 67 | # logging and checkpoint 68 | experiment: 69 | directory: "reach_franka" 70 | experiment_name: "" 71 | write_interval: auto 72 | checkpoint_interval: auto 73 | 74 | 75 | # Sequential trainer 76 | # https://skrl.readthedocs.io/en/latest/api/trainers/sequential.html 77 | trainer: 78 | class: SequentialTrainer 79 | timesteps: 24000 80 | environment_info: log 81 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/franka/ik_abs_env_cfg.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from isaaclab.controllers.differential_ik_cfg import DifferentialIKControllerCfg 7 | from isaaclab.envs.mdp.actions.actions_cfg import DifferentialInverseKinematicsActionCfg 8 | from isaaclab.utils import configclass 9 | 10 | from . import joint_pos_env_cfg 11 | 12 | ## 13 | # Pre-defined configs 14 | ## 15 | from isaacLab.manipulation.assets.config.franka import FRANKA_PANDA_HIGH_PD_CFG # isort: skip 16 | 17 | 18 | @configclass 19 | class FrankaReachEnvCfg(joint_pos_env_cfg.FrankaReachEnvCfg): 20 | def __post_init__(self): 21 | # post init of parent 22 | super().__post_init__() 23 | 24 | # Set Franka as robot 25 | # We switch here to a stiffer PD controller for IK tracking to be better. 26 | self.scene.robot = FRANKA_PANDA_HIGH_PD_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") 27 | 28 | # Set actions for the specific robot type (franka) 29 | self.actions.arm_action = DifferentialInverseKinematicsActionCfg( 30 | asset_name="robot", 31 | joint_names=["panda_joint.*"], 32 | body_name="panda_hand", 33 | controller=DifferentialIKControllerCfg(command_type="pose", use_relative_mode=False, ik_method="dls"), 34 | body_offset=DifferentialInverseKinematicsActionCfg.OffsetCfg(pos=[0.0, 0.0, 0.107]), 35 | ) 36 | 37 | 38 | @configclass 39 | class FrankaReachEnvCfg_PLAY(FrankaReachEnvCfg): 40 | def __post_init__(self): 41 | # post init of parent 42 | super().__post_init__() 43 | # make a smaller scene for play 44 | self.scene.num_envs = 50 45 | self.scene.env_spacing = 2.5 46 | # disable randomization for play 47 | self.observations.policy.enable_corruption = False 48 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/franka/ik_rel_env_cfg.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from isaaclab.controllers.differential_ik_cfg import DifferentialIKControllerCfg 7 | from isaaclab.envs.mdp.actions.actions_cfg import DifferentialInverseKinematicsActionCfg 8 | from isaaclab.utils import configclass 9 | 10 | from . import joint_pos_env_cfg 11 | 12 | ## 13 | # Pre-defined configs 14 | ## 15 | from isaacLab.manipulation.assets.config.franka import FRANKA_PANDA_HIGH_PD_CFG # isort: skip 16 | 17 | 18 | @configclass 19 | class FrankaReachEnvCfg(joint_pos_env_cfg.FrankaReachEnvCfg): 20 | def __post_init__(self): 21 | # post init of parent 22 | super().__post_init__() 23 | 24 | # Set Franka as robot 25 | # We switch here to a stiffer PD controller for IK tracking to be better. 26 | self.scene.robot = FRANKA_PANDA_HIGH_PD_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") 27 | 28 | # Set actions for the specific robot type (franka) 29 | self.actions.arm_action = DifferentialInverseKinematicsActionCfg( 30 | asset_name="robot", 31 | joint_names=["panda_joint.*"], 32 | body_name="panda_hand", 33 | controller=DifferentialIKControllerCfg(command_type="pose", use_relative_mode=True, ik_method="dls"), 34 | scale=0.5, 35 | body_offset=DifferentialInverseKinematicsActionCfg.OffsetCfg(pos=[0.0, 0.0, 0.107]), 36 | ) 37 | 38 | 39 | @configclass 40 | class FrankaReachEnvCfg_PLAY(FrankaReachEnvCfg): 41 | def __post_init__(self): 42 | # post init of parent 43 | super().__post_init__() 44 | # make a smaller scene for play 45 | self.scene.num_envs = 50 46 | self.scene.env_spacing = 2.5 47 | # disable randomization for play 48 | self.observations.policy.enable_corruption = False 49 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/franka/joint_pos_env_cfg.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | import math 7 | 8 | from isaaclab.utils import configclass 9 | 10 | import isaacLab.manipulation.tasks.Robot_arm.reach.mdp as mdp 11 | import isaaclab_tasks.manager_based.manipulation.reach.mdp as general_mdp 12 | from isaacLab.manipulation.tasks.Robot_arm.reach.reach_env_cfg import ReachEnvCfg 13 | 14 | ## 15 | # Pre-defined configs 16 | ## 17 | from isaacLab.manipulation.assets.config.franka import FRANKA_PANDA_CFG # isort: skip 18 | 19 | 20 | ## 21 | # Environment configuration 22 | ## 23 | 24 | 25 | @configclass 26 | class FrankaReachEnvCfg(ReachEnvCfg): 27 | def __post_init__(self): 28 | # post init of parent 29 | super().__post_init__() 30 | 31 | # switch robot to franka 32 | self.scene.robot = FRANKA_PANDA_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") 33 | # override rewards 34 | self.rewards.end_effector_position_tracking.params["asset_cfg"].body_names = ["panda_hand"] 35 | self.rewards.end_effector_position_tracking_fine_grained.params["asset_cfg"].body_names = ["panda_hand"] 36 | self.rewards.end_effector_orientation_tracking.params["asset_cfg"].body_names = ["panda_hand"] 37 | 38 | # override actions 39 | self.actions.arm_action = general_mdp.JointPositionActionCfg( 40 | asset_name="robot", joint_names=["panda_joint.*"], scale=0.5, use_default_offset=True 41 | ) 42 | # override command generator body 43 | # end-effector is along z-direction 44 | self.commands.ee_pose.body_name = "panda_hand" 45 | self.commands.ee_pose.ranges.pitch = (math.pi, math.pi) 46 | 47 | 48 | @configclass 49 | class FrankaReachEnvCfg_PLAY(FrankaReachEnvCfg): 50 | def __post_init__(self): 51 | # post init of parent 52 | super().__post_init__() 53 | # make a smaller scene for play 54 | self.scene.num_envs = 50 55 | self.scene.env_spacing = 2.5 56 | # disable randomization for play 57 | self.observations.policy.enable_corruption = False 58 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/franka/osc_env_cfg.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from isaaclab.controllers.operational_space_cfg import OperationalSpaceControllerCfg 7 | from isaaclab.envs.mdp.actions.actions_cfg import OperationalSpaceControllerActionCfg 8 | from isaaclab.utils import configclass 9 | 10 | from . import joint_pos_env_cfg 11 | 12 | ## 13 | # Pre-defined configs 14 | ## 15 | from isaacLab.manipulation.assets.config.franka import FRANKA_PANDA_CFG # isort: skip 16 | 17 | 18 | @configclass 19 | class FrankaReachEnvCfg(joint_pos_env_cfg.FrankaReachEnvCfg): 20 | def __post_init__(self): 21 | # post init of parent 22 | super().__post_init__() 23 | 24 | # Set Franka as robot 25 | # We remove stiffness and damping for the shoulder and forearm joints for effort control 26 | self.scene.robot = FRANKA_PANDA_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") 27 | self.scene.robot.actuators["panda_shoulder"].stiffness = 0.0 28 | self.scene.robot.actuators["panda_shoulder"].damping = 0.0 29 | self.scene.robot.actuators["panda_forearm"].stiffness = 0.0 30 | self.scene.robot.actuators["panda_forearm"].damping = 0.0 31 | self.scene.robot.spawn.rigid_props.disable_gravity = True 32 | 33 | # If closed-loop contact force control is desired, contact sensors should be enabled for the robot 34 | # self.scene.robot.spawn.activate_contact_sensors = True 35 | 36 | self.actions.arm_action = OperationalSpaceControllerActionCfg( 37 | asset_name="robot", 38 | joint_names=["panda_joint.*"], 39 | body_name="panda_hand", 40 | # If a task frame different from articulation root/base is desired, a RigidObject, e.g., "task_frame", 41 | # can be added to the scene and its relative path could provided as task_frame_rel_path 42 | # task_frame_rel_path="task_frame", 43 | controller_cfg=OperationalSpaceControllerCfg( 44 | target_types=["pose_abs"], 45 | impedance_mode="variable_kp", 46 | inertial_dynamics_decoupling=True, 47 | partial_inertial_dynamics_decoupling=False, 48 | gravity_compensation=False, 49 | motion_stiffness_task=100.0, 50 | motion_damping_ratio_task=1.0, 51 | motion_stiffness_limits_task=(50.0, 200.0), 52 | nullspace_control="position", 53 | ), 54 | nullspace_joint_pos_target="center", 55 | position_scale=1.0, 56 | orientation_scale=1.0, 57 | stiffness_scale=100.0, 58 | ) 59 | # Removing these observations as they are not needed for OSC and we want keep the observation space small 60 | self.observations.policy.joint_pos = None 61 | self.observations.policy.joint_vel = None 62 | 63 | 64 | @configclass 65 | class FrankaReachEnvCfg_PLAY(FrankaReachEnvCfg): 66 | def __post_init__(self): 67 | # post init of parent 68 | super().__post_init__() 69 | # make a smaller scene for play 70 | self.scene.num_envs = 16 71 | self.scene.env_spacing = 2.5 72 | # disable randomization for play 73 | self.observations.policy.enable_corruption = False 74 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/kinova_gripper/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2024, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | import gymnasium as gym 7 | 8 | from . import agents, joint_pos_env_cfg 9 | 10 | ## 11 | # Register Gym environments. 12 | ## 13 | 14 | gym.register( 15 | id="Template-Isaac-Reach-Kinova-v0", 16 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 17 | disable_env_checker=True, 18 | kwargs={ 19 | "env_cfg_entry_point": joint_pos_env_cfg.KinovaReachEnvCfg, 20 | "rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml", 21 | "rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:KinovaReachPPORunnerCfg", 22 | "skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml", 23 | }, 24 | ) 25 | 26 | gym.register( 27 | id="Template-Isaac-Reach-Kinova-Play-v0", 28 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 29 | disable_env_checker=True, 30 | kwargs={ 31 | "env_cfg_entry_point": joint_pos_env_cfg.KinovaReachEnvCfg_PLAY, 32 | "rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml", 33 | "rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:KinovaReachPPORunnerCfg", 34 | "skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml", 35 | }, 36 | ) 37 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/kinova_gripper/agents/rl_games_ppo_cfg.yaml: -------------------------------------------------------------------------------- 1 | params: 2 | seed: 42 3 | 4 | # environment wrapper clipping 5 | env: 6 | clip_observations: 100.0 7 | clip_actions: 100.0 8 | 9 | algo: 10 | name: a2c_continuous 11 | 12 | model: 13 | name: continuous_a2c_logstd 14 | 15 | network: 16 | name: actor_critic 17 | separate: False 18 | space: 19 | continuous: 20 | mu_activation: None 21 | sigma_activation: None 22 | 23 | mu_init: 24 | name: default 25 | sigma_init: 26 | name: const_initializer 27 | val: 0 28 | fixed_sigma: True 29 | mlp: 30 | units: [64, 64] 31 | activation: elu 32 | d2rl: False 33 | 34 | initializer: 35 | name: default 36 | regularizer: 37 | name: None 38 | 39 | load_checkpoint: False # flag which sets whether to load the checkpoint 40 | load_path: '' # path to the checkpoint to load 41 | 42 | config: 43 | name: reach_kinova 44 | env_name: rlgpu 45 | device: 'cuda:0' 46 | device_name: 'cuda:0' 47 | multi_gpu: False 48 | ppo: True 49 | mixed_precision: False 50 | normalize_input: True 51 | normalize_value: True 52 | value_bootstrap: True 53 | num_actors: -1 54 | reward_shaper: 55 | scale_value: 1.0 56 | normalize_advantage: True 57 | gamma: 0.99 58 | tau: 0.95 59 | learning_rate: 1e-3 60 | lr_schedule: adaptive 61 | schedule_type: legacy 62 | kl_threshold: 0.01 63 | score_to_win: 10000 64 | max_epochs: 1000 65 | save_best_after: 200 66 | save_frequency: 100 67 | print_stats: True 68 | grad_norm: 1.0 69 | entropy_coef: 0.01 70 | truncate_grads: True 71 | e_clip: 0.2 72 | horizon_length: 24 73 | minibatch_size: 24576 74 | mini_epochs: 5 75 | critic_coef: 2 76 | clip_value: True 77 | clip_actions: False 78 | bounds_loss_coef: 0.0001 79 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/kinova_gripper/agents/rsl_rl_ppo_cfg.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2024, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from isaaclab.utils import configclass 7 | 8 | from isaaclab_rl.rsl_rl import ( 9 | RslRlOnPolicyRunnerCfg, 10 | RslRlPpoActorCriticCfg, 11 | RslRlPpoAlgorithmCfg, 12 | ) 13 | 14 | 15 | @configclass 16 | class KinovaReachPPORunnerCfg(RslRlOnPolicyRunnerCfg): 17 | num_steps_per_env = 24 18 | max_iterations = 1000 19 | save_interval = 50 20 | experiment_name = "reach_kinova" 21 | run_name = "" 22 | resume = False 23 | empirical_normalization = False 24 | policy = RslRlPpoActorCriticCfg( 25 | init_noise_std=1.0, 26 | actor_hidden_dims=[64, 64], 27 | critic_hidden_dims=[64, 64], 28 | activation="elu", 29 | ) 30 | algorithm = RslRlPpoAlgorithmCfg( 31 | value_loss_coef=1.0, 32 | use_clipped_value_loss=True, 33 | clip_param=0.2, 34 | entropy_coef=0.01, 35 | num_learning_epochs=8, 36 | num_mini_batches=4, 37 | learning_rate=1.0e-3, 38 | schedule="adaptive", 39 | gamma=0.99, 40 | lam=0.95, 41 | desired_kl=0.01, 42 | max_grad_norm=1.0, 43 | ) 44 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/kinova_gripper/agents/skrl_ppo_cfg.yaml: -------------------------------------------------------------------------------- 1 | seed: 42 2 | 3 | # Models are instantiated using skrl's model instantiator utility 4 | # https://skrl.readthedocs.io/en/latest/api/utils/model_instantiators.html 5 | models: 6 | separate: False 7 | policy: # see skrl.utils.model_instantiators.torch.gaussian_model for parameter details 8 | clip_actions: False 9 | clip_log_std: True 10 | initial_log_std: 0 11 | min_log_std: -20.0 12 | max_log_std: 2.0 13 | input_shape: "Shape.STATES" 14 | hiddens: [64, 64] 15 | hidden_activation: ["elu", "elu"] 16 | output_shape: "Shape.ACTIONS" 17 | output_activation: "" 18 | output_scale: 1.0 19 | value: # see skrl.utils.model_instantiators.torch.deterministic_model for parameter details 20 | clip_actions: False 21 | input_shape: "Shape.STATES" 22 | hiddens: [64, 64] 23 | hidden_activation: ["elu", "elu"] 24 | output_shape: "Shape.ONE" 25 | output_activation: "" 26 | output_scale: 1.0 27 | 28 | 29 | # PPO agent configuration (field names are from PPO_DEFAULT_CONFIG) 30 | # https://skrl.readthedocs.io/en/latest/api/agents/ppo.html 31 | agent: 32 | rollouts: 24 33 | learning_epochs: 8 34 | mini_batches: 4 35 | discount_factor: 0.99 36 | lambda: 0.95 37 | learning_rate: 1.e-3 38 | learning_rate_scheduler: "KLAdaptiveLR" 39 | learning_rate_scheduler_kwargs: 40 | kl_threshold: 0.01 41 | state_preprocessor: "RunningStandardScaler" 42 | state_preprocessor_kwargs: null 43 | value_preprocessor: "RunningStandardScaler" 44 | value_preprocessor_kwargs: null 45 | random_timesteps: 0 46 | learning_starts: 0 47 | grad_norm_clip: 1.0 48 | ratio_clip: 0.2 49 | value_clip: 0.2 50 | clip_predicted_values: True 51 | entropy_loss_scale: 0.0 52 | value_loss_scale: 2.0 53 | kl_threshold: 0 54 | rewards_shaper_scale: 0.01 55 | # logging and checkpoint 56 | experiment: 57 | directory: "reach_kinova" 58 | experiment_name: "" 59 | write_interval: 120 60 | checkpoint_interval: 1200 61 | 62 | 63 | # Sequential trainer 64 | # https://skrl.readthedocs.io/en/latest/api/trainers/sequential.html 65 | trainer: 66 | timesteps: 24000 67 | environment_info: "log" 68 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/kinova_gripper/joint_pos_env_cfg.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2024, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | import math 7 | 8 | from isaaclab.utils import configclass 9 | 10 | #import isaaclab_tasks.manager_based.manipulation.reach.mdp as mdp 11 | import isaacLab.manipulation.tasks.Robot_arm.reach.mdp as mdp 12 | import isaaclab_tasks.manager_based.manipulation.reach.mdp as general_mdp 13 | #from isaacLab.manipulation.tasks.Robot_arm.reach.reach_env_cfg import ReachEnvCfg 14 | from isaaclab_tasks.manager_based.manipulation.reach.reach_env_cfg import ReachEnvCfg 15 | 16 | ## 17 | # Pre-defined configs 18 | ## 19 | from isaacLab.manipulation.assets.config.kinova_gripper import KINOVA_ROBOTIQ # isort: skip 20 | 21 | 22 | ## 23 | # Environment configuration 24 | ## 25 | 26 | 27 | @configclass 28 | class KinovaReachEnvCfg(ReachEnvCfg): 29 | def __post_init__(self): 30 | # post init of parent 31 | super().__post_init__() 32 | 33 | # switch robot to ur10 34 | self.scene.robot = KINOVA_ROBOTIQ.replace(prim_path="{ENV_REGEX_NS}/Robot") 35 | self.scene.replicate_physics=False 36 | # override events 37 | self.events.reset_robot_joints.params["position_range"] = (0.75, 1.25) 38 | # override rewards 39 | self.rewards.end_effector_position_tracking.params["asset_cfg"].body_names = ["end_effector_link"] 40 | self.rewards.end_effector_position_tracking_fine_grained.params["asset_cfg"].body_names = ["end_effector_link"] 41 | self.rewards.end_effector_orientation_tracking.params["asset_cfg"].body_names = ["end_effector_link"] 42 | # override actions 43 | self.actions.arm_action = general_mdp.RelativeJointPositionActionCfg( 44 | asset_name="robot", joint_names=["joint_[1-7]"], scale=0.04 45 | ) 46 | 47 | # override command generator body 48 | # end-effector is along x-direction 49 | self.commands.ee_pose.body_name = "end_effector_link" 50 | self.commands.ee_pose.ranges.pitch = (math.pi / 2, math.pi / 2) 51 | 52 | 53 | @configclass 54 | class KinovaReachEnvCfg_PLAY(KinovaReachEnvCfg): 55 | def __post_init__(self): 56 | # post init of parent 57 | super().__post_init__() 58 | # make a smaller scene for play 59 | self.scene.num_envs = 50 60 | self.scene.env_spacing = 2.5 61 | self.scene.replicate_physics=False 62 | # disable randomization for play 63 | self.observations.policy.enable_corruption = False 64 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/ur_10/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | import gymnasium as gym 7 | 8 | from . import agents 9 | 10 | ## 11 | # Register Gym environments. 12 | ## 13 | 14 | gym.register( 15 | id="Template-Isaac-Reach-UR10-v0", 16 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 17 | disable_env_checker=True, 18 | kwargs={ 19 | "env_cfg_entry_point": f"{__name__}.joint_pos_env_cfg:UR10ReachEnvCfg", 20 | "rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml", 21 | "rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:UR10ReachPPORunnerCfg", 22 | "skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml", 23 | }, 24 | ) 25 | 26 | gym.register( 27 | id="Template-Isaac-Reach-UR10-Play-v0", 28 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 29 | disable_env_checker=True, 30 | kwargs={ 31 | "env_cfg_entry_point": f"{__name__}.joint_pos_env_cfg:UR10ReachEnvCfg_PLAY", 32 | "rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml", 33 | "rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:UR10ReachPPORunnerCfg", 34 | "skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml", 35 | }, 36 | ) 37 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/ur_10/agents/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/ur_10/agents/rl_games_ppo_cfg.yaml: -------------------------------------------------------------------------------- 1 | params: 2 | seed: 42 3 | 4 | # environment wrapper clipping 5 | env: 6 | clip_observations: 100.0 7 | clip_actions: 100.0 8 | 9 | algo: 10 | name: a2c_continuous 11 | 12 | model: 13 | name: continuous_a2c_logstd 14 | 15 | network: 16 | name: actor_critic 17 | separate: False 18 | space: 19 | continuous: 20 | mu_activation: None 21 | sigma_activation: None 22 | 23 | mu_init: 24 | name: default 25 | sigma_init: 26 | name: const_initializer 27 | val: 0 28 | fixed_sigma: True 29 | mlp: 30 | units: [64, 64] 31 | activation: elu 32 | d2rl: False 33 | 34 | initializer: 35 | name: default 36 | regularizer: 37 | name: None 38 | 39 | load_checkpoint: False # flag which sets whether to load the checkpoint 40 | load_path: '' # path to the checkpoint to load 41 | 42 | config: 43 | name: reach_ur10 44 | env_name: rlgpu 45 | device: 'cuda:0' 46 | device_name: 'cuda:0' 47 | multi_gpu: False 48 | ppo: True 49 | mixed_precision: False 50 | normalize_input: True 51 | normalize_value: True 52 | value_bootstrap: True 53 | num_actors: -1 54 | reward_shaper: 55 | scale_value: 1.0 56 | normalize_advantage: True 57 | gamma: 0.99 58 | tau: 0.95 59 | learning_rate: 1e-3 60 | lr_schedule: adaptive 61 | schedule_type: legacy 62 | kl_threshold: 0.01 63 | score_to_win: 10000 64 | max_epochs: 1000 65 | save_best_after: 200 66 | save_frequency: 100 67 | print_stats: True 68 | grad_norm: 1.0 69 | entropy_coef: 0.01 70 | truncate_grads: True 71 | e_clip: 0.2 72 | horizon_length: 24 73 | minibatch_size: 24576 74 | mini_epochs: 5 75 | critic_coef: 2 76 | clip_value: True 77 | clip_actions: False 78 | bounds_loss_coef: 0.0001 79 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/ur_10/agents/rsl_rl_ppo_cfg.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from isaaclab.utils import configclass 7 | 8 | from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlPpoActorCriticCfg, RslRlPpoAlgorithmCfg 9 | 10 | 11 | @configclass 12 | class UR10ReachPPORunnerCfg(RslRlOnPolicyRunnerCfg): 13 | num_steps_per_env = 24 14 | max_iterations = 1000 15 | save_interval = 50 16 | experiment_name = "reach_ur10" 17 | run_name = "" 18 | resume = False 19 | empirical_normalization = False 20 | policy = RslRlPpoActorCriticCfg( 21 | init_noise_std=1.0, 22 | actor_hidden_dims=[64, 64], 23 | critic_hidden_dims=[64, 64], 24 | activation="elu", 25 | ) 26 | algorithm = RslRlPpoAlgorithmCfg( 27 | value_loss_coef=1.0, 28 | use_clipped_value_loss=True, 29 | clip_param=0.2, 30 | entropy_coef=0.01, 31 | num_learning_epochs=8, 32 | num_mini_batches=4, 33 | learning_rate=1.0e-3, 34 | schedule="adaptive", 35 | gamma=0.99, 36 | lam=0.95, 37 | desired_kl=0.01, 38 | max_grad_norm=1.0, 39 | ) 40 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/ur_10/agents/skrl_ppo_cfg.yaml: -------------------------------------------------------------------------------- 1 | seed: 42 2 | 3 | 4 | # Models are instantiated using skrl's model instantiator utility 5 | # https://skrl.readthedocs.io/en/latest/api/utils/model_instantiators.html 6 | models: 7 | separate: False 8 | policy: # see gaussian_model parameters 9 | class: GaussianMixin 10 | clip_actions: False 11 | clip_log_std: True 12 | min_log_std: -20.0 13 | max_log_std: 2.0 14 | initial_log_std: 0.0 15 | network: 16 | - name: net 17 | input: STATES 18 | layers: [64, 64] 19 | activations: elu 20 | output: ACTIONS 21 | value: # see deterministic_model parameters 22 | class: DeterministicMixin 23 | clip_actions: False 24 | network: 25 | - name: net 26 | input: STATES 27 | layers: [64, 64] 28 | activations: elu 29 | output: ONE 30 | 31 | 32 | # Rollout memory 33 | # https://skrl.readthedocs.io/en/latest/api/memories/random.html 34 | memory: 35 | class: RandomMemory 36 | memory_size: -1 # automatically determined (same as agent:rollouts) 37 | 38 | 39 | # PPO agent configuration (field names are from PPO_DEFAULT_CONFIG) 40 | # https://skrl.readthedocs.io/en/latest/api/agents/ppo.html 41 | agent: 42 | class: PPO 43 | rollouts: 24 44 | learning_epochs: 5 45 | mini_batches: 4 46 | discount_factor: 0.99 47 | lambda: 0.95 48 | learning_rate: 1.0e-03 49 | learning_rate_scheduler: KLAdaptiveLR 50 | learning_rate_scheduler_kwargs: 51 | kl_threshold: 0.01 52 | state_preprocessor: RunningStandardScaler 53 | state_preprocessor_kwargs: null 54 | value_preprocessor: RunningStandardScaler 55 | value_preprocessor_kwargs: null 56 | random_timesteps: 0 57 | learning_starts: 0 58 | grad_norm_clip: 1.0 59 | ratio_clip: 0.2 60 | value_clip: 0.2 61 | clip_predicted_values: True 62 | entropy_loss_scale: 0.01 63 | value_loss_scale: 1.0 64 | kl_threshold: 0.0 65 | rewards_shaper_scale: 1.0 66 | time_limit_bootstrap: False 67 | # logging and checkpoint 68 | experiment: 69 | directory: "reach_ur10" 70 | experiment_name: "" 71 | write_interval: auto 72 | checkpoint_interval: auto 73 | 74 | 75 | # Sequential trainer 76 | # https://skrl.readthedocs.io/en/latest/api/trainers/sequential.html 77 | trainer: 78 | class: SequentialTrainer 79 | timesteps: 24000 80 | environment_info: log 81 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/ur_10/joint_pos_env_cfg.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | import math 7 | 8 | from isaaclab.utils import configclass 9 | 10 | import isaacLab.manipulation.tasks.Robot_arm.reach.mdp as mdp 11 | import isaaclab_tasks.manager_based.manipulation.reach.mdp as general_mdp 12 | from isaacLab.manipulation.tasks.Robot_arm.reach.reach_env_cfg import ReachEnvCfg 13 | 14 | ## 15 | # Pre-defined configs 16 | ## 17 | from isaacLab.manipulation.assets.config.universal_robots import UR10_CFG # isort: skip 18 | 19 | 20 | ## 21 | # Environment configuration 22 | ## 23 | 24 | 25 | @configclass 26 | class UR10ReachEnvCfg(ReachEnvCfg): 27 | def __post_init__(self): 28 | # post init of parent 29 | super().__post_init__() 30 | 31 | # switch robot to ur10 32 | self.scene.robot = UR10_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") 33 | # override events 34 | self.events.reset_robot_joints.params["position_range"] = (0.75, 1.25) 35 | # override rewards 36 | self.rewards.end_effector_position_tracking.params["asset_cfg"].body_names = ["ee_link"] 37 | self.rewards.end_effector_position_tracking_fine_grained.params["asset_cfg"].body_names = ["ee_link"] 38 | self.rewards.end_effector_orientation_tracking.params["asset_cfg"].body_names = ["ee_link"] 39 | # override actions 40 | self.actions.arm_action = general_mdp.JointPositionActionCfg( 41 | asset_name="robot", joint_names=[".*"], scale=0.5, use_default_offset=True 42 | ) 43 | # override command generator body 44 | # end-effector is along x-direction 45 | self.commands.ee_pose.body_name = "ee_link" 46 | self.commands.ee_pose.ranges.pitch = (math.pi / 2, math.pi / 2) 47 | 48 | 49 | @configclass 50 | class UR10ReachEnvCfg_PLAY(UR10ReachEnvCfg): 51 | def __post_init__(self): 52 | # post init of parent 53 | super().__post_init__() 54 | # make a smaller scene for play 55 | self.scene.num_envs = 50 56 | self.scene.env_spacing = 2.5 57 | # disable randomization for play 58 | self.observations.policy.enable_corruption = False 59 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/mdp/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Sub-module with implementation of manager terms. 7 | 8 | The functions can be provided to different managers that are responsible for the 9 | different aspects of the MDP. These include the observation, reward, termination, 10 | actions, events and curriculum managers. 11 | 12 | The terms are defined under the ``envs`` module because they are used to define 13 | the environment. However, they are not part of the environment directly, but 14 | are used to define the environment through their managers. 15 | 16 | """ 17 | 18 | from .actions import * # noqa: F401, F403 19 | from .commands import * # noqa: F401, F403 20 | from .curriculums import * # noqa: F401, F403 21 | from .events import * # noqa: F401, F403 22 | from .observations import * # noqa: F401, F403 23 | from .rewards import * # noqa: F401, F403 24 | from .terminations import * # noqa: F401, F403 25 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/mdp/actions/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Various action terms that can be used in the environment.""" 7 | 8 | from .actions_cfg import * 9 | from .your_actions import * 10 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/mdp/actions/actions_cfg.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from dataclasses import MISSING 7 | 8 | from isaaclab.managers.action_manager import ActionTerm, ActionTermCfg 9 | from isaaclab.utils import configclass 10 | 11 | from . import your_actions 12 | 13 | 14 | @configclass 15 | class YourActionCfg(ActionTermCfg): 16 | pass -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/mdp/actions/your_actions.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from __future__ import annotations 7 | 8 | import torch 9 | from collections.abc import Sequence 10 | from typing import TYPE_CHECKING 11 | 12 | 13 | import isaaclab.utils.string as string_utils 14 | from isaaclab.assets.articulation import Articulation 15 | from isaaclab.managers.action_manager import ActionTerm 16 | 17 | if TYPE_CHECKING: 18 | from isaaclab.envs import ManagerBasedEnv 19 | 20 | from . import actions_cfg 21 | 22 | 23 | class YourAction(ActionTerm): 24 | pass -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/mdp/commands/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Various command terms that can be used in the environment.""" 7 | 8 | from .commands_cfg import YourCommandCfg 9 | from .your_command import YourCommand 10 | 11 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/mdp/commands/commands_cfg.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from dataclasses import MISSING 7 | 8 | import isaaclab.sim as sim_utils 9 | from isaaclab.managers import CommandTermCfg 10 | #from isaaclab.markers import VisualizationMarkersCfg 11 | from isaaclab.utils import configclass 12 | from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR 13 | 14 | from .your_command import YourCommand 15 | 16 | 17 | @configclass 18 | class YourCommandCfg(CommandTermCfg): 19 | pass 20 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/mdp/commands/your_command.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Sub-module containing command generators for 3D orientation goals for objects.""" 7 | 8 | from __future__ import annotations 9 | 10 | import torch 11 | from collections.abc import Sequence 12 | from typing import TYPE_CHECKING 13 | 14 | import isaaclab.utils.math as math_utils 15 | from isaaclab.assets import RigidObject 16 | from isaaclab.managers import CommandTerm 17 | from isaaclab.markers.visualization_markers import VisualizationMarkers 18 | 19 | if TYPE_CHECKING: 20 | from isaaclab.envs import ManagerBasedRLEnv 21 | 22 | from .commands_cfg import YourCommandCfg 23 | 24 | 25 | class YourCommand(CommandTerm): 26 | pass 27 | 28 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/mdp/curriculums.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Common functions that can be used to create curriculum for the learning environment. 7 | 8 | The functions can be passed to the :class:`isaaclab.managers.CurriculumTermCfg` object to enable 9 | the curriculum introduced by the function. 10 | """ 11 | 12 | from __future__ import annotations 13 | 14 | import torch 15 | from collections.abc import Sequence 16 | from typing import TYPE_CHECKING 17 | 18 | from isaaclab.assets import Articulation 19 | from isaaclab.managers import SceneEntityCfg 20 | from isaaclab.terrains import TerrainImporter 21 | 22 | if TYPE_CHECKING: 23 | from isaaclab.envs import ManagerBasedRLEnv 24 | 25 | 26 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/mdp/events.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Functions specific to the in-hand dexterous manipulation environments.""" 7 | 8 | 9 | from __future__ import annotations 10 | 11 | import torch 12 | from typing import TYPE_CHECKING, Literal 13 | 14 | from isaaclab.assets import Articulation 15 | from isaaclab.managers import EventTermCfg, ManagerTermBase, SceneEntityCfg 16 | from isaaclab.utils.math import sample_uniform 17 | 18 | if TYPE_CHECKING: 19 | from isaaclab.envs import ManagerBasedEnv 20 | 21 | 22 | #class reset_joint(ManagerTermBase): 23 | 24 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/mdp/observations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Functions specific to the in-hand dexterous manipulation environments.""" 7 | 8 | import torch 9 | from typing import TYPE_CHECKING 10 | 11 | import isaaclab.utils.math as math_utils 12 | from isaaclab.assets import RigidObject 13 | from isaaclab.envs import ManagerBasedRLEnv 14 | from isaaclab.managers import SceneEntityCfg 15 | 16 | if TYPE_CHECKING: 17 | from .commands import YourCommand 18 | 19 | #def 20 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/mdp/rewards.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from __future__ import annotations 7 | 8 | import torch 9 | from typing import TYPE_CHECKING 10 | 11 | from isaaclab.assets import RigidObject 12 | from isaaclab.managers import SceneEntityCfg 13 | from isaaclab.utils.math import combine_frame_transforms, quat_error_magnitude, quat_mul 14 | 15 | if TYPE_CHECKING: 16 | from isaaclab.envs import ManagerBasedRLEnv 17 | 18 | 19 | def position_command_error(env: ManagerBasedRLEnv, command_name: str, asset_cfg: SceneEntityCfg) -> torch.Tensor: 20 | """Penalize tracking of the position error using L2-norm. 21 | 22 | The function computes the position error between the desired position (from the command) and the 23 | current position of the asset's body (in world frame). The position error is computed as the L2-norm 24 | of the difference between the desired and current positions. 25 | """ 26 | # extract the asset (to enable type hinting) 27 | asset: RigidObject = env.scene[asset_cfg.name] 28 | command = env.command_manager.get_command(command_name) 29 | # obtain the desired and current positions 30 | des_pos_b = command[:, :3] 31 | des_pos_w, _ = combine_frame_transforms(asset.data.root_state_w[:, :3], asset.data.root_state_w[:, 3:7], des_pos_b) 32 | curr_pos_w = asset.data.body_state_w[:, asset_cfg.body_ids[0], :3] # type: ignore 33 | return torch.norm(curr_pos_w - des_pos_w, dim=1) 34 | 35 | 36 | def position_command_error_tanh( 37 | env: ManagerBasedRLEnv, std: float, command_name: str, asset_cfg: SceneEntityCfg 38 | ) -> torch.Tensor: 39 | """Reward tracking of the position using the tanh kernel. 40 | 41 | The function computes the position error between the desired position (from the command) and the 42 | current position of the asset's body (in world frame) and maps it with a tanh kernel. 43 | """ 44 | # extract the asset (to enable type hinting) 45 | asset: RigidObject = env.scene[asset_cfg.name] 46 | command = env.command_manager.get_command(command_name) 47 | # obtain the desired and current positions 48 | des_pos_b = command[:, :3] 49 | des_pos_w, _ = combine_frame_transforms(asset.data.root_state_w[:, :3], asset.data.root_state_w[:, 3:7], des_pos_b) 50 | curr_pos_w = asset.data.body_state_w[:, asset_cfg.body_ids[0], :3] # type: ignore 51 | distance = torch.norm(curr_pos_w - des_pos_w, dim=1) 52 | return 1 - torch.tanh(distance / std) 53 | 54 | 55 | def orientation_command_error(env: ManagerBasedRLEnv, command_name: str, asset_cfg: SceneEntityCfg) -> torch.Tensor: 56 | """Penalize tracking orientation error using shortest path. 57 | 58 | The function computes the orientation error between the desired orientation (from the command) and the 59 | current orientation of the asset's body (in world frame). The orientation error is computed as the shortest 60 | path between the desired and current orientations. 61 | """ 62 | # extract the asset (to enable type hinting) 63 | asset: RigidObject = env.scene[asset_cfg.name] 64 | command = env.command_manager.get_command(command_name) 65 | # obtain the desired and current orientations 66 | des_quat_b = command[:, 3:7] 67 | des_quat_w = quat_mul(asset.data.root_state_w[:, 3:7], des_quat_b) 68 | curr_quat_w = asset.data.body_state_w[:, asset_cfg.body_ids[0], 3:7] # type: ignore 69 | return quat_error_magnitude(curr_quat_w, des_quat_w) -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/mdp/terminations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Functions specific to the in-hand dexterous manipulation environments.""" 7 | 8 | import torch 9 | from typing import TYPE_CHECKING 10 | 11 | from isaaclab.envs import ManagerBasedRLEnv 12 | from isaaclab.managers import SceneEntityCfg 13 | 14 | if TYPE_CHECKING: 15 | from .commands import YourCommand 16 | 17 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/__init__.py: -------------------------------------------------------------------------------- 1 | """Package containing task implementations for various robotic environments.""" 2 | 3 | import os 4 | import toml 5 | 6 | # 直接导入所有子包来注册环境 7 | from .Robot_arm import * 8 | from .Dextrous_hand import * 9 | 10 | # Conveniences to other module directories via relative paths 11 | LAB_TASKS_EXT_DIR = os.path.abspath( 12 | os.path.join(os.path.dirname(__file__), "../../../") 13 | ) 14 | """Path to the extension source directory.""" 15 | 16 | LAB_TASKS_METADATA = toml.load( 17 | os.path.join(LAB_TASKS_EXT_DIR, "config", "extension.toml") 18 | ) 19 | """Extension metadata dictionary parsed from the extension.toml file.""" 20 | 21 | # Configure the module-level variables 22 | __version__ = LAB_TASKS_METADATA["package"]["version"] 23 | 24 | ## 25 | # Register Gym environments. 26 | ## 27 | -------------------------------------------------------------------------------- /scripts/environments/list_envs.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """ 7 | Script to print all the available environments in Isaac Lab. 8 | 9 | The script iterates over all registered environments and stores the details in a table. 10 | It prints the name of the environment, the entry point and the config file. 11 | 12 | All the environments are registered in the `isaaclab_tasks` extension. They start 13 | with `Isaac` in their name. 14 | """ 15 | 16 | """Launch Isaac Sim Simulator first.""" 17 | 18 | from isaaclab.app import AppLauncher 19 | 20 | # launch omniverse app 21 | app_launcher = AppLauncher(headless=True) 22 | simulation_app = app_launcher.app 23 | 24 | 25 | """Rest everything follows.""" 26 | 27 | import gymnasium as gym 28 | from prettytable import PrettyTable 29 | 30 | import isaaclab_tasks # noqa: F401 31 | 32 | 33 | def main(): 34 | """Print all environments registered in `isaaclab_tasks` extension.""" 35 | # print all the available environments 36 | table = PrettyTable(["S. No.", "Task Name", "Entry Point", "Config"]) 37 | table.title = "Available Environments in Isaac Lab" 38 | # set alignment of table columns 39 | table.align["Task Name"] = "l" 40 | table.align["Entry Point"] = "l" 41 | table.align["Config"] = "l" 42 | 43 | # count of environments 44 | index = 0 45 | # acquire all Isaac environments names 46 | for task_spec in gym.registry.values(): 47 | if "Isaac" in task_spec.id: 48 | # add details to table 49 | table.add_row([index + 1, task_spec.id, task_spec.entry_point, task_spec.kwargs["env_cfg_entry_point"]]) 50 | # increment count 51 | index += 1 52 | 53 | print(table) 54 | 55 | 56 | if __name__ == "__main__": 57 | try: 58 | # run the main function 59 | main() 60 | except Exception as e: 61 | raise e 62 | finally: 63 | # close the app 64 | simulation_app.close() 65 | -------------------------------------------------------------------------------- /scripts/environments/random_agent.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Script to an environment with random action agent.""" 7 | 8 | """Launch Isaac Sim Simulator first.""" 9 | 10 | import argparse 11 | 12 | from isaaclab.app import AppLauncher 13 | 14 | # add argparse arguments 15 | parser = argparse.ArgumentParser(description="Random agent for Isaac Lab environments.") 16 | parser.add_argument( 17 | "--disable_fabric", action="store_true", default=False, help="Disable fabric and use USD I/O operations." 18 | ) 19 | parser.add_argument("--num_envs", type=int, default=None, help="Number of environments to simulate.") 20 | parser.add_argument("--task", type=str, default=None, help="Name of the task.") 21 | # append AppLauncher cli args 22 | AppLauncher.add_app_launcher_args(parser) 23 | # parse the arguments 24 | args_cli = parser.parse_args() 25 | 26 | # launch omniverse app 27 | app_launcher = AppLauncher(args_cli) 28 | simulation_app = app_launcher.app 29 | 30 | """Rest everything follows.""" 31 | 32 | import gymnasium as gym 33 | import torch 34 | 35 | import isaaclab_tasks # noqa: F401 36 | from isaaclab_tasks.utils import parse_env_cfg 37 | 38 | 39 | def main(): 40 | """Random actions agent with Isaac Lab environment.""" 41 | # create environment configuration 42 | env_cfg = parse_env_cfg( 43 | args_cli.task, device=args_cli.device, num_envs=args_cli.num_envs, use_fabric=not args_cli.disable_fabric 44 | ) 45 | # create environment 46 | env = gym.make(args_cli.task, cfg=env_cfg) 47 | 48 | # print info (this is vectorized environment) 49 | print(f"[INFO]: Gym observation space: {env.observation_space}") 50 | print(f"[INFO]: Gym action space: {env.action_space}") 51 | # reset environment 52 | env.reset() 53 | # simulate environment 54 | while simulation_app.is_running(): 55 | # run everything in inference mode 56 | with torch.inference_mode(): 57 | # sample actions from -1 to 1 58 | actions = 2 * torch.rand(env.action_space.shape, device=env.unwrapped.device) - 1 59 | # apply actions 60 | env.step(actions) 61 | 62 | # close the simulator 63 | env.close() 64 | 65 | 66 | if __name__ == "__main__": 67 | # run the main function 68 | main() 69 | # close sim app 70 | simulation_app.close() 71 | -------------------------------------------------------------------------------- /scripts/environments/zero_agent.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Script to run an environment with zero action agent.""" 7 | 8 | """Launch Isaac Sim Simulator first.""" 9 | 10 | import argparse 11 | 12 | from isaaclab.app import AppLauncher 13 | 14 | # add argparse arguments 15 | parser = argparse.ArgumentParser(description="Zero agent for Isaac Lab environments.") 16 | parser.add_argument( 17 | "--disable_fabric", action="store_true", default=False, help="Disable fabric and use USD I/O operations." 18 | ) 19 | parser.add_argument("--num_envs", type=int, default=None, help="Number of environments to simulate.") 20 | parser.add_argument("--task", type=str, default=None, help="Name of the task.") 21 | # append AppLauncher cli args 22 | AppLauncher.add_app_launcher_args(parser) 23 | # parse the arguments 24 | args_cli = parser.parse_args() 25 | 26 | # launch omniverse app 27 | app_launcher = AppLauncher(args_cli) 28 | simulation_app = app_launcher.app 29 | 30 | """Rest everything follows.""" 31 | 32 | import gymnasium as gym 33 | import torch 34 | 35 | import isaaclab_tasks # noqa: F401 36 | from isaaclab_tasks.utils import parse_env_cfg 37 | 38 | 39 | def main(): 40 | """Zero actions agent with Isaac Lab environment.""" 41 | # parse configuration 42 | env_cfg = parse_env_cfg( 43 | args_cli.task, device=args_cli.device, num_envs=args_cli.num_envs, use_fabric=not args_cli.disable_fabric 44 | ) 45 | # create environment 46 | env = gym.make(args_cli.task, cfg=env_cfg) 47 | 48 | # print info (this is vectorized environment) 49 | print(f"[INFO]: Gym observation space: {env.observation_space}") 50 | print(f"[INFO]: Gym action space: {env.action_space}") 51 | # reset environment 52 | env.reset() 53 | # simulate environment 54 | while simulation_app.is_running(): 55 | # run everything in inference mode 56 | with torch.inference_mode(): 57 | # compute zero actions 58 | actions = torch.zeros(env.action_space.shape, device=env.unwrapped.device) 59 | # apply actions 60 | env.step(actions) 61 | 62 | # close the simulator 63 | env.close() 64 | 65 | 66 | if __name__ == "__main__": 67 | # run the main function 68 | main() 69 | # close sim app 70 | simulation_app.close() 71 | -------------------------------------------------------------------------------- /scripts/list_envs.py: -------------------------------------------------------------------------------- 1 | """ 2 | Script to print all the available environments in the extension. 3 | 4 | The script iterates over all registered environments and stores the details in a table. 5 | It prints the name of the environment, the entry point and the config file. 6 | """ 7 | 8 | """Launch Isaac Sim Simulator first.""" 9 | 10 | from isaaclab.app import AppLauncher 11 | 12 | # launch omniverse app 13 | app_launcher = AppLauncher(headless=True) 14 | simulation_app = app_launcher.app 15 | 16 | 17 | """Rest everything follows.""" 18 | 19 | import gymnasium as gym 20 | from prettytable import PrettyTable 21 | 22 | # Import extensions to set up environment tasks 23 | import ext_template.tasks # noqa: F401 24 | 25 | 26 | def main(): 27 | """Print all environments registered in `isaac.lab_demo` extension.""" 28 | # print all the available environments 29 | table = PrettyTable(["S. No.", "Task Name", "Entry Point", "Config"]) 30 | table.title = "Available Environments in Isaac Lab Template Extension" 31 | # set alignment of table columns 32 | table.align["Task Name"] = "l" 33 | table.align["Entry Point"] = "l" 34 | table.align["Config"] = "l" 35 | 36 | # count of environments 37 | index = 0 38 | # acquire all Isaac environments names 39 | for task_spec in gym.registry.values(): 40 | if "Template-" in task_spec.id: 41 | # add details to table 42 | table.add_row([index + 1, task_spec.id, task_spec.entry_point, task_spec.kwargs["env_cfg_entry_point"]]) 43 | # increment count 44 | index += 1 45 | 46 | print(table) 47 | 48 | 49 | if __name__ == "__main__": 50 | try: 51 | # run the main function 52 | main() 53 | except Exception as e: 54 | raise e 55 | finally: 56 | # close the app 57 | simulation_app.close() 58 | -------------------------------------------------------------------------------- /scripts/rename_template.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | from pathlib import Path 4 | 5 | """This script can be used to rename the template project to a new project name. 6 | It renames all the occurrences of ext_template (in files, directories, etc.) to the new project name. 7 | """ 8 | 9 | 10 | def rename_file_contents(root_dir_path: str, old_name: str, new_name: str, exclude_dirs: list = []): 11 | """Rename all instances of the old keyword to the new keyword in all files in the root directory. 12 | 13 | Args: 14 | root_dir_path (str): The root directory path. 15 | old_name (str): The old keyword to replace. 16 | new_name (str): The new keyword to replace with. 17 | """ 18 | for dirpath, _, files in os.walk(root_dir_path): 19 | if any(exclude_dir in dirpath for exclude_dir in exclude_dirs): 20 | continue 21 | for file_name in files: 22 | if file_name == "rename_template.py": 23 | continue 24 | try: 25 | with open(os.path.join(dirpath, file_name)) as file: 26 | file_contents = file.read() 27 | file_contents = file_contents.replace(old_name, new_name) 28 | with open(os.path.join(dirpath, file_name), "w") as file: 29 | file.write(file_contents) 30 | except Exception as e: 31 | print(f"Ignoring {file_name}: {e}") 32 | continue 33 | 34 | 35 | if __name__ == "__main__": 36 | if len(sys.argv) != 2: 37 | print("Usage: python rename_template.py ") 38 | sys.exit(1) 39 | 40 | root_dir_path = str(Path(__file__).resolve().parent.parent) 41 | old_name = "ext_template" 42 | new_name = sys.argv[1] 43 | 44 | print(f"Warning, this script will rename all instances of '{old_name}' to '{new_name}' in {root_dir_path}.") 45 | proceed = input("Proceed? (y/n): ") 46 | 47 | if proceed.lower() == "y": 48 | # rename the ext_template folder 49 | os.rename( 50 | os.path.join(root_dir_path, "source", "ext_template", "ext_template"), 51 | os.path.join(root_dir_path, "source", "ext_template", new_name), 52 | ) 53 | os.rename( 54 | os.path.join(root_dir_path, "source", "ext_template"), os.path.join(root_dir_path, "source", new_name) 55 | ) 56 | # rename the file contents 57 | rename_file_contents(root_dir_path, old_name, new_name, exclude_dirs=[".git", "logs"]) 58 | else: 59 | print("Aborting.") 60 | -------------------------------------------------------------------------------- /scripts/robomimic/play.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Script to play and evaluate a trained policy from robomimic.""" 7 | 8 | """Launch Isaac Sim Simulator first.""" 9 | 10 | import argparse 11 | 12 | from isaaclab.app import AppLauncher 13 | 14 | # add argparse arguments 15 | parser = argparse.ArgumentParser(description="Evaluate robomimic policy for Isaac Lab environment.") 16 | parser.add_argument( 17 | "--disable_fabric", action="store_true", default=False, help="Disable fabric and use USD I/O operations." 18 | ) 19 | parser.add_argument("--task", type=str, default=None, help="Name of the task.") 20 | parser.add_argument("--checkpoint", type=str, default=None, help="Pytorch model checkpoint to load.") 21 | parser.add_argument("--horizon", type=int, default=800, help="Step horizon of each rollout.") 22 | parser.add_argument("--num_rollouts", type=int, default=1, help="Number of rollouts.") 23 | parser.add_argument("--seed", type=int, default=101, help="Random seed.") 24 | 25 | # append AppLauncher cli args 26 | AppLauncher.add_app_launcher_args(parser) 27 | # parse the arguments 28 | args_cli = parser.parse_args() 29 | 30 | # launch omniverse app 31 | app_launcher = AppLauncher(args_cli) 32 | simulation_app = app_launcher.app 33 | 34 | """Rest everything follows.""" 35 | 36 | import gymnasium as gym 37 | import torch 38 | 39 | import robomimic.utils.file_utils as FileUtils 40 | import robomimic.utils.torch_utils as TorchUtils 41 | 42 | from isaaclab_tasks.utils import parse_env_cfg 43 | 44 | 45 | def rollout(policy, env, horizon, device): 46 | policy.start_episode 47 | obs_dict, _ = env.reset() 48 | traj = dict(actions=[], obs=[], next_obs=[]) 49 | 50 | for i in range(horizon): 51 | # Prepare observations 52 | obs = obs_dict["policy"] 53 | for ob in obs: 54 | obs[ob] = torch.squeeze(obs[ob]) 55 | traj["obs"].append(obs) 56 | 57 | # Compute actions 58 | actions = policy(obs) 59 | actions = torch.from_numpy(actions).to(device=device).view(1, env.action_space.shape[1]) 60 | 61 | # Apply actions 62 | obs_dict, _, terminated, truncated, _ = env.step(actions) 63 | obs = obs_dict["policy"] 64 | 65 | # Record trajectory 66 | traj["actions"].append(actions.tolist()) 67 | traj["next_obs"].append(obs) 68 | 69 | if terminated: 70 | return True, traj 71 | elif truncated: 72 | return False, traj 73 | 74 | return False, traj 75 | 76 | 77 | def main(): 78 | """Run a trained policy from robomimic with Isaac Lab environment.""" 79 | # parse configuration 80 | env_cfg = parse_env_cfg(args_cli.task, device=args_cli.device, num_envs=1, use_fabric=not args_cli.disable_fabric) 81 | 82 | # Set observations to dictionary mode for Robomimic 83 | env_cfg.observations.policy.concatenate_terms = False 84 | 85 | # Set termination conditions 86 | env_cfg.terminations.time_out = None 87 | 88 | # Disable recorder 89 | env_cfg.recorders = None 90 | 91 | # Create environment 92 | env = gym.make(args_cli.task, cfg=env_cfg).unwrapped 93 | 94 | # Set seed 95 | torch.manual_seed(args_cli.seed) 96 | env.seed(args_cli.seed) 97 | 98 | # Acquire device 99 | device = TorchUtils.get_torch_device(try_to_use_cuda=True) 100 | 101 | # Load policy 102 | policy, _ = FileUtils.policy_from_checkpoint(ckpt_path=args_cli.checkpoint, device=device, verbose=True) 103 | 104 | # Run policy 105 | results = [] 106 | for trial in range(args_cli.num_rollouts): 107 | print(f"[INFO] Starting trial {trial}") 108 | terminated, traj = rollout(policy, env, args_cli.horizon, device) 109 | results.append(terminated) 110 | print(f"[INFO] Trial {trial}: {terminated}\n") 111 | 112 | print(f"\nSuccessful trials: {results.count(True)}, out of {len(results)} trials") 113 | print(f"Success rate: {results.count(True) / len(results)}") 114 | print(f"Trial Results: {results}\n") 115 | 116 | env.close() 117 | 118 | 119 | if __name__ == "__main__": 120 | # run the main function 121 | main() 122 | # close sim app 123 | simulation_app.close() 124 | -------------------------------------------------------------------------------- /scripts/rsl_rl/cli_args.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import argparse 4 | from typing import TYPE_CHECKING 5 | 6 | if TYPE_CHECKING: 7 | from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg 8 | 9 | 10 | def add_rsl_rl_args(parser: argparse.ArgumentParser): 11 | """Add RSL-RL arguments to the parser. 12 | 13 | Args: 14 | parser: The parser to add the arguments to. 15 | """ 16 | # create a new argument group 17 | arg_group = parser.add_argument_group("rsl_rl", description="Arguments for RSL-RL agent.") 18 | # -- experiment arguments 19 | arg_group.add_argument( 20 | "--experiment_name", type=str, default=None, help="Name of the experiment folder where logs will be stored." 21 | ) 22 | arg_group.add_argument("--run_name", type=str, default=None, help="Run name suffix to the log directory.") 23 | # -- load arguments 24 | arg_group.add_argument("--resume", type=bool, default=None, help="Whether to resume from a checkpoint.") 25 | arg_group.add_argument("--load_run", type=str, default=None, help="Name of the run folder to resume from.") 26 | arg_group.add_argument("--checkpoint", type=str, default=None, help="Checkpoint file to resume from.") 27 | # -- logger arguments 28 | arg_group.add_argument( 29 | "--logger", type=str, default=None, choices={"wandb", "tensorboard", "neptune"}, help="Logger module to use." 30 | ) 31 | arg_group.add_argument( 32 | "--log_project_name", type=str, default=None, help="Name of the logging project when using wandb or neptune." 33 | ) 34 | 35 | 36 | def parse_rsl_rl_cfg(task_name: str, args_cli: argparse.Namespace) -> RslRlOnPolicyRunnerCfg: 37 | """Parse configuration for RSL-RL agent based on inputs. 38 | 39 | Args: 40 | task_name: The name of the environment. 41 | args_cli: The command line arguments. 42 | 43 | Returns: 44 | The parsed configuration for RSL-RL agent based on inputs. 45 | """ 46 | from isaaclab_tasks.utils.parse_cfg import load_cfg_from_registry 47 | 48 | # load the default configuration 49 | rslrl_cfg: RslRlOnPolicyRunnerCfg = load_cfg_from_registry(task_name, "rsl_rl_cfg_entry_point") 50 | rslrl_cfg = update_rsl_rl_cfg(rslrl_cfg, args_cli) 51 | return rslrl_cfg 52 | 53 | 54 | def update_rsl_rl_cfg(agent_cfg: RslRlOnPolicyRunnerCfg, args_cli: argparse.Namespace): 55 | """Update configuration for RSL-RL agent based on inputs. 56 | 57 | Args: 58 | agent_cfg: The configuration for RSL-RL agent. 59 | args_cli: The command line arguments. 60 | 61 | Returns: 62 | The updated configuration for RSL-RL agent based on inputs. 63 | """ 64 | # override the default configuration with CLI arguments 65 | if hasattr(args_cli, "seed") and args_cli.seed is not None: 66 | agent_cfg.seed = args_cli.seed 67 | if args_cli.resume is not None: 68 | agent_cfg.resume = args_cli.resume 69 | if args_cli.load_run is not None: 70 | agent_cfg.load_run = args_cli.load_run 71 | if args_cli.checkpoint is not None: 72 | agent_cfg.load_checkpoint = args_cli.checkpoint 73 | if args_cli.run_name is not None: 74 | agent_cfg.run_name = args_cli.run_name 75 | if args_cli.logger is not None: 76 | agent_cfg.logger = args_cli.logger 77 | # set the project name for wandb and neptune 78 | if agent_cfg.logger in {"wandb", "neptune"} and args_cli.log_project_name: 79 | agent_cfg.wandb_project = args_cli.log_project_name 80 | agent_cfg.neptune_project = args_cli.log_project_name 81 | 82 | return agent_cfg 83 | -------------------------------------------------------------------------------- /scripts/rsl_rl/play.py: -------------------------------------------------------------------------------- 1 | """Script to play a checkpoint if an RL agent from RSL-RL.""" 2 | 3 | """Launch Isaac Sim Simulator first.""" 4 | 5 | import argparse 6 | 7 | from isaaclab.app import AppLauncher 8 | 9 | # local imports 10 | import cli_args # isort: skip 11 | 12 | # add argparse arguments 13 | parser = argparse.ArgumentParser(description="Train an RL agent with RSL-RL.") 14 | parser.add_argument("--video", action="store_true", default=False, help="Record videos during training.") 15 | parser.add_argument("--video_length", type=int, default=200, help="Length of the recorded video (in steps).") 16 | parser.add_argument( 17 | "--disable_fabric", action="store_true", default=False, help="Disable fabric and use USD I/O operations." 18 | ) 19 | parser.add_argument("--num_envs", type=int, default=None, help="Number of environments to simulate.") 20 | parser.add_argument("--task", type=str, default=None, help="Name of the task.") 21 | # append RSL-RL cli arguments 22 | cli_args.add_rsl_rl_args(parser) 23 | # append AppLauncher cli args 24 | AppLauncher.add_app_launcher_args(parser) 25 | args_cli = parser.parse_args() 26 | # always enable cameras to record video 27 | if args_cli.video: 28 | args_cli.enable_cameras = True 29 | 30 | # launch omniverse app 31 | app_launcher = AppLauncher(args_cli) 32 | simulation_app = app_launcher.app 33 | 34 | """Rest everything follows.""" 35 | 36 | import gymnasium as gym 37 | import os 38 | import torch 39 | 40 | from rsl_rl.runners import OnPolicyRunner 41 | 42 | from isaaclab.envs import DirectMARLEnv, multi_agent_to_single_agent 43 | from isaaclab.utils.dict import print_dict 44 | from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlVecEnvWrapper, export_policy_as_jit, export_policy_as_onnx 45 | from isaaclab_tasks.utils import get_checkpoint_path, parse_env_cfg 46 | 47 | # Import extensions to set up environment tasks 48 | import isaacLab.manipulation.tasks # noqa: F401 49 | 50 | 51 | def main(): 52 | """Play with RSL-RL agent.""" 53 | # parse configuration 54 | env_cfg = parse_env_cfg( 55 | args_cli.task, device=args_cli.device, num_envs=args_cli.num_envs, use_fabric=not args_cli.disable_fabric 56 | ) 57 | agent_cfg: RslRlOnPolicyRunnerCfg = cli_args.parse_rsl_rl_cfg(args_cli.task, args_cli) 58 | 59 | # specify directory for logging experiments 60 | log_root_path = os.path.join("logs", "rsl_rl", agent_cfg.experiment_name) 61 | log_root_path = os.path.abspath(log_root_path) 62 | print(f"[INFO] Loading experiment from directory: {log_root_path}") 63 | resume_path = get_checkpoint_path(log_root_path, agent_cfg.load_run, agent_cfg.load_checkpoint) 64 | log_dir = os.path.dirname(resume_path) 65 | 66 | # create isaac environment 67 | env = gym.make(args_cli.task, cfg=env_cfg, render_mode="rgb_array" if args_cli.video else None) 68 | # wrap for video recording 69 | if args_cli.video: 70 | video_kwargs = { 71 | "video_folder": os.path.join(log_dir, "videos", "play"), 72 | "step_trigger": lambda step: step == 0, 73 | "video_length": args_cli.video_length, 74 | "disable_logger": True, 75 | } 76 | print("[INFO] Recording videos during training.") 77 | print_dict(video_kwargs, nesting=4) 78 | env = gym.wrappers.RecordVideo(env, **video_kwargs) 79 | 80 | # convert to single-agent instance if required by the RL algorithm 81 | if isinstance(env.unwrapped, DirectMARLEnv): 82 | env = multi_agent_to_single_agent(env) 83 | 84 | # wrap around environment for rsl-rl 85 | env = RslRlVecEnvWrapper(env) 86 | 87 | print(f"[INFO]: Loading model checkpoint from: {resume_path}") 88 | # load previously trained model 89 | ppo_runner = OnPolicyRunner(env, agent_cfg.to_dict(), log_dir=None, device=agent_cfg.device) 90 | ppo_runner.load(resume_path) 91 | 92 | # obtain the trained policy for inference 93 | policy = ppo_runner.get_inference_policy(device=env.unwrapped.device) 94 | 95 | try: 96 | # version 2.3 onwards 97 | policy_nn = ppo_runner.alg.policy 98 | except AttributeError: 99 | # version 2.2 and below 100 | policy_nn = ppo_runner.alg.actor_critic 101 | 102 | # export policy to onnx/jit 103 | export_model_dir = os.path.join(os.path.dirname(resume_path), "exported") 104 | # export_policy_as_onnx( 105 | # actor_critic=policy_nn, 106 | # normalizer=ppo_runner.obs_normalizer, 107 | # path=export_model_dir, 108 | # filename="policy.onnx", 109 | # ) 110 | # export_policy_as_jit( 111 | # actor_critic=policy_nn, 112 | # normalizer=ppo_runner.obs_normalizer, 113 | # path=export_model_dir, 114 | # filename="policy.pt", 115 | # ) 116 | 117 | # reset environment 118 | obs, _ = env.get_observations() 119 | timestep = 0 120 | # simulate environment 121 | while simulation_app.is_running(): 122 | # run everything in inference mode 123 | with torch.inference_mode(): 124 | # agent stepping 125 | actions = policy(obs) 126 | # env stepping 127 | obs, _, _, _ = env.step(actions) 128 | if args_cli.video: 129 | timestep += 1 130 | # Exit the play loop after recording one video 131 | if timestep == args_cli.video_length: 132 | break 133 | 134 | # close the simulator 135 | env.close() 136 | 137 | 138 | if __name__ == "__main__": 139 | # run the main function 140 | main() 141 | # close sim app 142 | simulation_app.close() 143 | -------------------------------------------------------------------------------- /scripts/tools/blender_obj.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """ 7 | Convert a mesh file to `.obj` using blender. 8 | 9 | This file processes a given dae mesh file and saves the resulting mesh file in obj format. 10 | 11 | It needs to be called using the python packaged with blender, i.e.: 12 | 13 | blender --background --python blender_obj.py -- -in_file FILE -out_file FILE 14 | 15 | For more information: https://docs.blender.org/api/current/index.html 16 | 17 | The script was tested on Blender 3.2 on Ubuntu 20.04LTS. 18 | """ 19 | 20 | import bpy 21 | import os 22 | import sys 23 | 24 | 25 | def parse_cli_args(): 26 | """Parse the input command line arguments.""" 27 | import argparse 28 | 29 | # get the args passed to blender after "--", all of which are ignored by 30 | # blender so scripts may receive their own arguments 31 | argv = sys.argv 32 | 33 | if "--" not in argv: 34 | argv = [] # as if no args are passed 35 | else: 36 | argv = argv[argv.index("--") + 1 :] # get all args after "--" 37 | 38 | # When --help or no args are given, print this help 39 | usage_text = ( 40 | f"Run blender in background mode with this script:\n\tblender --background --python {__file__} -- [options]" 41 | ) 42 | parser = argparse.ArgumentParser(description=usage_text) 43 | # Add arguments 44 | parser.add_argument("-i", "--in_file", metavar="FILE", type=str, required=True, help="Path to input OBJ file.") 45 | parser.add_argument("-o", "--out_file", metavar="FILE", type=str, required=True, help="Path to output OBJ file.") 46 | args = parser.parse_args(argv) 47 | # Check if any arguments provided 48 | if not argv or not args.in_file or not args.out_file: 49 | parser.print_help() 50 | return None 51 | # return arguments 52 | return args 53 | 54 | 55 | def convert_to_obj(in_file: str, out_file: str, save_usd: bool = False): 56 | """Convert a mesh file to `.obj` using blender. 57 | 58 | Args: 59 | in_file: Input mesh file to process. 60 | out_file: Path to store output obj file. 61 | """ 62 | # check valid input file 63 | if not os.path.exists(in_file): 64 | raise FileNotFoundError(in_file) 65 | # add ending of file format 66 | if not out_file.endswith(".obj"): 67 | out_file += ".obj" 68 | # create directory if it doesn't exist for destination file 69 | if not os.path.exists(os.path.dirname(out_file)): 70 | os.makedirs(os.path.dirname(out_file), exist_ok=True) 71 | # reset scene to empty 72 | bpy.ops.wm.read_factory_settings(use_empty=True) 73 | # load object into scene 74 | if in_file.endswith(".dae"): 75 | bpy.ops.wm.collada_import(filepath=in_file) 76 | elif in_file.endswith(".stl") or in_file.endswith(".STL"): 77 | bpy.ops.import_mesh.stl(filepath=in_file) 78 | else: 79 | raise ValueError(f"Input file not in dae/stl format: {in_file}") 80 | # convert to obj format and store with z up 81 | # TODO: Read the convention from dae file instead of manually fixing it. 82 | # Reference: https://docs.blender.org/api/2.79/bpy.ops.export_scene.html 83 | bpy.ops.export_scene.obj( 84 | filepath=out_file, check_existing=False, axis_forward="Y", axis_up="Z", global_scale=1, path_mode="RELATIVE" 85 | ) 86 | # save it as usd as well 87 | if save_usd: 88 | out_file = out_file.replace("obj", "usd") 89 | bpy.ops.wm.usd_export(filepath=out_file, check_existing=False) 90 | 91 | 92 | if __name__ == "__main__": 93 | # read arguments 94 | cli_args = parse_cli_args() 95 | # check CLI args 96 | if cli_args is None: 97 | sys.exit() 98 | # process via blender 99 | convert_to_obj(cli_args.in_file, cli_args.out_file) 100 | -------------------------------------------------------------------------------- /scripts/tools/check_instanceable.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """ 7 | This script uses the cloner API to check if asset has been instanced properly. 8 | 9 | Usage with different inputs (replace `` and `` with the path to the 10 | original asset and the instanced asset respectively): 11 | 12 | ```bash 13 | ./isaaclab.sh -p source/tools/check_instanceable.py -n 4096 --headless --physics 14 | ./isaaclab.sh -p source/tools/check_instanceable.py -n 4096 --headless --physics 15 | ./isaaclab.sh -p source/tools/check_instanceable.py -n 4096 --headless 16 | ./isaaclab.sh -p source/tools/check_instanceable.py -n 4096 --headless 17 | ``` 18 | 19 | Output from the above commands: 20 | 21 | ```bash 22 | >>> Cloning time (cloner.clone): 0.648198 seconds 23 | >>> Setup time (sim.reset): : 5.843589 seconds 24 | [#clones: 4096, physics: True] Asset: : 6.491870 seconds 25 | 26 | >>> Cloning time (cloner.clone): 0.693133 seconds 27 | >>> Setup time (sim.reset): 50.860526 seconds 28 | [#clones: 4096, physics: True] Asset: : 51.553743 seconds 29 | 30 | >>> Cloning time (cloner.clone) : 0.687201 seconds 31 | >>> Setup time (sim.reset) : 6.302215 seconds 32 | [#clones: 4096, physics: False] Asset: : 6.989500 seconds 33 | 34 | >>> Cloning time (cloner.clone) : 0.678150 seconds 35 | >>> Setup time (sim.reset) : 52.854054 seconds 36 | [#clones: 4096, physics: False] Asset: : 53.532287 seconds 37 | ``` 38 | 39 | """ 40 | 41 | """Launch Isaac Sim Simulator first.""" 42 | 43 | import argparse 44 | import contextlib 45 | import os 46 | 47 | from isaaclab.app import AppLauncher 48 | 49 | # add argparse arguments 50 | parser = argparse.ArgumentParser("Utility to empirically check if asset in instanced properly.") 51 | parser.add_argument("input", type=str, help="The path to the USD file.") 52 | parser.add_argument("-n", "--num_clones", type=int, default=128, help="Number of clones to spawn.") 53 | parser.add_argument("-s", "--spacing", type=float, default=1.5, help="Spacing between instances in a grid.") 54 | parser.add_argument("-p", "--physics", action="store_true", default=False, help="Clone assets using physics cloner.") 55 | # append AppLauncher cli args 56 | AppLauncher.add_app_launcher_args(parser) 57 | # parse the arguments 58 | args_cli = parser.parse_args() 59 | 60 | # launch omniverse app 61 | app_launcher = AppLauncher(args_cli) 62 | simulation_app = app_launcher.app 63 | 64 | """Rest everything follows.""" 65 | 66 | 67 | import isaacsim.core.utils.prims as prim_utils 68 | from isaacsim.core.api.simulation_context import SimulationContext 69 | from isaacsim.core.cloner import GridCloner 70 | from isaacsim.core.utils.carb import set_carb_setting 71 | 72 | from isaaclab.utils import Timer 73 | from isaaclab.utils.assets import check_file_path 74 | 75 | 76 | def main(): 77 | """Spawns the USD asset robot and clones it using Isaac Gym Cloner API.""" 78 | # check valid file path 79 | if not check_file_path(args_cli.input): 80 | raise ValueError(f"Invalid file path: {args_cli.input}") 81 | # Load kit helper 82 | sim = SimulationContext( 83 | stage_units_in_meters=1.0, physics_dt=0.01, rendering_dt=0.01, backend="torch", device="cuda:0" 84 | ) 85 | # enable fabric which avoids passing data over to USD structure 86 | # this speeds up the read-write operation of GPU buffers 87 | if sim.get_physics_context().use_gpu_pipeline: 88 | sim.get_physics_context().enable_fabric(True) 89 | # increase GPU buffer dimensions 90 | sim.get_physics_context().set_gpu_found_lost_aggregate_pairs_capacity(2**25) 91 | sim.get_physics_context().set_gpu_total_aggregate_pairs_capacity(2**21) 92 | # enable hydra scene-graph instancing 93 | # this is needed to visualize the scene when fabric is enabled 94 | set_carb_setting(sim._settings, "/persistent/omnihydra/useSceneGraphInstancing", True) 95 | 96 | # Create interface to clone the scene 97 | cloner = GridCloner(spacing=args_cli.spacing) 98 | cloner.define_base_env("/World/envs") 99 | prim_utils.define_prim("/World/envs/env_0") 100 | # Spawn things into stage 101 | prim_utils.create_prim("/World/Light", "DistantLight") 102 | 103 | # Everything under the namespace "/World/envs/env_0" will be cloned 104 | prim_utils.create_prim("/World/envs/env_0/Asset", "Xform", usd_path=os.path.abspath(args_cli.input)) 105 | # Clone the scene 106 | num_clones = args_cli.num_clones 107 | 108 | # Create a timer to measure the cloning time 109 | with Timer(f"[#clones: {num_clones}, physics: {args_cli.physics}] Asset: {args_cli.input}"): 110 | # Clone the scene 111 | with Timer(">>> Cloning time (cloner.clone)"): 112 | cloner.define_base_env("/World/envs") 113 | envs_prim_paths = cloner.generate_paths("/World/envs/env", num_paths=num_clones) 114 | _ = cloner.clone( 115 | source_prim_path="/World/envs/env_0", prim_paths=envs_prim_paths, replicate_physics=args_cli.physics 116 | ) 117 | # Play the simulator 118 | with Timer(">>> Setup time (sim.reset)"): 119 | sim.reset() 120 | 121 | # Simulate scene (if not headless) 122 | if not args_cli.headless: 123 | with contextlib.suppress(KeyboardInterrupt): 124 | while sim.is_playing(): 125 | # perform step 126 | sim.step() 127 | 128 | 129 | if __name__ == "__main__": 130 | # run the main function 131 | main() 132 | # close sim app 133 | simulation_app.close() 134 | -------------------------------------------------------------------------------- /scripts/tools/convert_mjcf.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """ 7 | Utility to convert a MJCF into USD format. 8 | 9 | MuJoCo XML Format (MJCF) is an XML file format used in MuJoCo to describe all elements of a robot. 10 | For more information, see: http://www.mujoco.org/book/XMLreference.html 11 | 12 | This script uses the MJCF importer extension from Isaac Sim (``isaacsim.asset.importer.mjcf``) to convert 13 | a MJCF asset into USD format. It is designed as a convenience script for command-line use. For more information 14 | on the MJCF importer, see the documentation for the extension: 15 | https://docs.isaacsim.omniverse.nvidia.com/latest/robot_setup/ext_isaacsim_asset_importer_mjcf.html 16 | 17 | 18 | positional arguments: 19 | input The path to the input URDF file. 20 | output The path to store the USD file. 21 | 22 | optional arguments: 23 | -h, --help Show this help message and exit 24 | --fix-base Fix the base to where it is imported. (default: False) 25 | --import-sites Import sites by parse tag. (default: True) 26 | --make-instanceable Make the asset instanceable for efficient cloning. (default: False) 27 | 28 | """ 29 | 30 | """Launch Isaac Sim Simulator first.""" 31 | 32 | import argparse 33 | 34 | from isaaclab.app import AppLauncher 35 | 36 | # add argparse arguments 37 | parser = argparse.ArgumentParser(description="Utility to convert a MJCF into USD format.") 38 | parser.add_argument("input", type=str, help="The path to the input MJCF file.") 39 | parser.add_argument("output", type=str, help="The path to store the USD file.") 40 | parser.add_argument("--fix-base", action="store_true", default=False, help="Fix the base to where it is imported.") 41 | parser.add_argument( 42 | "--import-sites", action="store_true", default=False, help="Import sites by parsing the tag." 43 | ) 44 | parser.add_argument( 45 | "--make-instanceable", 46 | action="store_true", 47 | default=False, 48 | help="Make the asset instanceable for efficient cloning.", 49 | ) 50 | 51 | # append AppLauncher cli args 52 | AppLauncher.add_app_launcher_args(parser) 53 | # parse the arguments 54 | args_cli = parser.parse_args() 55 | 56 | # launch omniverse app 57 | app_launcher = AppLauncher(args_cli) 58 | simulation_app = app_launcher.app 59 | 60 | """Rest everything follows.""" 61 | 62 | import contextlib 63 | import os 64 | 65 | import carb 66 | import isaacsim.core.utils.stage as stage_utils 67 | import omni.kit.app 68 | 69 | from isaaclab.sim.converters import MjcfConverter, MjcfConverterCfg 70 | from isaaclab.utils.assets import check_file_path 71 | from isaaclab.utils.dict import print_dict 72 | 73 | 74 | def main(): 75 | # check valid file path 76 | mjcf_path = args_cli.input 77 | if not os.path.isabs(mjcf_path): 78 | mjcf_path = os.path.abspath(mjcf_path) 79 | if not check_file_path(mjcf_path): 80 | raise ValueError(f"Invalid file path: {mjcf_path}") 81 | # create destination path 82 | dest_path = args_cli.output 83 | if not os.path.isabs(dest_path): 84 | dest_path = os.path.abspath(dest_path) 85 | 86 | # create the converter configuration 87 | mjcf_converter_cfg = MjcfConverterCfg( 88 | asset_path=mjcf_path, 89 | usd_dir=os.path.dirname(dest_path), 90 | usd_file_name=os.path.basename(dest_path), 91 | fix_base=args_cli.fix_base, 92 | import_sites=args_cli.import_sites, 93 | force_usd_conversion=True, 94 | make_instanceable=args_cli.make_instanceable, 95 | ) 96 | 97 | # Print info 98 | print("-" * 80) 99 | print("-" * 80) 100 | print(f"Input MJCF file: {mjcf_path}") 101 | print("MJCF importer config:") 102 | print_dict(mjcf_converter_cfg.to_dict(), nesting=0) 103 | print("-" * 80) 104 | print("-" * 80) 105 | 106 | # Create mjcf converter and import the file 107 | mjcf_converter = MjcfConverter(mjcf_converter_cfg) 108 | # print output 109 | print("MJCF importer output:") 110 | print(f"Generated USD file: {mjcf_converter.usd_path}") 111 | print("-" * 80) 112 | print("-" * 80) 113 | 114 | # Determine if there is a GUI to update: 115 | # acquire settings interface 116 | carb_settings_iface = carb.settings.get_settings() 117 | # read flag for whether a local GUI is enabled 118 | local_gui = carb_settings_iface.get("/app/window/enabled") 119 | # read flag for whether livestreaming GUI is enabled 120 | livestream_gui = carb_settings_iface.get("/app/livestream/enabled") 121 | 122 | # Simulate scene (if not headless) 123 | if local_gui or livestream_gui: 124 | # Open the stage with USD 125 | stage_utils.open_stage(mjcf_converter.usd_path) 126 | # Reinitialize the simulation 127 | app = omni.kit.app.get_app_interface() 128 | # Run simulation 129 | with contextlib.suppress(KeyboardInterrupt): 130 | while app.is_running(): 131 | # perform step 132 | app.update() 133 | 134 | 135 | if __name__ == "__main__": 136 | # run the main function 137 | main() 138 | # close sim app 139 | simulation_app.close() 140 | -------------------------------------------------------------------------------- /scripts/tools/merge_hdf5_datasets.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | import argparse 7 | import h5py 8 | import os 9 | 10 | parser = argparse.ArgumentParser(description="Merge a set of HDF5 datasets.") 11 | parser.add_argument( 12 | "--input_files", 13 | type=str, 14 | nargs="+", 15 | default=[], 16 | help="A list of paths to HDF5 files to merge.", 17 | ) 18 | parser.add_argument("--output_file", type=str, default="merged_dataset.hdf5", help="File path to merged output.") 19 | 20 | args_cli = parser.parse_args() 21 | 22 | 23 | def merge_datasets(): 24 | for filepath in args_cli.input_files: 25 | if not os.path.exists(filepath): 26 | raise FileNotFoundError(f"The dataset file {filepath} does not exist.") 27 | 28 | with h5py.File(args_cli.output_file, "w") as output: 29 | episode_idx = 0 30 | copy_attributes = True 31 | 32 | for filepath in args_cli.input_files: 33 | 34 | with h5py.File(filepath, "r") as input: 35 | for episode, data in input["data"].items(): 36 | input.copy(f"data/{episode}", output, f"data/demo_{episode_idx}") 37 | episode_idx += 1 38 | 39 | if copy_attributes: 40 | output["data"].attrs["env_args"] = input["data"].attrs["env_args"] 41 | copy_attributes = False 42 | 43 | print(f"Merged dataset saved to {args_cli.output_file}") 44 | 45 | 46 | if __name__ == "__main__": 47 | merge_datasets() 48 | -------------------------------------------------------------------------------- /scripts/tools/process_meshes_to_obj.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Convert all mesh files to `.obj` in given folders.""" 7 | 8 | import argparse 9 | import os 10 | import shutil 11 | import subprocess 12 | 13 | # Constants 14 | # Path to blender 15 | BLENDER_EXE_PATH = shutil.which("blender") 16 | 17 | 18 | def parse_cli_args(): 19 | """Parse the input command line arguments.""" 20 | # add argparse arguments 21 | parser = argparse.ArgumentParser("Utility to convert all mesh files to `.obj` in given folders.") 22 | parser.add_argument("input_dir", type=str, help="The input directory from which to load meshes.") 23 | parser.add_argument( 24 | "-o", 25 | "--output_dir", 26 | type=str, 27 | default=None, 28 | help="The output directory to save converted meshes into. Default is same as input directory.", 29 | ) 30 | args_cli = parser.parse_args() 31 | # resolve output directory 32 | if args_cli.output_dir is None: 33 | args_cli.output_dir = args_cli.input_dir 34 | # return arguments 35 | return args_cli 36 | 37 | 38 | def run_blender_convert2obj(in_file: str, out_file: str): 39 | """Calls the python script using `subprocess` to perform processing of mesh file. 40 | 41 | Args: 42 | in_file: Input mesh file. 43 | out_file: Output obj file. 44 | """ 45 | # resolve for python file 46 | tools_dirname = os.path.dirname(os.path.abspath(__file__)) 47 | script_file = os.path.join(tools_dirname, "blender_obj.py") 48 | # complete command 49 | command_exe = f"{BLENDER_EXE_PATH} --background --python {script_file} -- -i {in_file} -o {out_file}" 50 | # break command into list 51 | command_exe_list = command_exe.split(" ") 52 | # run command 53 | subprocess.run(command_exe_list) 54 | 55 | 56 | def convert_meshes(source_folders: list[str], destination_folders: list[str]): 57 | """Processes all mesh files of supported format into OBJ file using blender. 58 | 59 | Args: 60 | source_folders: List of directories to search for meshes. 61 | destination_folders: List of directories to dump converted files. 62 | """ 63 | # create folder for corresponding destination 64 | for folder in destination_folders: 65 | os.makedirs(folder, exist_ok=True) 66 | # iterate over each folder 67 | for in_folder, out_folder in zip(source_folders, destination_folders): 68 | # extract all dae files in the directory 69 | mesh_filenames = [f for f in os.listdir(in_folder) if f.endswith("dae")] 70 | mesh_filenames += [f for f in os.listdir(in_folder) if f.endswith("stl")] 71 | mesh_filenames += [f for f in os.listdir(in_folder) if f.endswith("STL")] 72 | # print status 73 | print(f"Found {len(mesh_filenames)} files to process in directory: {in_folder}") 74 | # iterate over each OBJ file 75 | for mesh_file in mesh_filenames: 76 | # extract meshname 77 | mesh_name = os.path.splitext(mesh_file)[0] 78 | # complete path of input and output files 79 | in_file_path = os.path.join(in_folder, mesh_file) 80 | out_file_path = os.path.join(out_folder, mesh_name + ".obj") 81 | # perform blender processing 82 | print("Processing: ", in_file_path) 83 | run_blender_convert2obj(in_file_path, out_file_path) 84 | 85 | 86 | if __name__ == "__main__": 87 | # Parse command line arguments 88 | args = parse_cli_args() 89 | # Run conversion 90 | convert_meshes([args.input_dir], [args.output_dir]) 91 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | """Installation script for the 'isaacLab.manipulation' python package.""" 2 | 3 | import os 4 | import toml 5 | 6 | from setuptools import setup 7 | 8 | # Obtain the extension data from the extension.toml file 9 | EXTENSION_PATH = os.path.dirname(os.path.realpath(__file__)) 10 | # Read the extension.toml file 11 | EXTENSION_TOML_DATA = toml.load(os.path.join(EXTENSION_PATH, "config", "extension.toml")) 12 | 13 | # Minimum dependencies required prior to installation 14 | INSTALL_REQUIRES = [ 15 | # NOTE: Add dependencies 16 | "psutil", 17 | ] 18 | 19 | # Installation operation 20 | setup( 21 | # TODO: Change your package naming 22 | # ----------------------------------------------------------------- 23 | name="isaacLab.manipulation", 24 | packages=["isaacLab.manipulation"], 25 | # ----------------------------------------------------------------- 26 | author=EXTENSION_TOML_DATA["package"]["author"], 27 | maintainer=EXTENSION_TOML_DATA["package"]["maintainer"], 28 | maintainer_email=EXTENSION_TOML_DATA["package"]["maintainer_email"], 29 | url=EXTENSION_TOML_DATA["package"]["repository"], 30 | version=EXTENSION_TOML_DATA["package"]["version"], 31 | description=EXTENSION_TOML_DATA["package"]["description"], 32 | keywords=EXTENSION_TOML_DATA["package"]["keywords"], 33 | install_requires=INSTALL_REQUIRES, 34 | license="BSD-3-Clause", 35 | include_package_data=True, 36 | python_requires=">=3.10", 37 | classifiers=[ 38 | "Natural Language :: English", 39 | "Programming Language :: Python :: 3.10", 40 | "Isaac Sim :: 4.5.0", 41 | "Isaac Sim :: 4.5.0", 42 | ], 43 | zip_safe=False, 44 | ) 45 | -------------------------------------------------------------------------------- /test_env_registration.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | 测试环境注册的脚本 4 | """ 5 | 6 | import gymnasium as gym 7 | 8 | def test_env_registration(): 9 | """测试环境注册""" 10 | print("正在检查已注册的环境...") 11 | 12 | # 尝试导入我们的包 13 | try: 14 | import isaacLab.manipulation 15 | print("✓ 成功导入 isaacLab.manipulation") 16 | except Exception as e: 17 | print(f"✗ 导入 isaacLab.manipulation 失败: {e}") 18 | return 19 | 20 | # 检查已注册的环境 21 | isaac_envs = [] 22 | for env_id in gym.registry.keys(): 23 | if "Isaac" in env_id: 24 | isaac_envs.append(env_id) 25 | 26 | if isaac_envs: 27 | print(f"✓ 找到 {len(isaac_envs)} 个 Isaac 环境:") 28 | for env_id in sorted(isaac_envs): 29 | print(f" - {env_id}") 30 | else: 31 | print("✗ 没有找到任何 Isaac 环境") 32 | 33 | # 检查特定的环境 34 | specific_envs = [ 35 | "Template-Isaac-Lift-Cube-Franka-v0", 36 | "Template-Isaac-Lift-Cube-Franka-IK-Abs-v0", 37 | "Template-Isaac-Reach-Franka-v0" 38 | ] 39 | 40 | print("\n检查特定环境:") 41 | for env_id in specific_envs: 42 | if env_id in gym.registry: 43 | print(f"✓ {env_id} 已注册") 44 | else: 45 | print(f"✗ {env_id} 未注册") 46 | 47 | if __name__ == "__main__": 48 | test_env_registration() -------------------------------------------------------------------------------- /test_ros2_install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | 测试ROS2依赖是否正确安装 4 | """ 5 | 6 | 7 | def test_ros2_imports(): 8 | """测试ROS2相关包的导入""" 9 | try: 10 | print("正在测试ROS2依赖...") 11 | 12 | # 测试核心ROS2包 13 | import rclpy 14 | print("✓ rclpy 导入成功") 15 | 16 | from rclpy.node import Node 17 | print("✓ rclpy.node 导入成功") 18 | 19 | # 测试消息包 20 | from geometry_msgs.msg import PoseStamped 21 | print("✓ geometry_msgs.msg 导入成功") 22 | 23 | from std_msgs.msg import Bool 24 | print("✓ std_msgs.msg 导入成功") 25 | 26 | # 测试ROS2初始化 27 | rclpy.init() 28 | print("✓ ROS2 初始化成功") 29 | 30 | # 创建测试节点 31 | node = Node('test_node') 32 | print("✓ 节点创建成功") 33 | 34 | # 测试消息创建 35 | _pose_msg = PoseStamped() 36 | _bool_msg = Bool() 37 | print("✓ 消息对象创建成功") 38 | 39 | # 清理 40 | node.destroy_node() 41 | rclpy.shutdown() 42 | print("✓ ROS2 清理成功") 43 | 44 | print("\n🎉 所有ROS2依赖测试通过!") 45 | return True 46 | 47 | except ImportError as e: 48 | print(f"❌ 导入错误: {e}") 49 | return False 50 | except Exception as e: 51 | print(f"❌ 其他错误: {e}") 52 | return False 53 | 54 | 55 | if __name__ == "__main__": 56 | test_ros2_imports() --------------------------------------------------------------------------------