├── .gitignore ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── config └── extension.toml ├── isaacLab └── manipulation │ ├── __init__.py │ ├── assets │ ├── __init__.py │ ├── config │ │ └── kinova_gripper.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_cfg.py │ │ │ └── skrl_ppo_cfg.yaml │ │ │ └── allegro_env_cfg.py │ │ ├── inhand_env_cfg.py │ │ └── mdp │ │ ├── __init__.py │ │ ├── commands │ │ ├── __init__.py │ │ ├── commands_cfg.py │ │ └── orientation_command.py │ │ ├── events.py │ │ ├── observations.py │ │ ├── rewards.py │ │ └── terminations.py │ ├── Robot_arm │ ├── __init__.py │ └── reach │ │ ├── __init__.py │ │ ├── config │ │ ├── __init__.py │ │ ├── franka │ │ │ ├── __init__.py │ │ │ ├── agents │ │ │ │ ├── __init__.py │ │ │ │ ├── rl_games_ppo_cfg.yaml │ │ │ │ ├── rsl_rl_cfg.py │ │ │ │ └── skrl_ppo_cfg.yaml │ │ │ ├── ik_abs_env_cfg.py │ │ │ ├── ik_rel_env_cfg.py │ │ │ └── joint_pos_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 │ │ │ ├── rl_games_ppo_cfg.yaml │ │ │ ├── rsl_rl_ppo_cfg.py │ │ │ └── skrl_ppo_cfg.yaml │ │ │ └── joint_pos_env_cfg.py │ │ ├── mdp │ │ ├── __init__.py │ │ ├── actions.py │ │ ├── actions_cfg.py │ │ ├── observations.py │ │ ├── rewards.py │ │ └── terminations.py │ │ └── reach_env_cfg.py │ └── __init__.py ├── scripts ├── rsl_rl │ ├── cli_args.py │ ├── play.py │ └── train.py └── tools │ └── convert_urdf.py └── setup.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/ -------------------------------------------------------------------------------- /.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.0.0-silver.svg)](https://docs.omniverse.nvidia.com/isaacsim/latest/overview.html) 4 | [![IsaacLab](https://img.shields.io/badge/IsaacLab-0.3.1-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-Franka-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/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/urdf/kinova_robotiq/.thumbs/256x256/kinova_chair.usd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NathanWu7/isaacLab.manipulation/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/isaacLab/manipulation/assets/urdf/kinova_robotiq/.thumbs/256x256/kinova_chair.usd.png -------------------------------------------------------------------------------- /isaacLab/manipulation/assets/urdf/kinova_robotiq/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0.2) 2 | project(kinova_wheel_urdf) 3 | 4 | ## Compile as C++11, supported in ROS Kinetic and newer 5 | # add_compile_options(-std=c++11) 6 | 7 | ## Find catkin macros and libraries 8 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 9 | ## is used, also find other catkin packages 10 | find_package(catkin REQUIRED) 11 | 12 | ## System dependencies are found with CMake's conventions 13 | # find_package(Boost REQUIRED COMPONENTS system) 14 | 15 | 16 | ## Uncomment this if the package has a setup.py. This macro ensures 17 | ## modules and global scripts declared therein get installed 18 | ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html 19 | # catkin_python_setup() 20 | 21 | ################################################ 22 | ## Declare ROS messages, services and actions ## 23 | ################################################ 24 | 25 | ## To declare and build messages, services or actions from within this 26 | ## package, follow these steps: 27 | ## * Let MSG_DEP_SET be the set of packages whose message types you use in 28 | ## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...). 29 | ## * In the file package.xml: 30 | ## * add a build_depend tag for "message_generation" 31 | ## * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET 32 | ## * If MSG_DEP_SET isn't empty the following dependency has been pulled in 33 | ## but can be declared for certainty nonetheless: 34 | ## * add a exec_depend tag for "message_runtime" 35 | ## * In this file (CMakeLists.txt): 36 | ## * add "message_generation" and every package in MSG_DEP_SET to 37 | ## find_package(catkin REQUIRED COMPONENTS ...) 38 | ## * add "message_runtime" and every package in MSG_DEP_SET to 39 | ## catkin_package(CATKIN_DEPENDS ...) 40 | ## * uncomment the add_*_files sections below as needed 41 | ## and list every .msg/.srv/.action file to be processed 42 | ## * uncomment the generate_messages entry below 43 | ## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...) 44 | 45 | ## Generate messages in the 'msg' folder 46 | # add_message_files( 47 | # FILES 48 | # Message1.msg 49 | # Message2.msg 50 | # ) 51 | 52 | ## Generate services in the 'srv' folder 53 | # add_service_files( 54 | # FILES 55 | # Service1.srv 56 | # Service2.srv 57 | # ) 58 | 59 | ## Generate actions in the 'action' folder 60 | # add_action_files( 61 | # FILES 62 | # Action1.action 63 | # Action2.action 64 | # ) 65 | 66 | ## Generate added messages and services with any dependencies listed here 67 | # generate_messages( 68 | # DEPENDENCIES 69 | # std_msgs # Or other packages containing msgs 70 | # ) 71 | 72 | ################################################ 73 | ## Declare ROS dynamic reconfigure parameters ## 74 | ################################################ 75 | 76 | ## To declare and build dynamic reconfigure parameters within this 77 | ## package, follow these steps: 78 | ## * In the file package.xml: 79 | ## * add a build_depend and a exec_depend tag for "dynamic_reconfigure" 80 | ## * In this file (CMakeLists.txt): 81 | ## * add "dynamic_reconfigure" to 82 | ## find_package(catkin REQUIRED COMPONENTS ...) 83 | ## * uncomment the "generate_dynamic_reconfigure_options" section below 84 | ## and list every .cfg file to be processed 85 | 86 | ## Generate dynamic reconfigure parameters in the 'cfg' folder 87 | # generate_dynamic_reconfigure_options( 88 | # cfg/DynReconf1.cfg 89 | # cfg/DynReconf2.cfg 90 | # ) 91 | 92 | ################################### 93 | ## catkin specific configuration ## 94 | ################################### 95 | ## The catkin_package macro generates cmake config files for your package 96 | ## Declare things to be passed to dependent projects 97 | ## INCLUDE_DIRS: uncomment this if your package contains header files 98 | ## LIBRARIES: libraries you create in this project that dependent projects also need 99 | ## CATKIN_DEPENDS: catkin_packages dependent projects also need 100 | ## DEPENDS: system dependencies of this project that dependent projects also need 101 | catkin_package( 102 | # INCLUDE_DIRS include 103 | # LIBRARIES kinova_wheel_urdf 104 | # CATKIN_DEPENDS other_catkin_pkg 105 | # DEPENDS system_lib 106 | ) 107 | 108 | ########### 109 | ## Build ## 110 | ########### 111 | 112 | ## Specify additional locations of header files 113 | ## Your package locations should be listed before other locations 114 | include_directories( 115 | # include 116 | # ${catkin_INCLUDE_DIRS} 117 | ) 118 | 119 | ## Declare a C++ library 120 | # add_library(${PROJECT_NAME} 121 | # src/${PROJECT_NAME}/kinova_wheel_urdf.cpp 122 | # ) 123 | 124 | ## Add cmake target dependencies of the library 125 | ## as an example, code may need to be generated before libraries 126 | ## either from message generation or dynamic reconfigure 127 | # add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 128 | 129 | ## Declare a C++ executable 130 | ## With catkin_make all packages are built within a single CMake context 131 | ## The recommended prefix ensures that target names across packages don't collide 132 | # add_executable(${PROJECT_NAME}_node src/kinova_wheel_urdf_node.cpp) 133 | 134 | ## Rename C++ executable without prefix 135 | ## The above recommended prefix causes long target names, the following renames the 136 | ## target back to the shorter version for ease of user use 137 | ## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node" 138 | # set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "") 139 | 140 | ## Add cmake target dependencies of the executable 141 | ## same as for the library above 142 | # add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 143 | 144 | ## Specify libraries to link a library or executable target against 145 | # target_link_libraries(${PROJECT_NAME}_node 146 | # ${catkin_LIBRARIES} 147 | # ) 148 | 149 | ############# 150 | ## Install ## 151 | ############# 152 | 153 | # all install targets should use catkin DESTINATION variables 154 | # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html 155 | 156 | ## Mark executable scripts (Python etc.) for installation 157 | ## in contrast to setup.py, you can choose the destination 158 | # catkin_install_python(PROGRAMS 159 | # scripts/my_python_script 160 | # DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 161 | # ) 162 | 163 | ## Mark executables for installation 164 | ## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html 165 | # install(TARGETS ${PROJECT_NAME}_node 166 | # RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 167 | # ) 168 | 169 | ## Mark libraries for installation 170 | ## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html 171 | # install(TARGETS ${PROJECT_NAME} 172 | # ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 173 | # LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 174 | # RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} 175 | # ) 176 | 177 | ## Mark cpp header files for installation 178 | # install(DIRECTORY include/${PROJECT_NAME}/ 179 | # DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 180 | # FILES_MATCHING PATTERN "*.h" 181 | # PATTERN ".svn" EXCLUDE 182 | # ) 183 | 184 | ## Mark other files for installation (e.g. launch and bag files, etc.) 185 | # install(FILES 186 | # # myfile1 187 | # # myfile2 188 | # DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 189 | # ) 190 | 191 | ############# 192 | ## Testing ## 193 | ############# 194 | 195 | ## Add gtest based cpp test target and link libraries 196 | # catkin_add_gtest(${PROJECT_NAME}-test test/test_kinova_wheel_urdf.cpp) 197 | # if(TARGET ${PROJECT_NAME}-test) 198 | # target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) 199 | # endif() 200 | 201 | ## Add folders to be run by python nosetests 202 | # catkin_add_nosetests(test) 203 | -------------------------------------------------------------------------------- /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/CMakeCache.txt: -------------------------------------------------------------------------------- 1 | # This is the CMakeCache file. 2 | # For build in directory: /home/sony/git_pkg/kinova_wheel_urdf/build 3 | # It was generated by CMake: /usr/bin/cmake 4 | # You can edit this file to change values found and used by cmake. 5 | # If you do not want to change any of the values, simply exit the editor. 6 | # If you do want to change a value, simply edit, save, and exit the editor. 7 | # The syntax for the file is as follows: 8 | # KEY:TYPE=VALUE 9 | # KEY is the name of a variable in the cache. 10 | # TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. 11 | # VALUE is the current value for the KEY. 12 | 13 | ######################## 14 | # EXTERNAL cache entries 15 | ######################## 16 | 17 | //Path to a program. 18 | CMAKE_ADDR2LINE:FILEPATH=/usr/bin/addr2line 19 | 20 | //Path to a program. 21 | CMAKE_AR:FILEPATH=/usr/bin/ar 22 | 23 | //No help, variable specified on the command line. 24 | CMAKE_BUILD_TYPE:STRING=Debug 25 | 26 | //Enable/Disable color output during build. 27 | CMAKE_COLOR_MAKEFILE:BOOL=ON 28 | 29 | //CXX compiler 30 | CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++ 31 | 32 | //A wrapper around 'ar' adding the appropriate '--plugin' option 33 | // for the GCC compiler 34 | CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-9 35 | 36 | //A wrapper around 'ranlib' adding the appropriate '--plugin' option 37 | // for the GCC compiler 38 | CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-9 39 | 40 | //Flags used by the CXX compiler during all build types. 41 | CMAKE_CXX_FLAGS:STRING= 42 | 43 | //Flags used by the CXX compiler during DEBUG builds. 44 | CMAKE_CXX_FLAGS_DEBUG:STRING=-g 45 | 46 | //Flags used by the CXX compiler during MINSIZEREL builds. 47 | CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG 48 | 49 | //Flags used by the CXX compiler during RELEASE builds. 50 | CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG 51 | 52 | //Flags used by the CXX compiler during RELWITHDEBINFO builds. 53 | CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG 54 | 55 | //C compiler 56 | CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc 57 | 58 | //A wrapper around 'ar' adding the appropriate '--plugin' option 59 | // for the GCC compiler 60 | CMAKE_C_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-9 61 | 62 | //A wrapper around 'ranlib' adding the appropriate '--plugin' option 63 | // for the GCC compiler 64 | CMAKE_C_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-9 65 | 66 | //Flags used by the C compiler during all build types. 67 | CMAKE_C_FLAGS:STRING= 68 | 69 | //Flags used by the C compiler during DEBUG builds. 70 | CMAKE_C_FLAGS_DEBUG:STRING=-g 71 | 72 | //Flags used by the C compiler during MINSIZEREL builds. 73 | CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG 74 | 75 | //Flags used by the C compiler during RELEASE builds. 76 | CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG 77 | 78 | //Flags used by the C compiler during RELWITHDEBINFO builds. 79 | CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG 80 | 81 | //Path to a program. 82 | CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND 83 | 84 | //Flags used by the linker during all build types. 85 | CMAKE_EXE_LINKER_FLAGS:STRING= 86 | 87 | //Flags used by the linker during DEBUG builds. 88 | CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= 89 | 90 | //Flags used by the linker during MINSIZEREL builds. 91 | CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= 92 | 93 | //Flags used by the linker during RELEASE builds. 94 | CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= 95 | 96 | //Flags used by the linker during RELWITHDEBINFO builds. 97 | CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= 98 | 99 | //No help, variable specified on the command line. 100 | CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE 101 | 102 | //Install path prefix, prepended onto install directories. 103 | CMAKE_INSTALL_PREFIX:PATH=/usr/local 104 | 105 | //Path to a program. 106 | CMAKE_LINKER:FILEPATH=/usr/bin/ld 107 | 108 | //Path to a program. 109 | CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make 110 | 111 | //Flags used by the linker during the creation of modules during 112 | // all build types. 113 | CMAKE_MODULE_LINKER_FLAGS:STRING= 114 | 115 | //Flags used by the linker during the creation of modules during 116 | // DEBUG builds. 117 | CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= 118 | 119 | //Flags used by the linker during the creation of modules during 120 | // MINSIZEREL builds. 121 | CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= 122 | 123 | //Flags used by the linker during the creation of modules during 124 | // RELEASE builds. 125 | CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= 126 | 127 | //Flags used by the linker during the creation of modules during 128 | // RELWITHDEBINFO builds. 129 | CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= 130 | 131 | //Path to a program. 132 | CMAKE_NM:FILEPATH=/usr/bin/nm 133 | 134 | //Path to a program. 135 | CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy 136 | 137 | //Path to a program. 138 | CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump 139 | 140 | //Value Computed by CMake 141 | CMAKE_PROJECT_DESCRIPTION:STATIC= 142 | 143 | //Value Computed by CMake 144 | CMAKE_PROJECT_HOMEPAGE_URL:STATIC= 145 | 146 | //Value Computed by CMake 147 | CMAKE_PROJECT_NAME:STATIC=kinova_wheel_urdf 148 | 149 | //Path to a program. 150 | CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib 151 | 152 | //Path to a program. 153 | CMAKE_READELF:FILEPATH=/usr/bin/readelf 154 | 155 | //Flags used by the linker during the creation of shared libraries 156 | // during all build types. 157 | CMAKE_SHARED_LINKER_FLAGS:STRING= 158 | 159 | //Flags used by the linker during the creation of shared libraries 160 | // during DEBUG builds. 161 | CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= 162 | 163 | //Flags used by the linker during the creation of shared libraries 164 | // during MINSIZEREL builds. 165 | CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= 166 | 167 | //Flags used by the linker during the creation of shared libraries 168 | // during RELEASE builds. 169 | CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= 170 | 171 | //Flags used by the linker during the creation of shared libraries 172 | // during RELWITHDEBINFO builds. 173 | CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= 174 | 175 | //If set, runtime paths are not added when installing shared libraries, 176 | // but are added when building. 177 | CMAKE_SKIP_INSTALL_RPATH:BOOL=NO 178 | 179 | //If set, runtime paths are not added when using shared libraries. 180 | CMAKE_SKIP_RPATH:BOOL=NO 181 | 182 | //Flags used by the linker during the creation of static libraries 183 | // during all build types. 184 | CMAKE_STATIC_LINKER_FLAGS:STRING= 185 | 186 | //Flags used by the linker during the creation of static libraries 187 | // during DEBUG builds. 188 | CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= 189 | 190 | //Flags used by the linker during the creation of static libraries 191 | // during MINSIZEREL builds. 192 | CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= 193 | 194 | //Flags used by the linker during the creation of static libraries 195 | // during RELEASE builds. 196 | CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= 197 | 198 | //Flags used by the linker during the creation of static libraries 199 | // during RELWITHDEBINFO builds. 200 | CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= 201 | 202 | //Path to a program. 203 | CMAKE_STRIP:FILEPATH=/usr/bin/strip 204 | 205 | //If this value is on, makefiles will be generated without the 206 | // .SILENT directive, and all commands will be echoed to the console 207 | // during the make. This is useful for debugging only. With Visual 208 | // Studio IDE projects all commands are done without /nologo. 209 | CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE 210 | 211 | //The directory containing a CMake configuration file for catkin. 212 | catkin_DIR:PATH=catkin_DIR-NOTFOUND 213 | 214 | //Value Computed by CMake 215 | kinova_wheel_urdf_BINARY_DIR:STATIC=/home/sony/git_pkg/kinova_wheel_urdf/build 216 | 217 | //Value Computed by CMake 218 | kinova_wheel_urdf_SOURCE_DIR:STATIC=/home/sony/git_pkg/kinova_wheel_urdf 219 | 220 | 221 | ######################## 222 | # INTERNAL cache entries 223 | ######################## 224 | 225 | //ADVANCED property for variable: CMAKE_ADDR2LINE 226 | CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1 227 | //ADVANCED property for variable: CMAKE_AR 228 | CMAKE_AR-ADVANCED:INTERNAL=1 229 | //This is the directory where this CMakeCache.txt was created 230 | CMAKE_CACHEFILE_DIR:INTERNAL=/home/sony/git_pkg/kinova_wheel_urdf/build 231 | //Major version of cmake used to create the current loaded cache 232 | CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 233 | //Minor version of cmake used to create the current loaded cache 234 | CMAKE_CACHE_MINOR_VERSION:INTERNAL=16 235 | //Patch version of cmake used to create the current loaded cache 236 | CMAKE_CACHE_PATCH_VERSION:INTERNAL=3 237 | //ADVANCED property for variable: CMAKE_COLOR_MAKEFILE 238 | CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 239 | //Path to CMake executable. 240 | CMAKE_COMMAND:INTERNAL=/usr/bin/cmake 241 | //Path to cpack program executable. 242 | CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack 243 | //Path to ctest program executable. 244 | CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest 245 | //ADVANCED property for variable: CMAKE_CXX_COMPILER 246 | CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 247 | //ADVANCED property for variable: CMAKE_CXX_COMPILER_AR 248 | CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1 249 | //ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB 250 | CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1 251 | //ADVANCED property for variable: CMAKE_CXX_FLAGS 252 | CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 253 | //ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG 254 | CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 255 | //ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL 256 | CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 257 | //ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE 258 | CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 259 | //ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO 260 | CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 261 | //ADVANCED property for variable: CMAKE_C_COMPILER 262 | CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 263 | //ADVANCED property for variable: CMAKE_C_COMPILER_AR 264 | CMAKE_C_COMPILER_AR-ADVANCED:INTERNAL=1 265 | //ADVANCED property for variable: CMAKE_C_COMPILER_RANLIB 266 | CMAKE_C_COMPILER_RANLIB-ADVANCED:INTERNAL=1 267 | //ADVANCED property for variable: CMAKE_C_FLAGS 268 | CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 269 | //ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG 270 | CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 271 | //ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL 272 | CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 273 | //ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE 274 | CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 275 | //ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO 276 | CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 277 | //ADVANCED property for variable: CMAKE_DLLTOOL 278 | CMAKE_DLLTOOL-ADVANCED:INTERNAL=1 279 | //Executable file format 280 | CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF 281 | //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS 282 | CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 283 | //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG 284 | CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 285 | //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL 286 | CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 287 | //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE 288 | CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 289 | //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO 290 | CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 291 | //ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS 292 | CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 293 | //Name of external makefile project generator. 294 | CMAKE_EXTRA_GENERATOR:INTERNAL= 295 | //Name of generator. 296 | CMAKE_GENERATOR:INTERNAL=Unix Makefiles 297 | //Generator instance identifier. 298 | CMAKE_GENERATOR_INSTANCE:INTERNAL= 299 | //Name of generator platform. 300 | CMAKE_GENERATOR_PLATFORM:INTERNAL= 301 | //Name of generator toolset. 302 | CMAKE_GENERATOR_TOOLSET:INTERNAL= 303 | //Source directory with the top level CMakeLists.txt file for this 304 | // project 305 | CMAKE_HOME_DIRECTORY:INTERNAL=/home/sony/git_pkg/kinova_wheel_urdf 306 | //Install .so files without execute permission. 307 | CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1 308 | //ADVANCED property for variable: CMAKE_LINKER 309 | CMAKE_LINKER-ADVANCED:INTERNAL=1 310 | //ADVANCED property for variable: CMAKE_MAKE_PROGRAM 311 | CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 312 | //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS 313 | CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 314 | //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG 315 | CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 316 | //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL 317 | CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 318 | //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE 319 | CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 320 | //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO 321 | CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 322 | //ADVANCED property for variable: CMAKE_NM 323 | CMAKE_NM-ADVANCED:INTERNAL=1 324 | //number of local generators 325 | CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 326 | //ADVANCED property for variable: CMAKE_OBJCOPY 327 | CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 328 | //ADVANCED property for variable: CMAKE_OBJDUMP 329 | CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 330 | //Platform information initialized 331 | CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 332 | //ADVANCED property for variable: CMAKE_RANLIB 333 | CMAKE_RANLIB-ADVANCED:INTERNAL=1 334 | //ADVANCED property for variable: CMAKE_READELF 335 | CMAKE_READELF-ADVANCED:INTERNAL=1 336 | //Path to CMake installation. 337 | CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.16 338 | //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS 339 | CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 340 | //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG 341 | CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 342 | //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL 343 | CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 344 | //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE 345 | CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 346 | //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO 347 | CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 348 | //ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH 349 | CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 350 | //ADVANCED property for variable: CMAKE_SKIP_RPATH 351 | CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 352 | //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS 353 | CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 354 | //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG 355 | CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 356 | //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL 357 | CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 358 | //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE 359 | CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 360 | //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO 361 | CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 362 | //ADVANCED property for variable: CMAKE_STRIP 363 | CMAKE_STRIP-ADVANCED:INTERNAL=1 364 | //uname command 365 | CMAKE_UNAME:INTERNAL=/usr/bin/uname 366 | //ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE 367 | CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 368 | 369 | -------------------------------------------------------------------------------- /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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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/7fa2e4e75fd1f8ee19c8821eece5d9cd29665234/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-2024, 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 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/config/__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 | """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 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/config/allegro_hand/__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, allegro_env_cfg 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": allegro_env_cfg.AllegroCubeEnvCfg, 24 | "rsl_rl_cfg_entry_point": agents.rsl_rl_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": allegro_env_cfg.AllegroCubeEnvCfg_PLAY, 36 | "rsl_rl_cfg_entry_point": agents.rsl_rl_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": allegro_env_cfg.AllegroCubeNoVelObsEnvCfg, 52 | "rsl_rl_cfg_entry_point": agents.rsl_rl_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": allegro_env_cfg.AllegroCubeNoVelObsEnvCfg_PLAY, 64 | "rsl_rl_cfg_entry_point": agents.rsl_rl_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-2024, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from . import rsl_rl_cfg # noqa: F401, F403 7 | -------------------------------------------------------------------------------- /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_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 AllegroCubePPORunnerCfg(RslRlOnPolicyRunnerCfg): 17 | num_steps_per_env = 24 18 | max_iterations = 5000 19 | save_interval = 50 20 | experiment_name = "allegro_cube" 21 | empirical_normalization = True 22 | policy = RslRlPpoActorCriticCfg( 23 | init_noise_std=1.0, 24 | actor_hidden_dims=[512, 256, 128], 25 | critic_hidden_dims=[512, 256, 128], 26 | activation="elu", 27 | ) 28 | algorithm = RslRlPpoAlgorithmCfg( 29 | value_loss_coef=1.0, 30 | use_clipped_value_loss=True, 31 | clip_param=0.2, 32 | entropy_coef=0.002, 33 | num_learning_epochs=5, 34 | num_mini_batches=4, 35 | learning_rate=0.001, 36 | schedule="adaptive", 37 | gamma=0.998, 38 | lam=0.95, 39 | desired_kl=0.01, 40 | max_grad_norm=1.0, 41 | ) 42 | 43 | 44 | @configclass 45 | class AllegroCubeNoVelObsPPORunnerCfg(AllegroCubePPORunnerCfg): 46 | experiment_name = "allegro_cube_no_vel_obs" 47 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/config/allegro_hand/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: [512, 256, 128] 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: [512, 256, 128] 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: 5 34 | mini_batches: 4 35 | discount_factor: 0.998 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.002 52 | value_loss_scale: 2.0 53 | kl_threshold: 0 54 | rewards_shaper_scale: 0.1 55 | # logging and checkpoint 56 | experiment: 57 | directory: "allegro_cube" 58 | experiment_name: "" 59 | write_interval: 600 60 | checkpoint_interval: 6000 61 | 62 | 63 | # Sequential trainer 64 | # https://skrl.readthedocs.io/en/latest/api/trainers/sequential.html 65 | trainer: 66 | timesteps: 120000 67 | environment_info: "log" 68 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/config/allegro_hand/allegro_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 | from isaaclab.utils import configclass 7 | 8 | #import isaacLab.manipulation.tasks.Robot_arm.reach.mdp as mdp 9 | import isaacLab.manipulation.tasks.Dextrous_hand.inhand.mdp as mdp 10 | import isaacLab.manipulation.tasks.Dextrous_hand.inhand.inhand_env_cfg as inhand_env_cfg 11 | #import isaaclab_tasks.manager_based.manipulation.inhand.inhand_env_cfg as inhand_env_cfg 12 | 13 | ## 14 | # Pre-defined configs 15 | ## 16 | from isaaclab_assets import ALLEGRO_HAND_CFG # isort: skip 17 | 18 | 19 | @configclass 20 | class AllegroCubeEnvCfg(inhand_env_cfg.InHandObjectEnvCfg): 21 | def __post_init__(self): 22 | # post init of parent 23 | super().__post_init__() 24 | 25 | # switch robot to allegro hand 26 | self.scene.robot = ALLEGRO_HAND_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") 27 | 28 | 29 | @configclass 30 | class AllegroCubeEnvCfg_PLAY(AllegroCubeEnvCfg): 31 | def __post_init__(self): 32 | # post init of parent 33 | super().__post_init__() 34 | # make a smaller scene for play 35 | self.scene.num_envs = 50 36 | # disable randomization for play 37 | self.observations.policy.enable_corruption = False 38 | # remove termination due to timeouts 39 | self.terminations.time_out = None 40 | 41 | 42 | ## 43 | # Environment configuration with no velocity observations. 44 | ## 45 | 46 | 47 | @configclass 48 | class AllegroCubeNoVelObsEnvCfg(AllegroCubeEnvCfg): 49 | def __post_init__(self): 50 | # post init of parent 51 | super().__post_init__() 52 | 53 | # switch observation group to no velocity group 54 | self.observations.policy = inhand_env_cfg.ObservationsCfg.NoVelocityKinematicObsGroupCfg() 55 | 56 | 57 | @configclass 58 | class AllegroCubeNoVelObsEnvCfg_PLAY(AllegroCubeNoVelObsEnvCfg): 59 | def __post_init__(self): 60 | # post init of parent 61 | super().__post_init__() 62 | # make a smaller scene for play 63 | self.scene.num_envs = 50 64 | # disable randomization for play 65 | self.observations.policy.enable_corruption = False 66 | # remove termination due to timeouts 67 | self.terminations.time_out = None 68 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/inhand_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 | from __future__ import annotations 7 | 8 | from dataclasses import MISSING 9 | 10 | import isaaclab.sim as sim_utils 11 | from isaaclab.assets import ArticulationCfg, AssetBaseCfg, RigidObjectCfg 12 | from isaaclab.envs import ManagerBasedRLEnvCfg 13 | from isaaclab.managers import EventTermCfg as EventTerm 14 | from isaaclab.managers import ObservationGroupCfg as ObsGroup 15 | from isaaclab.managers import ObservationTermCfg as ObsTerm 16 | from isaaclab.managers import RewardTermCfg as RewTerm 17 | from isaaclab.managers import SceneEntityCfg 18 | from isaaclab.managers import TerminationTermCfg as DoneTerm 19 | from isaaclab.scene import InteractiveSceneCfg 20 | from isaaclab.sim.simulation_cfg import PhysxCfg, SimulationCfg 21 | from isaaclab.sim.spawners.materials.physics_materials_cfg import RigidBodyMaterialCfg 22 | from isaaclab.utils import configclass 23 | from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR 24 | from isaaclab.utils.noise import AdditiveGaussianNoiseCfg as Gnoise 25 | 26 | import isaacLab.manipulation.tasks.Dextrous_hand.inhand.mdp as mdp 27 | 28 | ## 29 | # Scene definition 30 | ## 31 | 32 | 33 | @configclass 34 | class InHandObjectSceneCfg(InteractiveSceneCfg): 35 | """Configuration for a scene with an object and a dexterous hand.""" 36 | 37 | # robots 38 | robot: ArticulationCfg = MISSING 39 | 40 | # objects 41 | object: RigidObjectCfg = RigidObjectCfg( 42 | prim_path="{ENV_REGEX_NS}/object", 43 | spawn=sim_utils.UsdFileCfg( 44 | usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/Blocks/DexCube/dex_cube_instanceable.usd", 45 | rigid_props=sim_utils.RigidBodyPropertiesCfg( 46 | kinematic_enabled=False, 47 | disable_gravity=False, 48 | enable_gyroscopic_forces=True, 49 | solver_position_iteration_count=8, 50 | solver_velocity_iteration_count=0, 51 | sleep_threshold=0.005, 52 | stabilization_threshold=0.0025, 53 | max_depenetration_velocity=1000.0, 54 | ), 55 | mass_props=sim_utils.MassPropertiesCfg(density=400.0), 56 | ), 57 | init_state=RigidObjectCfg.InitialStateCfg(pos=(0.0, -0.19, 0.56), rot=(1.0, 0.0, 0.0, 0.0)), 58 | ) 59 | 60 | # lights 61 | light = AssetBaseCfg( 62 | prim_path="/World/light", 63 | spawn=sim_utils.DistantLightCfg(color=(0.95, 0.95, 0.95), intensity=1000.0), 64 | ) 65 | 66 | dome_light = AssetBaseCfg( 67 | prim_path="/World/domeLight", 68 | spawn=sim_utils.DomeLightCfg(color=(0.02, 0.02, 0.02), intensity=1000.0), 69 | ) 70 | 71 | 72 | ## 73 | # MDP settings 74 | ## 75 | 76 | 77 | @configclass 78 | class CommandsCfg: 79 | """Command specifications for the MDP.""" 80 | 81 | object_pose = mdp.InHandReOrientationCommandCfg( 82 | asset_name="object", 83 | init_pos_offset=(0.0, 0.0, -0.04), 84 | update_goal_on_success=True, 85 | orientation_success_threshold=0.1, 86 | make_quat_unique=False, 87 | marker_pos_offset=(-0.2, -0.06, 0.08), 88 | debug_vis=True, 89 | ) 90 | 91 | 92 | @configclass 93 | class ActionsCfg: 94 | """Action specifications for the MDP.""" 95 | 96 | joint_pos = mdp.EMAJointPositionToLimitsActionCfg( 97 | asset_name="robot", 98 | joint_names=[".*"], 99 | alpha=0.95, 100 | rescale_to_limits=True, 101 | ) 102 | 103 | 104 | @configclass 105 | class ObservationsCfg: 106 | """Observation specifications for the MDP.""" 107 | 108 | @configclass 109 | class KinematicObsGroupCfg(ObsGroup): 110 | """Observations with full-kinematic state information. 111 | 112 | This does not include acceleration or force information. 113 | """ 114 | 115 | # observation terms (order preserved) 116 | # -- robot terms 117 | joint_pos = ObsTerm(func=mdp.joint_pos_limit_normalized, noise=Gnoise(std=0.005)) 118 | joint_vel = ObsTerm(func=mdp.joint_vel_rel, scale=0.2, noise=Gnoise(std=0.01)) 119 | 120 | # -- object terms 121 | object_pos = ObsTerm( 122 | func=mdp.root_pos_w, noise=Gnoise(std=0.002), params={"asset_cfg": SceneEntityCfg("object")} 123 | ) 124 | object_quat = ObsTerm( 125 | func=mdp.root_quat_w, params={"asset_cfg": SceneEntityCfg("object"), "make_quat_unique": False} 126 | ) 127 | object_lin_vel = ObsTerm( 128 | func=mdp.root_lin_vel_w, noise=Gnoise(std=0.002), params={"asset_cfg": SceneEntityCfg("object")} 129 | ) 130 | object_ang_vel = ObsTerm( 131 | func=mdp.root_ang_vel_w, 132 | scale=0.2, 133 | noise=Gnoise(std=0.002), 134 | params={"asset_cfg": SceneEntityCfg("object")}, 135 | ) 136 | 137 | # -- command terms 138 | goal_pose = ObsTerm(func=mdp.generated_commands, params={"command_name": "object_pose"}) 139 | goal_quat_diff = ObsTerm( 140 | func=mdp.goal_quat_diff, 141 | params={"asset_cfg": SceneEntityCfg("object"), "command_name": "object_pose", "make_quat_unique": False}, 142 | ) 143 | 144 | # -- action terms 145 | last_action = ObsTerm(func=mdp.last_action) 146 | 147 | def __post_init__(self): 148 | self.enable_corruption = True 149 | self.concatenate_terms = True 150 | 151 | @configclass 152 | class NoVelocityKinematicObsGroupCfg(KinematicObsGroupCfg): 153 | """Observations with partial kinematic state information. 154 | 155 | In contrast to the full-kinematic state group, this group does not include velocity information 156 | about the robot joints and the object root frame. This is useful for tasks where velocity information 157 | is not available or has a lot of noise. 158 | """ 159 | 160 | def __post_init__(self): 161 | # call parent post init 162 | super().__post_init__() 163 | # set unused terms to None 164 | self.joint_vel = None 165 | self.object_lin_vel = None 166 | self.object_ang_vel = None 167 | 168 | # observation groups 169 | policy: KinematicObsGroupCfg = KinematicObsGroupCfg() 170 | 171 | 172 | @configclass 173 | class EventCfg: 174 | """Configuration for randomization.""" 175 | 176 | # startup 177 | # -- robot 178 | robot_physics_material = EventTerm( 179 | func=mdp.randomize_rigid_body_material, 180 | mode="startup", 181 | params={ 182 | "asset_cfg": SceneEntityCfg("robot", body_names=".*"), 183 | "static_friction_range": (0.7, 1.3), 184 | "dynamic_friction_range": (0.7, 1.3), 185 | "restitution_range": (0.0, 0.0), 186 | "num_buckets": 250, 187 | }, 188 | ) 189 | robot_scale_mass = EventTerm( 190 | func=mdp.randomize_rigid_body_mass, 191 | mode="startup", 192 | params={ 193 | "asset_cfg": SceneEntityCfg("robot", body_names=".*"), 194 | "mass_distribution_params": (0.95, 1.05), 195 | "operation": "scale", 196 | }, 197 | ) 198 | robot_joint_stiffness_and_damping = EventTerm( 199 | func=mdp.randomize_actuator_gains, 200 | mode="startup", 201 | params={ 202 | "asset_cfg": SceneEntityCfg("robot", joint_names=".*"), 203 | "stiffness_distribution_params": (0.3, 3.0), # default: 3.0 204 | "damping_distribution_params": (0.75, 1.5), # default: 0.1 205 | "operation": "scale", 206 | "distribution": "log_uniform", 207 | }, 208 | ) 209 | 210 | # -- object 211 | object_physics_material = EventTerm( 212 | func=mdp.randomize_rigid_body_material, 213 | mode="startup", 214 | params={ 215 | "asset_cfg": SceneEntityCfg("object", body_names=".*"), 216 | "static_friction_range": (0.7, 1.3), 217 | "dynamic_friction_range": (0.7, 1.3), 218 | "restitution_range": (0.0, 0.0), 219 | "num_buckets": 250, 220 | }, 221 | ) 222 | object_scale_mass = EventTerm( 223 | func=mdp.randomize_rigid_body_mass, 224 | mode="startup", 225 | params={ 226 | "asset_cfg": SceneEntityCfg("object"), 227 | "mass_distribution_params": (0.4, 1.6), 228 | "operation": "scale", 229 | }, 230 | ) 231 | 232 | # reset 233 | reset_object = EventTerm( 234 | func=mdp.reset_root_state_uniform, 235 | mode="reset", 236 | params={ 237 | "pose_range": {"x": [-0.01, 0.01], "y": [-0.01, 0.01], "z": [-0.01, 0.01]}, 238 | "velocity_range": {}, 239 | "asset_cfg": SceneEntityCfg("object", body_names=".*"), 240 | }, 241 | ) 242 | reset_robot_joints = EventTerm( 243 | func=mdp.reset_joints_within_limits_range, 244 | mode="reset", 245 | params={ 246 | "position_range": {".*": [0.2, 0.2]}, 247 | "velocity_range": {".*": [0.0, 0.0]}, 248 | "use_default_offset": True, 249 | "operation": "scale", 250 | }, 251 | ) 252 | 253 | 254 | @configclass 255 | class RewardsCfg: 256 | """Reward terms for the MDP.""" 257 | 258 | # -- task 259 | # track_pos_l2 = RewTerm( 260 | # func=mdp.track_pos_l2, 261 | # weight=-10.0, 262 | # params={"object_cfg": SceneEntityCfg("object"), "command_name": "object_pose"}, 263 | # ) 264 | track_orientation_inv_l2 = RewTerm( 265 | func=mdp.track_orientation_inv_l2, 266 | weight=1.0, 267 | params={"object_cfg": SceneEntityCfg("object"), "rot_eps": 0.1, "command_name": "object_pose"}, 268 | ) 269 | success_bonus = RewTerm( 270 | func=mdp.success_bonus, 271 | weight=250.0, 272 | params={"object_cfg": SceneEntityCfg("object"), "command_name": "object_pose"}, 273 | ) 274 | 275 | # -- penalties 276 | joint_vel_l2 = RewTerm(func=mdp.joint_vel_l2, weight=-2.5e-5) 277 | action_l2 = RewTerm(func=mdp.action_l2, weight=-0.0001) 278 | action_rate_l2 = RewTerm(func=mdp.action_rate_l2, weight=-0.01) 279 | 280 | # -- optional penalties (these are disabled by default) 281 | # object_away_penalty = RewTerm( 282 | # func=mdp.is_terminated_term, 283 | # weight=-0.0, 284 | # params={"term_keys": "object_out_of_reach"}, 285 | # ) 286 | 287 | 288 | @configclass 289 | class TerminationsCfg: 290 | """Termination terms for the MDP.""" 291 | 292 | time_out = DoneTerm(func=mdp.time_out, time_out=True) 293 | 294 | max_consecutive_success = DoneTerm( 295 | func=mdp.max_consecutive_success, params={"num_success": 50, "command_name": "object_pose"} 296 | ) 297 | 298 | object_out_of_reach = DoneTerm(func=mdp.object_away_from_robot, params={"threshold": 0.3}) 299 | 300 | # object_out_of_reach = DoneTerm( 301 | # func=mdp.object_away_from_goal, params={"threshold": 0.24, "command_name": "object_pose"} 302 | # ) 303 | 304 | 305 | ## 306 | # Environment configuration 307 | ## 308 | 309 | 310 | @configclass 311 | class InHandObjectEnvCfg(ManagerBasedRLEnvCfg): 312 | """Configuration for the in hand reorientation environment.""" 313 | 314 | # Scene settings 315 | scene: InHandObjectSceneCfg = InHandObjectSceneCfg(num_envs=8192, env_spacing=0.6) 316 | # Simulation settings 317 | sim: SimulationCfg = SimulationCfg( 318 | physics_material=RigidBodyMaterialCfg( 319 | static_friction=1.0, 320 | dynamic_friction=1.0, 321 | ), 322 | physx=PhysxCfg( 323 | bounce_threshold_velocity=0.2, 324 | gpu_max_rigid_contact_count=2**20, 325 | gpu_max_rigid_patch_count=2**23, 326 | ), 327 | ) 328 | # Basic settings 329 | observations: ObservationsCfg = ObservationsCfg() 330 | actions: ActionsCfg = ActionsCfg() 331 | commands: CommandsCfg = CommandsCfg() 332 | # MDP settings 333 | rewards: RewardsCfg = RewardsCfg() 334 | terminations: TerminationsCfg = TerminationsCfg() 335 | events: EventCfg = EventCfg() 336 | 337 | def __post_init__(self): 338 | """Post initialization.""" 339 | # general settings 340 | self.decimation = 4 341 | self.episode_length_s = 20.0 342 | # simulation settings 343 | self.sim.dt = 1.0 / 120.0 344 | # change viewer settings 345 | self.viewer.eye = (2.0, 2.0, 2.0) 346 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/mdp/__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 | """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/commands/__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 | """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-2024, 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 | 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 | """Configuration for the visualization markers. Default is a cube marker.""" 68 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/mdp/commands/orientation_command.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 | """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 InHandReOrientationCommandCfg 23 | 24 | 25 | class InHandReOrientationCommand(CommandTerm): 26 | """Command term that generates 3D pose commands for in-hand manipulation task. 27 | 28 | This command term generates 3D orientation commands for the object. The orientation commands 29 | are sampled uniformly from the 3D orientation space. The position commands are the default 30 | root state of the object. 31 | 32 | The constant position commands is to encourage that the object does not move during the task. 33 | For instance, the object should not fall off the robot's palm. 34 | 35 | Unlike typical command terms, where the goals are resampled based on time, this command term 36 | does not resample the goals based on time. Instead, the goals are resampled when the object 37 | reaches the goal orientation. The goal orientation is considered to be reached when the 38 | orientation error is below a certain threshold. 39 | """ 40 | 41 | cfg: InHandReOrientationCommandCfg 42 | """Configuration for the command term.""" 43 | 44 | def __init__(self, cfg: InHandReOrientationCommandCfg, env: ManagerBasedRLEnv): 45 | """Initialize the command term class. 46 | 47 | Args: 48 | cfg: The configuration parameters for the command term. 49 | env: The environment object. 50 | """ 51 | # initialize the base class 52 | super().__init__(cfg, env) 53 | 54 | # object 55 | self.object: RigidObject = env.scene[cfg.asset_name] 56 | 57 | # create buffers to store the command 58 | # -- command: (x, y, z) 59 | init_pos_offset = torch.tensor(cfg.init_pos_offset, dtype=torch.float, device=self.device) 60 | self.pos_command_e = self.object.data.default_root_state[:, :3] + init_pos_offset 61 | self.pos_command_w = self.pos_command_e + self._env.scene.env_origins 62 | # -- orientation: (w, x, y, z) 63 | self.quat_command_w = torch.zeros(self.num_envs, 4, device=self.device) 64 | self.quat_command_w[:, 0] = 1.0 # set the scalar component to 1.0 65 | 66 | # -- unit vectors 67 | self._X_UNIT_VEC = torch.tensor([1.0, 0, 0], device=self.device).repeat((self.num_envs, 1)) 68 | self._Y_UNIT_VEC = torch.tensor([0, 1.0, 0], device=self.device).repeat((self.num_envs, 1)) 69 | self._Z_UNIT_VEC = torch.tensor([0, 0, 1.0], device=self.device).repeat((self.num_envs, 1)) 70 | 71 | # -- metrics 72 | self.metrics["orientation_error"] = torch.zeros(self.num_envs, device=self.device) 73 | self.metrics["position_error"] = torch.zeros(self.num_envs, device=self.device) 74 | self.metrics["consecutive_success"] = torch.zeros(self.num_envs, device=self.device) 75 | 76 | def __str__(self) -> str: 77 | msg = "InHandManipulationCommandGenerator:\n" 78 | msg += f"\tCommand dimension: {tuple(self.command.shape[1:])}\n" 79 | return msg 80 | 81 | """ 82 | Properties 83 | """ 84 | 85 | @property 86 | def command(self) -> torch.Tensor: 87 | """The desired goal pose in the environment frame. Shape is (num_envs, 7).""" 88 | return torch.cat((self.pos_command_e, self.quat_command_w), dim=-1) 89 | 90 | """ 91 | Implementation specific functions. 92 | """ 93 | 94 | def _update_metrics(self): 95 | # logs data 96 | # -- compute the orientation error 97 | self.metrics["orientation_error"] = math_utils.quat_error_magnitude( 98 | self.object.data.root_quat_w, self.quat_command_w 99 | ) 100 | # -- compute the position error 101 | self.metrics["position_error"] = torch.norm(self.object.data.root_pos_w - self.pos_command_w, dim=1) 102 | # -- compute the number of consecutive successes 103 | successes = self.metrics["orientation_error"] < self.cfg.orientation_success_threshold 104 | self.metrics["consecutive_success"] += successes.float() 105 | 106 | def _resample_command(self, env_ids: Sequence[int]): 107 | # sample new orientation targets 108 | rand_floats = 2.0 * torch.rand((len(env_ids), 2), device=self.device) - 1.0 109 | # rotate randomly about x-axis and then y-axis 110 | quat = math_utils.quat_mul( 111 | math_utils.quat_from_angle_axis(rand_floats[:, 0] * torch.pi, self._X_UNIT_VEC[env_ids]), 112 | math_utils.quat_from_angle_axis(rand_floats[:, 1] * torch.pi, self._Y_UNIT_VEC[env_ids]), 113 | ) 114 | # make sure the quaternion real-part is always positive 115 | self.quat_command_w[env_ids] = math_utils.quat_unique(quat) if self.cfg.make_quat_unique else quat 116 | 117 | def _update_command(self): 118 | # update the command if goal is reached 119 | if self.cfg.update_goal_on_success: 120 | # compute the goal resets 121 | goal_resets = self.metrics["orientation_error"] < self.cfg.orientation_success_threshold 122 | goal_reset_ids = goal_resets.nonzero(as_tuple=False).squeeze(-1) 123 | # resample the goals 124 | self._resample(goal_reset_ids) 125 | 126 | def _set_debug_vis_impl(self, debug_vis: TYPE_CHECKING): 127 | # set visibility of markers 128 | # note: parent only deals with callbacks. not their visibility 129 | if debug_vis: 130 | # create markers if necessary for the first time 131 | if not hasattr(self, "goal_marker_visualizer"): 132 | self.goal_marker_visualizer = VisualizationMarkers(self.cfg.visualizer_cfg) 133 | # set visibility 134 | self.goal_marker_visualizer.set_visibility(True) 135 | else: 136 | if hasattr(self, "goal_marker_visualizer"): 137 | self.goal_marker_visualizer.set_visibility(False) 138 | 139 | def _debug_vis_callback(self, event): 140 | # add an offset to the marker position to visualize the goal 141 | marker_pos = self.pos_command_w + torch.tensor(self.cfg.marker_pos_offset, device=self.device) 142 | marker_quat = self.quat_command_w 143 | # visualize the goal marker 144 | self.goal_marker_visualizer.visualize(translations=marker_pos, orientations=marker_quat) 145 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/mdp/events.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 | """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_joints_within_limits_range(ManagerTermBase): 23 | """Reset an articulation's joints to a random position in the given limit ranges. 24 | 25 | This function samples random values for the joint position and velocities from the given limit ranges. 26 | The values are then set into the physics simulation. 27 | 28 | The parameters to the function are: 29 | 30 | * :attr:`position_range` - a dictionary of position ranges for each joint. The keys of the dictionary are the 31 | joint names (or regular expressions) of the asset. 32 | * :attr:`velocity_range` - a dictionary of velocity ranges for each joint. The keys of the dictionary are the 33 | joint names (or regular expressions) of the asset. 34 | * :attr:`use_default_offset` - a boolean flag to indicate if the ranges are offset by the default joint state. 35 | Defaults to False. 36 | * :attr:`asset_cfg` - the configuration of the asset to reset. Defaults to the entity named "robot" in the scene. 37 | * :attr:`operation` - whether the ranges are scaled values of the joint limits, or absolute limits. 38 | Defaults to "abs". 39 | 40 | The dictionary values are a tuple of the form ``(a, b)``. Based on the operation, these values are 41 | interpreted differently: 42 | 43 | * If the operation is "abs", the values are the absolute minimum and maximum values for the joint, i.e. 44 | the joint range becomes ``[a, b]``. 45 | * If the operation is "scale", the values are the scaling factors for the joint limits, i.e. the joint range 46 | becomes ``[a * min_joint_limit, b * max_joint_limit]``. 47 | 48 | If the ``a`` or the ``b`` value is ``None``, the joint limits are used instead. 49 | 50 | Note: 51 | If the dictionary does not contain a key, the joint position or joint velocity is set to the default value for 52 | that joint. 53 | 54 | """ 55 | 56 | def __init__(self, cfg: EventTermCfg, env: ManagerBasedEnv): 57 | # initialize the base class 58 | super().__init__(cfg, env) 59 | 60 | # check if the cfg has the required parameters 61 | if "position_range" not in cfg.params or "velocity_range" not in cfg.params: 62 | raise ValueError( 63 | "The term 'reset_joints_within_range' requires parameters: 'position_range' and 'velocity_range'." 64 | f" Received: {list(cfg.params.keys())}." 65 | ) 66 | 67 | # parse the parameters 68 | asset_cfg: SceneEntityCfg = cfg.params.get("asset_cfg", SceneEntityCfg("robot")) 69 | use_default_offset = cfg.params.get("use_default_offset", False) 70 | operation = cfg.params.get("operation", "abs") 71 | # check if the operation is valid 72 | if operation not in ["abs", "scale"]: 73 | raise ValueError( 74 | f"For event 'reset_joints_within_limits_range', unknown operation: '{operation}'." 75 | " Please use 'abs' or 'scale'." 76 | ) 77 | 78 | # extract the used quantities (to enable type-hinting) 79 | self._asset: Articulation = env.scene[asset_cfg.name] 80 | default_joint_pos = self._asset.data.default_joint_pos[0] 81 | default_joint_vel = self._asset.data.default_joint_vel[0] 82 | 83 | # create buffers to store the joint position range 84 | self._pos_ranges = self._asset.data.soft_joint_pos_limits[0].clone() 85 | # parse joint position ranges 86 | pos_joint_ids = [] 87 | for joint_name, joint_range in cfg.params["position_range"].items(): 88 | # find the joint ids 89 | joint_ids = self._asset.find_joints(joint_name)[0] 90 | pos_joint_ids.extend(joint_ids) 91 | 92 | # set the joint position ranges based on the given values 93 | if operation == "abs": 94 | if joint_range[0] is not None: 95 | self._pos_ranges[joint_ids, 0] = joint_range[0] 96 | if joint_range[1] is not None: 97 | self._pos_ranges[joint_ids, 1] = joint_range[1] 98 | elif operation == "scale": 99 | if joint_range[0] is not None: 100 | self._pos_ranges[joint_ids, 0] *= joint_range[0] 101 | if joint_range[1] is not None: 102 | self._pos_ranges[joint_ids, 1] *= joint_range[1] 103 | else: 104 | raise ValueError( 105 | f"Unknown operation: '{operation}' for joint position ranges. Please use 'abs' or 'scale'." 106 | ) 107 | # add the default offset 108 | if use_default_offset: 109 | self._pos_ranges[joint_ids] += default_joint_pos[joint_ids].unsqueeze(1) 110 | 111 | # store the joint pos ids (used later to sample the joint positions) 112 | self._pos_joint_ids = torch.tensor(pos_joint_ids, device=self._pos_ranges.device) 113 | self._pos_ranges = self._pos_ranges[self._pos_joint_ids] 114 | 115 | # create buffers to store the joint velocity range 116 | self._vel_ranges = torch.stack( 117 | [-self._asset.data.soft_joint_vel_limits[0], self._asset.data.soft_joint_vel_limits[0]], dim=1 118 | ) 119 | # parse joint velocity ranges 120 | vel_joint_ids = [] 121 | for joint_name, joint_range in cfg.params["velocity_range"].items(): 122 | # find the joint ids 123 | joint_ids = self._asset.find_joints(joint_name)[0] 124 | vel_joint_ids.extend(joint_ids) 125 | 126 | # set the joint position ranges based on the given values 127 | if operation == "abs": 128 | if joint_range[0] is not None: 129 | self._vel_ranges[joint_ids, 0] = joint_range[0] 130 | if joint_range[1] is not None: 131 | self._vel_ranges[joint_ids, 1] = joint_range[1] 132 | elif operation == "scale": 133 | if joint_range[0] is not None: 134 | self._vel_ranges[joint_ids, 0] = joint_range[0] * self._vel_ranges[joint_ids, 0] 135 | if joint_range[1] is not None: 136 | self._vel_ranges[joint_ids, 1] = joint_range[1] * self._vel_ranges[joint_ids, 1] 137 | else: 138 | raise ValueError( 139 | f"Unknown operation: '{operation}' for joint velocity ranges. Please use 'abs' or 'scale'." 140 | ) 141 | # add the default offset 142 | if use_default_offset: 143 | self._vel_ranges[joint_ids] += default_joint_vel[joint_ids].unsqueeze(1) 144 | 145 | # store the joint vel ids (used later to sample the joint positions) 146 | self._vel_joint_ids = torch.tensor(vel_joint_ids, device=self._vel_ranges.device) 147 | self._vel_ranges = self._vel_ranges[self._vel_joint_ids] 148 | 149 | def __call__( 150 | self, 151 | env: ManagerBasedEnv, 152 | env_ids: torch.Tensor, 153 | position_range: dict[str, tuple[float | None, float | None]], 154 | velocity_range: dict[str, tuple[float | None, float | None]], 155 | use_default_offset: bool = False, 156 | asset_cfg: SceneEntityCfg = SceneEntityCfg("robot"), 157 | operation: Literal["abs", "scale"] = "abs", 158 | ): 159 | # get default joint state 160 | joint_pos = self._asset.data.default_joint_pos[env_ids].clone() 161 | joint_vel = self._asset.data.default_joint_vel[env_ids].clone() 162 | 163 | # sample random joint positions for each joint 164 | if len(self._pos_joint_ids) > 0: 165 | joint_pos_shape = (len(env_ids), len(self._pos_joint_ids)) 166 | joint_pos[:, self._pos_joint_ids] = sample_uniform( 167 | self._pos_ranges[:, 0], self._pos_ranges[:, 1], joint_pos_shape, device=joint_pos.device 168 | ) 169 | # clip the joint positions to the joint limits 170 | joint_pos_limits = self._asset.data.soft_joint_pos_limits[0, self._pos_joint_ids] 171 | joint_pos = joint_pos.clamp(joint_pos_limits[:, 0], joint_pos_limits[:, 1]) 172 | 173 | # sample random joint velocities for each joint 174 | if len(self._vel_joint_ids) > 0: 175 | joint_vel_shape = (len(env_ids), len(self._vel_joint_ids)) 176 | joint_vel[:, self._vel_joint_ids] = sample_uniform( 177 | self._vel_ranges[:, 0], self._vel_ranges[:, 1], joint_vel_shape, device=joint_vel.device 178 | ) 179 | # clip the joint velocities to the joint limits 180 | joint_vel_limits = self._asset.data.soft_joint_vel_limits[0, self._vel_joint_ids] 181 | joint_vel = joint_vel.clamp(-joint_vel_limits, joint_vel_limits) 182 | 183 | # set into the physics simulation 184 | self._asset.write_joint_state_to_sim(joint_pos, joint_vel, env_ids=env_ids) 185 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Dextrous_hand/inhand/mdp/observations.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 | """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-2024, 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-2024, 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 | """Locomotion environments for legged robots.""" 2 | 3 | from .reach import * # noqa 4 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/__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 | """Fixed-arm environments with end-effector pose tracking commands.""" 7 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/__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 | """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 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/franka/__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, ik_abs_env_cfg, ik_rel_env_cfg, joint_pos_env_cfg 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": 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_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": 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_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": 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": ik_rel_env_cfg.FrankaReachEnvCfg, 65 | }, 66 | disable_env_checker=True, 67 | ) 68 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/franka/agents/__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 | -------------------------------------------------------------------------------- /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_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 FrankaReachPPORunnerCfg(RslRlOnPolicyRunnerCfg): 17 | num_steps_per_env = 24 18 | max_iterations = 1000 19 | save_interval = 50 20 | experiment_name = "franka_reach" 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.001, 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/franka/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_franka" 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/franka/ik_abs_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 | 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_assets.robots.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.body_joint_pos = 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-2024, 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_assets.robots.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.body_joint_pos = 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-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 | 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_assets import FRANKA_PANDA_CFG # isort: skip 20 | 21 | 22 | ## 23 | # Environment configuration 24 | ## 25 | 26 | 27 | @configclass 28 | class FrankaReachEnvCfg(ReachEnvCfg): 29 | def __post_init__(self): 30 | # post init of parent 31 | super().__post_init__() 32 | 33 | # switch robot to franka 34 | self.scene.robot = FRANKA_PANDA_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") 35 | # override rewards 36 | self.rewards.end_effector_position_tracking.params["asset_cfg"].body_names = ["panda_hand"] 37 | self.rewards.end_effector_position_tracking_fine_grained.params["asset_cfg"].body_names = ["panda_hand"] 38 | self.rewards.end_effector_orientation_tracking.params["asset_cfg"].body_names = ["panda_hand"] 39 | 40 | # override actions 41 | self.actions.arm_action = mdp.JointPositionActionCfg( 42 | asset_name="robot", joint_names=["panda_joint.*"], scale=0.5, use_default_offset=True 43 | ) 44 | # override command generator body 45 | # end-effector is along z-direction 46 | self.commands.ee_pose.body_name = "panda_hand" 47 | self.commands.ee_pose.ranges.pitch = (math.pi, math.pi) 48 | 49 | 50 | @configclass 51 | class FrankaReachEnvCfg_PLAY(FrankaReachEnvCfg): 52 | def __post_init__(self): 53 | # post init of parent 54 | super().__post_init__() 55 | # make a smaller scene for play 56 | self.scene.num_envs = 50 57 | self.scene.env_spacing = 2.5 58 | # disable randomization for play 59 | self.observations.policy.enable_corruption = False 60 | -------------------------------------------------------------------------------- /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 | from isaacLab.manipulation.tasks.Robot_arm.reach.reach_env_cfg import ReachEnvCfg 13 | #from isaaclab_tasks.manager_based.manipulation.reach.reach_env_cfg import ReachEnvCfg 14 | 15 | ## 16 | # Pre-defined configs 17 | ## 18 | from isaacLab.manipulation.assets.config.kinova_gripper import KINOVA_ROBOTIQ # isort: skip 19 | 20 | 21 | ## 22 | # Environment configuration 23 | ## 24 | 25 | 26 | @configclass 27 | class KinovaReachEnvCfg(ReachEnvCfg): 28 | def __post_init__(self): 29 | # post init of parent 30 | super().__post_init__() 31 | 32 | # switch robot to ur10 33 | self.scene.robot = KINOVA_ROBOTIQ.replace(prim_path="{ENV_REGEX_NS}/Robot") 34 | self.scene.replicate_physics=False 35 | # override events 36 | self.events.reset_robot_joints.params["position_range"] = (0.75, 1.25) 37 | # override rewards 38 | self.rewards.end_effector_position_tracking.params["asset_cfg"].body_names = ["end_effector_link"] 39 | self.rewards.end_effector_position_tracking_fine_grained.params["asset_cfg"].body_names = ["end_effector_link"] 40 | self.rewards.end_effector_orientation_tracking.params["asset_cfg"].body_names = ["end_effector_link"] 41 | # override actions 42 | self.actions.arm_action = mdp.RelativeJointPositionActionCfg( 43 | asset_name="robot", joint_names=["joint_[1-7]"], scale=0.04 44 | ) 45 | 46 | # override command generator body 47 | # end-effector is along x-direction 48 | self.commands.ee_pose.body_name = "end_effector_link" 49 | self.commands.ee_pose.ranges.pitch = (math.pi / 2, math.pi / 2) 50 | 51 | 52 | @configclass 53 | class KinovaReachEnvCfg_PLAY(KinovaReachEnvCfg): 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 | self.scene.replicate_physics=False 61 | # disable randomization for play 62 | self.observations.policy.enable_corruption = False 63 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/config/ur_10/__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-UR10-v0", 16 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 17 | disable_env_checker=True, 18 | kwargs={ 19 | "env_cfg_entry_point": 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": 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/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-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 UR10ReachPPORunnerCfg(RslRlOnPolicyRunnerCfg): 17 | num_steps_per_env = 24 18 | max_iterations = 1000 19 | save_interval = 50 20 | experiment_name = "reach_ur10" 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/ur_10/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_ur10" 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/ur_10/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 | from isaacLab.manipulation.tasks.Robot_arm.reach.reach_env_cfg import ReachEnvCfg 13 | #from isaaclab_tasks.manager_based.manipulation.reach.reach_env_cfg import ReachEnvCfg 14 | 15 | ## 16 | # Pre-defined configs 17 | ## 18 | from isaaclab_assets import UR10_CFG # isort: skip 19 | 20 | 21 | ## 22 | # Environment configuration 23 | ## 24 | 25 | 26 | @configclass 27 | class UR10ReachEnvCfg(ReachEnvCfg): 28 | def __post_init__(self): 29 | # post init of parent 30 | super().__post_init__() 31 | 32 | # switch robot to ur10 33 | self.scene.robot = UR10_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") 34 | # override events 35 | self.events.reset_robot_joints.params["position_range"] = (0.75, 1.25) 36 | # override rewards 37 | self.rewards.end_effector_position_tracking.params["asset_cfg"].body_names = ["ee_link"] 38 | self.rewards.end_effector_position_tracking_fine_grained.params["asset_cfg"].body_names = ["ee_link"] 39 | self.rewards.end_effector_orientation_tracking.params["asset_cfg"].body_names = ["ee_link"] 40 | # override actions 41 | self.actions.arm_action = mdp.JointPositionActionCfg( 42 | asset_name="robot", joint_names=[".*"], scale=0.5, use_default_offset=True 43 | ) 44 | # override command generator body 45 | # end-effector is along x-direction 46 | self.commands.ee_pose.body_name = "ee_link" 47 | self.commands.ee_pose.ranges.pitch = (math.pi / 2, math.pi / 2) 48 | 49 | 50 | @configclass 51 | class UR10ReachEnvCfg_PLAY(UR10ReachEnvCfg): 52 | def __post_init__(self): 53 | # post init of parent 54 | super().__post_init__() 55 | # make a smaller scene for play 56 | self.scene.num_envs = 50 57 | self.scene.env_spacing = 2.5 58 | # disable randomization for play 59 | self.observations.policy.enable_corruption = False 60 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/mdp/__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 | """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 | from .actions import * 14 | from .actions_cfg import * 15 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/mdp/actions.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 __future__ import annotations 7 | 8 | import torch 9 | from collections.abc import Sequence 10 | import isaaclab.utils.math as math_utils 11 | 12 | import carb 13 | 14 | import isaaclab.utils.string as string_utils 15 | from isaaclab.assets.articulation import Articulation 16 | from isaaclab.managers.action_manager import ActionTerm 17 | from isaaclab.managers import SceneEntityCfg 18 | 19 | 20 | from isaaclab.envs import ManagerBasedEnv 21 | 22 | from . import actions_cfg 23 | 24 | 25 | class JointAction(ActionTerm): 26 | r"""Base class for joint actions. 27 | 28 | This action term performs pre-processing of the raw actions using affine transformations (scale and offset). 29 | These transformations can be configured to be applied to a subset of the articulation's joints. 30 | 31 | Mathematically, the action term is defined as: 32 | 33 | .. math:: 34 | 35 | \text{action} = \text{offset} + \text{scaling} \times \text{input action} 36 | 37 | where :math:`\text{action}` is the action that is sent to the articulation's actuated joints, :math:`\text{offset}` 38 | is the offset applied to the input action, :math:`\text{scaling}` is the scaling applied to the input 39 | action, and :math:`\text{input action}` is the input action from the user. 40 | 41 | Based on above, this kind of action transformation ensures that the input and output actions are in the same 42 | units and dimensions. The child classes of this action term can then map the output action to a specific 43 | desired command of the articulation's joints (e.g. position, velocity, etc.). 44 | """ 45 | 46 | cfg: actions_cfg.JointActionCfg 47 | """The configuration of the action term.""" 48 | _asset: Articulation 49 | """The articulation asset on which the action term is applied.""" 50 | _scale: torch.Tensor | float 51 | """The scaling factor applied to the input action.""" 52 | _offset: torch.Tensor | float 53 | """The offset applied to the input action.""" 54 | 55 | def __init__(self, cfg: actions_cfg.JointActionCfg, env: ManagerBasedEnv,asset_cfg: SceneEntityCfg = SceneEntityCfg("robot"),) -> None: 56 | # initialize the action term 57 | super().__init__(cfg, env) 58 | self._asset: Articulation = env.scene[asset_cfg.name] 59 | # resolve the joints over which the action term is applied 60 | self._joint_ids, self._joint_names = self._asset.find_joints(self.cfg.joint_names) 61 | self._num_joints = len(self._joint_ids) 62 | # log the resolved joint names for debugging 63 | carb.log_info( 64 | f"Resolved joint names for the action term {self.__class__.__name__}:" 65 | f" {self._joint_names} [{self._joint_ids}]" 66 | ) 67 | 68 | # Avoid indexing across all joints for efficiency 69 | if self._num_joints == self._asset.num_joints: 70 | self._joint_ids = slice(None) 71 | 72 | # create tensors for raw and processed actions 73 | self._raw_actions = torch.zeros(self.num_envs, self.action_dim, device=self.device) 74 | self._processed_actions = torch.zeros_like(self.raw_actions) 75 | 76 | # parse scale 77 | if isinstance(cfg.scale, (float, int)): 78 | self._scale = float(cfg.scale) 79 | elif isinstance(cfg.scale, dict): 80 | self._scale = torch.ones(self.num_envs, self.action_dim, device=self.device) 81 | # resolve the dictionary config 82 | index_list, _, value_list = string_utils.resolve_matching_names_values(self.cfg.scale, self._joint_names) 83 | self._scale[:, index_list] = torch.tensor(value_list, device=self.device) 84 | else: 85 | raise ValueError(f"Unsupported scale type: {type(cfg.scale)}. Supported types are float and dict.") 86 | # parse offset 87 | if isinstance(cfg.offset, (float, int)): 88 | self._offset = float(cfg.offset) 89 | elif isinstance(cfg.offset, dict): 90 | self._offset = torch.zeros_like(self._raw_actions) 91 | # resolve the dictionary config 92 | index_list, _, value_list = string_utils.resolve_matching_names_values(self.cfg.offset, self._joint_names) 93 | self._offset[:, index_list] = torch.tensor(value_list, device=self.device) 94 | else: 95 | raise ValueError(f"Unsupported offset type: {type(cfg.offset)}. Supported types are float and dict.") 96 | 97 | """ 98 | Properties. 99 | """ 100 | 101 | @property 102 | def action_dim(self) -> int: 103 | return self._num_joints 104 | 105 | @property 106 | def raw_actions(self) -> torch.Tensor: 107 | return self._raw_actions 108 | 109 | @property 110 | def processed_actions(self) -> torch.Tensor: 111 | return self._processed_actions 112 | 113 | """ 114 | Operations. 115 | """ 116 | 117 | def process_actions(self, actions: torch.Tensor): 118 | # store the raw actions 119 | self._raw_actions[:] = actions.clamp(-1.0, 1.0) 120 | scaled_actions = self._raw_actions * self._scale + self._offset 121 | self._processed_actions[:] = scaled_actions[:] 122 | 123 | def reset(self, env_ids: Sequence[int] | None = None) -> None: 124 | self._raw_actions[env_ids] = 0.0 125 | 126 | 127 | class JointPositionAction(JointAction): 128 | """Joint action term that applies the processed actions to the articulation's joints as position commands.""" 129 | 130 | cfg: actions_cfg.JointPositionActionCfg 131 | """The configuration of the action term.""" 132 | 133 | def __init__(self, cfg: actions_cfg.JointPositionActionCfg, env: ManagerBasedEnv): 134 | # initialize the action term 135 | super().__init__(cfg, env) 136 | # use default joint positions as offset 137 | if cfg.use_default_offset: 138 | self._offset = self._asset.data.default_joint_pos[:, self._joint_ids].clone() 139 | 140 | def apply_actions(self): 141 | # set position targets 142 | self.processed_actions.clamp( 143 | self._asset.data.soft_joint_pos_limits[:, self._joint_ids, 0], 144 | self._asset.data.soft_joint_pos_limits[:, self._joint_ids, 1], 145 | ) 146 | self._asset.set_joint_position_target(self.processed_actions, joint_ids=self._joint_ids) 147 | 148 | 149 | class RelativeJointPositionAction(JointAction): 150 | r"""Joint action term that applies the processed actions to the articulation's joints as relative position commands. 151 | 152 | Unlike :class:`JointPositionAction`, this action term applies the processed actions as relative position commands. 153 | This means that the processed actions are added to the current joint positions of the articulation's joints 154 | before being sent as position commands. 155 | 156 | This means that the action applied at every step is: 157 | 158 | .. math:: 159 | 160 | \text{applied action} = \text{current joint positions} + \text{processed actions} 161 | 162 | where :math:`\text{current joint positions}` are the current joint positions of the articulation's joints. 163 | """ 164 | 165 | cfg: actions_cfg.RelativeJointPositionActionCfg 166 | """The configuration of the action term.""" 167 | 168 | def __init__(self, cfg: actions_cfg.RelativeJointPositionActionCfg, env: ManagerBasedEnv): 169 | # initialize the action term 170 | super().__init__(cfg, env) 171 | # use zero offset for relative position 172 | if cfg.use_zero_offset: 173 | self._offset = 0.0 174 | 175 | def apply_actions(self): 176 | # add current joint positions to the processed actions 177 | current_actions = self.processed_actions + self._asset.data.joint_pos[:, self._joint_ids] 178 | current_actions = current_actions.clamp( 179 | self._asset.data.soft_joint_pos_limits[:, self._joint_ids, 0], 180 | self._asset.data.soft_joint_pos_limits[:, self._joint_ids, 1], 181 | ) 182 | # set position targets 183 | self._asset.set_joint_position_target(current_actions, joint_ids=self._joint_ids) 184 | 185 | 186 | class JointVelocityAction(JointAction): 187 | """Joint action term that applies the processed actions to the articulation's joints as velocity commands.""" 188 | 189 | cfg: actions_cfg.JointVelocityActionCfg 190 | """The configuration of the action term.""" 191 | 192 | def __init__(self, cfg: actions_cfg.JointVelocityActionCfg, env: ManagerBasedEnv): 193 | # initialize the action term 194 | super().__init__(cfg, env) 195 | # use default joint velocity as offset 196 | if cfg.use_default_offset: 197 | self._offset = self._asset.data.default_joint_vel[:, self._joint_ids].clone() 198 | 199 | def apply_actions(self): 200 | # set joint velocity targets 201 | self._asset.set_joint_velocity_target(self.processed_actions, joint_ids=self._joint_ids) 202 | 203 | 204 | # class JointEffortAction(JointAction): 205 | # """Joint action term that applies the processed actions to the articulation's joints as effort commands.""" 206 | 207 | # cfg: actions_cfg.JointEffortActionCfg 208 | # """The configuration of the action term.""" 209 | 210 | # def __init__(self, cfg: actions_cfg.JointEffortActionCfg, env: ManagerBasedEnv): 211 | # super().__init__(cfg, env) 212 | 213 | # def apply_actions(self): 214 | # # set joint effort targets 215 | # self._asset.set_joint_effort_target(self.processed_actions, joint_ids=self._joint_ids) 216 | 217 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/mdp/actions_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 | from dataclasses import MISSING 6 | 7 | from isaaclab.controllers import DifferentialIKControllerCfg 8 | from isaaclab.managers.action_manager import ActionTerm, ActionTermCfg 9 | from isaaclab.utils import configclass 10 | 11 | from . import actions 12 | 13 | ## 14 | # Joint actions. 15 | ## 16 | 17 | 18 | @configclass 19 | class JointActionCfg(ActionTermCfg): 20 | """Configuration for the base joint action term. 21 | 22 | See :class:`JointAction` for more details. 23 | """ 24 | # asset_name: list[str] = MISSING 25 | joint_names: list[str] = MISSING 26 | """List of joint names or regex expressions that the action will be mapped to.""" 27 | scale: float | dict[str, float] = 1.0 28 | """Scale factor for the action (float or dict of regex expressions). Defaults to 1.0.""" 29 | offset: float | dict[str, float] = 0.0 30 | """Offset factor for the action (float or dict of regex expressions). Defaults to 0.0.""" 31 | 32 | 33 | @configclass 34 | class JointPositionActionCfg(JointActionCfg): 35 | """Configuration for the joint position action term. 36 | 37 | See :class:`JointPositionAction` for more details. 38 | """ 39 | 40 | class_type: type[ActionTerm] = actions.JointPositionAction 41 | 42 | use_default_offset: bool = True 43 | """Whether to use default joint positions configured in the articulation asset as offset. 44 | Defaults to True. 45 | 46 | If True, this flag results in overwriting the values of :attr:`offset` to the default joint positions 47 | from the articulation asset. 48 | """ 49 | 50 | 51 | @configclass 52 | class RelativeJointPositionActionCfg(JointActionCfg): 53 | """Configuration for the relative joint position action term. 54 | 55 | See :class:`RelativeJointPositionAction` for more details. 56 | """ 57 | 58 | class_type: type[ActionTerm] = actions.RelativeJointPositionAction 59 | 60 | use_zero_offset: bool = True 61 | """Whether to ignore the offset defined in articulation asset. Defaults to True. 62 | 63 | If True, this flag results in overwriting the values of :attr:`offset` to zero. 64 | """ 65 | 66 | 67 | @configclass 68 | class JointVelocityActionCfg(JointActionCfg): 69 | """Configuration for the joint velocity action term. 70 | 71 | See :class:`JointVelocityAction` for more details. 72 | """ 73 | 74 | class_type: type[ActionTerm] = actions.JointVelocityAction 75 | 76 | use_default_offset: bool = True 77 | """Whether to use default joint velocities configured in the articulation asset as offset. 78 | Defaults to True. 79 | 80 | This overrides the settings from :attr:`offset` if set to True. 81 | """ 82 | 83 | 84 | # @configclass 85 | # class JointEffortActionCfg(JointActionCfg): 86 | # """Configuration for the joint effort action term. 87 | 88 | # See :class:`JointEffortAction` for more details. 89 | # """ 90 | 91 | # class_type: type[ActionTerm] = joint_actions.JointEffortAction 92 | 93 | 94 | # ## 95 | # # Joint actions rescaled to limits. 96 | # ## 97 | 98 | 99 | # @configclass 100 | # class JointPositionToLimitsActionCfg(ActionTermCfg): 101 | # """Configuration for the bounded joint position action term. 102 | 103 | # See :class:`JointPositionWithinLimitsAction` for more details. 104 | # """ 105 | 106 | # class_type: type[ActionTerm] = joint_actions_to_limits.JointPositionToLimitsAction 107 | 108 | # joint_names: list[str] = MISSING 109 | # """List of joint names or regex expressions that the action will be mapped to.""" 110 | 111 | # scale: float | dict[str, float] = 1.0 112 | # """Scale factor for the action (float or dict of regex expressions). Defaults to 1.0.""" 113 | 114 | # rescale_to_limits: bool = True 115 | # """Whether to rescale the action to the joint limits. Defaults to True. 116 | 117 | # If True, the input actions are rescaled to the joint limits, i.e., the action value in 118 | # the range [-1, 1] corresponds to the joint lower and upper limits respectively. 119 | 120 | # Note: 121 | # This operation is performed after applying the scale factor. 122 | # """ 123 | 124 | 125 | # @configclass 126 | # class EMAJointPositionToLimitsActionCfg(JointPositionToLimitsActionCfg): 127 | # """Configuration for the exponential moving average (EMA) joint position action term. 128 | 129 | # See :class:`EMAJointPositionToLimitsAction` for more details. 130 | # """ 131 | 132 | # class_type: type[ActionTerm] = joint_actions_to_limits.EMAJointPositionToLimitsAction 133 | 134 | # alpha: float | dict[str, float] = 1.0 135 | # """The weight for the moving average (float or dict of regex expressions). Defaults to 1.0. 136 | 137 | # If set to 1.0, the processed action is applied directly without any moving average window. 138 | # """ 139 | 140 | 141 | # ## 142 | # # Gripper actions. 143 | # ## 144 | 145 | 146 | # @configclass 147 | # class BinaryJointActionCfg(ActionTermCfg): 148 | # """Configuration for the base binary joint action term. 149 | 150 | # See :class:`BinaryJointAction` for more details. 151 | # """ 152 | 153 | # joint_names: list[str] = MISSING 154 | # """List of joint names or regex expressions that the action will be mapped to.""" 155 | # open_command_expr: dict[str, float] = MISSING 156 | # """The joint command to move to *open* configuration.""" 157 | # close_command_expr: dict[str, float] = MISSING 158 | # """The joint command to move to *close* configuration.""" 159 | 160 | 161 | # @configclass 162 | # class BinaryJointPositionActionCfg(BinaryJointActionCfg): 163 | # """Configuration for the binary joint position action term. 164 | 165 | # See :class:`BinaryJointPositionAction` for more details. 166 | # """ 167 | 168 | # class_type: type[ActionTerm] = binary_joint_actions.BinaryJointPositionAction 169 | 170 | 171 | # @configclass 172 | # class BinaryJointVelocityActionCfg(BinaryJointActionCfg): 173 | # """Configuration for the binary joint velocity action term. 174 | 175 | # See :class:`BinaryJointVelocityAction` for more details. 176 | # """ 177 | 178 | # class_type: type[ActionTerm] = binary_joint_actions.BinaryJointVelocityAction 179 | 180 | 181 | # ## 182 | # # Non-holonomic actions. 183 | # ## 184 | 185 | 186 | # @configclass 187 | # class NonHolonomicActionCfg(ActionTermCfg): 188 | # """Configuration for the non-holonomic action term with dummy joints at the base. 189 | 190 | # See :class:`NonHolonomicAction` for more details. 191 | # """ 192 | 193 | # class_type: type[ActionTerm] = non_holonomic_actions.NonHolonomicAction 194 | 195 | # body_name: str = MISSING 196 | # """Name of the body which has the dummy mechanism connected to.""" 197 | # x_joint_name: str = MISSING 198 | # """The dummy joint name in the x direction.""" 199 | # y_joint_name: str = MISSING 200 | # """The dummy joint name in the y direction.""" 201 | # yaw_joint_name: str = MISSING 202 | # """The dummy joint name in the yaw direction.""" 203 | # scale: tuple[float, float] = (1.0, 1.0) 204 | # """Scale factor for the action. Defaults to (1.0, 1.0).""" 205 | # offset: tuple[float, float] = (0.0, 0.0) 206 | # """Offset factor for the action. Defaults to (0.0, 0.0).""" 207 | 208 | 209 | # ## 210 | # # Task-space Actions. 211 | # ## 212 | 213 | 214 | # @configclass 215 | # class DifferentialInverseKinematicsActionCfg(ActionTermCfg): 216 | # """Configuration for inverse differential kinematics action term. 217 | 218 | # See :class:`DifferentialInverseKinematicsAction` for more details. 219 | # """ 220 | 221 | # @configclass 222 | # class OffsetCfg: 223 | # """The offset pose from parent frame to child frame. 224 | 225 | # On many robots, end-effector frames are fictitious frames that do not have a corresponding 226 | # rigid body. In such cases, it is easier to define this transform w.r.t. their parent rigid body. 227 | # For instance, for the Franka Emika arm, the end-effector is defined at an offset to the the 228 | # "panda_hand" frame. 229 | # """ 230 | 231 | # pos: tuple[float, float, float] = (0.0, 0.0, 0.0) 232 | # """Translation w.r.t. the parent frame. Defaults to (0.0, 0.0, 0.0).""" 233 | # rot: tuple[float, float, float, float] = (1.0, 0.0, 0.0, 0.0) 234 | # """Quaternion rotation ``(w, x, y, z)`` w.r.t. the parent frame. Defaults to (1.0, 0.0, 0.0, 0.0).""" 235 | 236 | # class_type: type[ActionTerm] = task_space_actions.DifferentialInverseKinematicsAction 237 | 238 | # joint_names: list[str] = MISSING 239 | # """List of joint names or regex expressions that the action will be mapped to.""" 240 | # body_name: str = MISSING 241 | # """Name of the body or frame for which IK is performed.""" 242 | # body_offset: OffsetCfg | None = None 243 | # """Offset of target frame w.r.t. to the body frame. Defaults to None, in which case no offset is applied.""" 244 | # scale: float | tuple[float, ...] = 1.0 245 | # """Scale factor for the action. Defaults to 1.0.""" 246 | # controller: DifferentialIKControllerCfg = MISSING 247 | # """The configuration for the differential IK controller.""" 248 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/mdp/observations.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 __future__ import annotations 7 | 8 | import torch 9 | from typing import TYPE_CHECKING 10 | 11 | from isaaclab.assets import Articulation, RigidObject 12 | from isaaclab.managers import SceneEntityCfg 13 | from isaaclab.utils.math import subtract_frame_transforms 14 | from isaaclab.sensors import FrameTransformer 15 | 16 | if TYPE_CHECKING: 17 | from isaaclab.envs import ManagerBasedEnv, ManagerBasedRLEnv 18 | 19 | 20 | def object_position_in_robot_root_frame( 21 | env: ManagerBasedRLEnv, 22 | robot_cfg: SceneEntityCfg = SceneEntityCfg("robot"), 23 | object_cfg: SceneEntityCfg = SceneEntityCfg("object"), 24 | ) -> torch.Tensor: 25 | """The position of the object in the robot's root frame.""" 26 | robot: RigidObject = env.scene[robot_cfg.name] 27 | object: RigidObject = env.scene[object_cfg.name] 28 | object_pos_w = object.data.root_pos_w[:, :3] 29 | object_pos_b, _ = subtract_frame_transforms( 30 | robot.data.root_state_w[:, :3], robot.data.root_state_w[:, 3:7], object_pos_w 31 | ) 32 | 33 | return object_pos_b 34 | 35 | 36 | def last_action_clamped(env: ManagerBasedEnv, action_name: str | None = None) -> torch.Tensor: 37 | """The last input action to the environment. 38 | 39 | The name of the action term for which the action is required. If None, the 40 | entire action tensor is returned. 41 | """ 42 | if action_name is None: 43 | return env.action_manager.action 44 | else: 45 | return env.action_manager.get_term(action_name).raw_actions.clamp(-1,1) -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/mdp/rewards.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 __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, quat_error_magnitude, quat_mul 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 | ee_fingertips_w = ee_frame.data.target_pos_w[..., 1:, :] 39 | 40 | ee_pos = ee_frame.data.target_pos_w[..., 0, :] 41 | lfinger_pos = ee_fingertips_w[..., 0, :] 42 | rfinger_pos = ee_fingertips_w[..., 1, :] 43 | cube_pos_w = object.data.root_pos_w 44 | 45 | 46 | lf_dist = torch.norm(lfinger_pos - cube_pos_w, dim=1) 47 | rf_dist = torch.norm(rfinger_pos - cube_pos_w, dim=1) 48 | ee_dist = torch.norm(ee_pos - cube_pos_w, dim=1) 49 | 50 | return 1 - torch.tanh( ((lf_dist + rf_dist + ee_dist) / 3) / std) 51 | 52 | 53 | def position_command_error(env: ManagerBasedRLEnv, command_name: str, asset_cfg: SceneEntityCfg) -> torch.Tensor: 54 | """Penalize tracking of the position error using L2-norm. 55 | 56 | The function computes the position error between the desired position (from the command) and the 57 | current position of the asset's body (in world frame). The position error is computed as the L2-norm 58 | of the difference between the desired and current positions. 59 | """ 60 | # extract the asset (to enable type hinting) 61 | asset: RigidObject = env.scene[asset_cfg.name] 62 | command = env.command_manager.get_command(command_name) 63 | # obtain the desired and current positions 64 | des_pos_b = command[:, :3] 65 | des_pos_w, _ = combine_frame_transforms(asset.data.root_state_w[:, :3], asset.data.root_state_w[:, 3:7], des_pos_b) 66 | curr_pos_w = asset.data.body_state_w[:, asset_cfg.body_ids[0], :3] # type: ignore 67 | return torch.norm(curr_pos_w - des_pos_w, dim=1) 68 | 69 | 70 | def position_command_error_tanh( 71 | env: ManagerBasedRLEnv, std: float, command_name: str, asset_cfg: SceneEntityCfg 72 | ) -> torch.Tensor: 73 | """Reward tracking of the position using the tanh kernel. 74 | 75 | The function computes the position error between the desired position (from the command) and the 76 | current position of the asset's body (in world frame) and maps it with a tanh kernel. 77 | """ 78 | # extract the asset (to enable type hinting) 79 | asset: RigidObject = env.scene[asset_cfg.name] 80 | command = env.command_manager.get_command(command_name) 81 | # obtain the desired and current positions 82 | des_pos_b = command[:, :3] 83 | des_pos_w, _ = combine_frame_transforms(asset.data.root_state_w[:, :3], asset.data.root_state_w[:, 3:7], des_pos_b) 84 | curr_pos_w = asset.data.body_state_w[:, asset_cfg.body_ids[0], :3] # type: ignore 85 | distance = torch.norm(curr_pos_w - des_pos_w, dim=1) 86 | return 1 - torch.tanh(distance / std) 87 | 88 | 89 | def orientation_command_error(env: ManagerBasedRLEnv, command_name: str, asset_cfg: SceneEntityCfg) -> torch.Tensor: 90 | """Penalize tracking orientation error using shortest path. 91 | 92 | The function computes the orientation error between the desired orientation (from the command) and the 93 | current orientation of the asset's body (in world frame). The orientation error is computed as the shortest 94 | path between the desired and current orientations. 95 | """ 96 | # extract the asset (to enable type hinting) 97 | asset: RigidObject = env.scene[asset_cfg.name] 98 | command = env.command_manager.get_command(command_name) 99 | # obtain the desired and current orientations 100 | des_quat_b = command[:, 3:7] 101 | des_quat_w = quat_mul(asset.data.root_state_w[:, 3:7], des_quat_b) 102 | curr_quat_w = asset.data.body_state_w[:, asset_cfg.body_ids[0], 3:7] # type: ignore 103 | return quat_error_magnitude(curr_quat_w, des_quat_w) 104 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/mdp/terminations.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 | """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 | from isaaclab.sensors import FrameTransformer 21 | from isaaclab.assets import Articulation, RigidObject 22 | 23 | if TYPE_CHECKING: 24 | from isaaclab.envs import ManagerBasedRLEnv 25 | 26 | 27 | def object_reached_goal( 28 | env: ManagerBasedRLEnv, 29 | command_name: str = "object_pose", 30 | threshold: float = 0.02, 31 | robot_cfg: SceneEntityCfg = SceneEntityCfg("robot"), 32 | object_cfg: SceneEntityCfg = SceneEntityCfg("object"), 33 | ) -> torch.Tensor: 34 | """Termination condition for the object reaching the goal position. 35 | 36 | Args: 37 | env: The environment. 38 | command_name: The name of the command that is used to control the object. 39 | threshold: The threshold for the object to reach the goal position. Defaults to 0.02. 40 | robot_cfg: The robot configuration. Defaults to SceneEntityCfg("robot"). 41 | object_cfg: The object configuration. Defaults to SceneEntityCfg("object"). 42 | 43 | """ 44 | # extract the used quantities (to enable type-hinting) 45 | robot: RigidObject = env.scene[robot_cfg.name] 46 | object: RigidObject = env.scene[object_cfg.name] 47 | command = env.command_manager.get_command(command_name) 48 | # compute the desired position in the world frame 49 | des_pos_b = command[:, :3] 50 | 51 | des_pos_w, _ = combine_frame_transforms(robot.data.root_state_w[:, :3], robot.data.root_state_w[:, 3:7], des_pos_b) 52 | # distance of the end-effector to the object: (num_envs,) 53 | distance = torch.norm(des_pos_w - object.data.root_pos_w[:, :3], dim=1) 54 | 55 | # rewarded if the object is lifted above the threshold 56 | return distance < threshold 57 | 58 | def action_limitations( 59 | env: ManagerBasedRLEnv, 60 | ee_frame_cfg: SceneEntityCfg = SceneEntityCfg("ee_frame"), 61 | robot_cfg: SceneEntityCfg = SceneEntityCfg("robot"), 62 | ) -> torch.Tensor: 63 | """Reward the agent for reaching the object using tanh-kernel.""" 64 | robot: RigidObject = env.scene[robot_cfg.name] 65 | ee_frame: FrameTransformer = env.scene[ee_frame_cfg.name] 66 | ee_tool = ee_frame.data.target_pos_w[..., 0, :] 67 | x = ee_tool[:,0] - robot.data.root_state_w[:, 0] 68 | y = ee_tool[:,1] - robot.data.root_state_w[:, 1] 69 | 70 | return (ee_tool[:,2] < 0.2) | (ee_tool[:,2] > 2.0) | (y > 0.5) | (y < -0.2) | (x < 0.1) -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/Robot_arm/reach/reach_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 | from dataclasses import MISSING 7 | 8 | import isaaclab.sim as sim_utils 9 | from isaaclab.assets import ArticulationCfg, AssetBaseCfg 10 | from isaaclab.envs import ManagerBasedRLEnvCfg 11 | from isaaclab.managers import ActionTermCfg as ActionTerm 12 | from isaaclab.managers import CurriculumTermCfg as CurrTerm 13 | from isaaclab.managers import EventTermCfg as EventTerm 14 | from isaaclab.managers import ObservationGroupCfg as ObsGroup 15 | from isaaclab.managers import ObservationTermCfg as ObsTerm 16 | from isaaclab.managers import RewardTermCfg as RewTerm 17 | from isaaclab.managers import SceneEntityCfg 18 | from isaaclab.managers import TerminationTermCfg as DoneTerm 19 | from isaaclab.scene import InteractiveSceneCfg 20 | from isaaclab.utils import configclass 21 | from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR 22 | from isaaclab.utils.noise import AdditiveUniformNoiseCfg as Unoise 23 | 24 | import isaacLab.manipulation.tasks.Robot_arm.reach.mdp as mdp 25 | 26 | ## 27 | # Scene definition 28 | ## 29 | 30 | 31 | @configclass 32 | class ReachSceneCfg(InteractiveSceneCfg): 33 | """Configuration for the scene with a robotic arm.""" 34 | 35 | # world 36 | ground = AssetBaseCfg( 37 | prim_path="/World/ground", 38 | spawn=sim_utils.GroundPlaneCfg(), 39 | init_state=AssetBaseCfg.InitialStateCfg(pos=(0.0, 0.0, -1.05)), 40 | ) 41 | 42 | table = AssetBaseCfg( 43 | prim_path="{ENV_REGEX_NS}/Table", 44 | spawn=sim_utils.UsdFileCfg( 45 | usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/Mounts/SeattleLabTable/table_instanceable.usd", 46 | ), 47 | init_state=AssetBaseCfg.InitialStateCfg(pos=(0.55, 0.0, 0.0), rot=(0.70711, 0.0, 0.0, 0.70711)), 48 | ) 49 | 50 | # robots 51 | robot: ArticulationCfg = MISSING 52 | 53 | # lights 54 | light = AssetBaseCfg( 55 | prim_path="/World/light", 56 | spawn=sim_utils.DomeLightCfg(color=(0.75, 0.75, 0.75), intensity=2500.0), 57 | ) 58 | 59 | 60 | ## 61 | # MDP settings 62 | ## 63 | 64 | 65 | @configclass 66 | class CommandsCfg: 67 | """Command terms for the MDP.""" 68 | 69 | ee_pose = mdp.UniformPoseCommandCfg( 70 | asset_name="robot", 71 | body_name=MISSING, 72 | resampling_time_range=(4.0, 4.0), 73 | debug_vis=True, 74 | ranges=mdp.UniformPoseCommandCfg.Ranges( 75 | pos_x=(0.35, 0.65), 76 | pos_y=(-0.2, 0.2), 77 | pos_z=(0.15, 0.5), 78 | roll=(0.0, 0.0), 79 | pitch=MISSING, # depends on end-effector axis 80 | yaw=(-3.14, 3.14), 81 | ), 82 | ) 83 | 84 | 85 | @configclass 86 | class ActionsCfg: 87 | """Action specifications for the MDP.""" 88 | 89 | arm_action: ActionTerm = MISSING 90 | gripper_action: ActionTerm | None = None 91 | 92 | 93 | @configclass 94 | class ObservationsCfg: 95 | """Observation specifications for the MDP.""" 96 | 97 | @configclass 98 | class PolicyCfg(ObsGroup): 99 | """Observations for policy group.""" 100 | 101 | # observation terms (order preserved) 102 | joint_pos = ObsTerm(func=mdp.joint_pos_rel, noise=Unoise(n_min=-0.01, n_max=0.01)) 103 | joint_vel = ObsTerm(func=mdp.joint_vel_rel, noise=Unoise(n_min=-0.01, n_max=0.01)) 104 | pose_command = ObsTerm(func=mdp.generated_commands, params={"command_name": "ee_pose"}) 105 | actions = ObsTerm(func=mdp.last_action) 106 | 107 | def __post_init__(self): 108 | self.enable_corruption = True 109 | self.concatenate_terms = True 110 | 111 | # observation groups 112 | policy: PolicyCfg = PolicyCfg() 113 | 114 | 115 | @configclass 116 | class EventCfg: 117 | """Configuration for events.""" 118 | 119 | reset_robot_joints = EventTerm( 120 | func=mdp.reset_joints_by_scale, 121 | mode="reset", 122 | params={ 123 | "position_range": (0.5, 1.5), 124 | "velocity_range": (0.0, 0.0), 125 | }, 126 | ) 127 | 128 | 129 | @configclass 130 | class RewardsCfg: 131 | """Reward terms for the MDP.""" 132 | 133 | # task terms 134 | end_effector_position_tracking = RewTerm( 135 | func=mdp.position_command_error, 136 | weight=-0.2, 137 | params={"asset_cfg": SceneEntityCfg("robot", body_names=MISSING), "command_name": "ee_pose"}, 138 | ) 139 | end_effector_position_tracking_fine_grained = RewTerm( 140 | func=mdp.position_command_error_tanh, 141 | weight=0.1, 142 | params={"asset_cfg": SceneEntityCfg("robot", body_names=MISSING), "std": 0.1, "command_name": "ee_pose"}, 143 | ) 144 | end_effector_orientation_tracking = RewTerm( 145 | func=mdp.orientation_command_error, 146 | weight=-0.1, 147 | params={"asset_cfg": SceneEntityCfg("robot", body_names=MISSING), "command_name": "ee_pose"}, 148 | ) 149 | 150 | # action penalty 151 | action_rate = RewTerm(func=mdp.action_rate_l2, weight=-0.0001) 152 | joint_vel = RewTerm( 153 | func=mdp.joint_vel_l2, 154 | weight=-0.0001, 155 | params={"asset_cfg": SceneEntityCfg("robot")}, 156 | ) 157 | 158 | 159 | @configclass 160 | class TerminationsCfg: 161 | """Termination terms for the MDP.""" 162 | 163 | time_out = DoneTerm(func=mdp.time_out, time_out=True) 164 | 165 | 166 | @configclass 167 | class CurriculumCfg: 168 | """Curriculum terms for the MDP.""" 169 | 170 | action_rate = CurrTerm( 171 | func=mdp.modify_reward_weight, params={"term_name": "action_rate", "weight": -0.005, "num_steps": 4500} 172 | ) 173 | 174 | joint_vel = CurrTerm( 175 | func=mdp.modify_reward_weight, params={"term_name": "joint_vel", "weight": -0.001, "num_steps": 4500} 176 | ) 177 | 178 | 179 | ## 180 | # Environment configuration 181 | ## 182 | 183 | 184 | @configclass 185 | class ReachEnvCfg(ManagerBasedRLEnvCfg): 186 | """Configuration for the reach end-effector pose tracking environment.""" 187 | 188 | # Scene settings 189 | scene: ReachSceneCfg = ReachSceneCfg(num_envs=4096, env_spacing=2.5) 190 | # Basic settings 191 | observations: ObservationsCfg = ObservationsCfg() 192 | actions: ActionsCfg = ActionsCfg() 193 | commands: CommandsCfg = CommandsCfg() 194 | # MDP settings 195 | rewards: RewardsCfg = RewardsCfg() 196 | terminations: TerminationsCfg = TerminationsCfg() 197 | events: EventCfg = EventCfg() 198 | curriculum: CurriculumCfg = CurriculumCfg() 199 | 200 | def __post_init__(self): 201 | """Post initialization.""" 202 | # general settings 203 | self.decimation = 2 204 | self.episode_length_s = 12.0 205 | self.viewer.eye = (3.5, 3.5, 3.5) 206 | # simulation settings 207 | self.sim.dt = 1.0 / 60.0 208 | -------------------------------------------------------------------------------- /isaacLab/manipulation/tasks/__init__.py: -------------------------------------------------------------------------------- 1 | """Package containing task implementations for various robotic environments.""" 2 | 3 | import os 4 | import toml 5 | 6 | # Conveniences to other module directories via relative paths 7 | LAB_TASKS_EXT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../")) 8 | """Path to the extension source directory.""" 9 | 10 | LAB_TASKS_METADATA = toml.load(os.path.join(LAB_TASKS_EXT_DIR, "config", "extension.toml")) 11 | """Extension metadata dictionary parsed from the extension.toml file.""" 12 | 13 | # Configure the module-level variables 14 | __version__ = LAB_TASKS_METADATA["package"]["version"] 15 | 16 | ## 17 | # Register Gym environments. 18 | ## 19 | 20 | from isaaclab_tasks.utils import import_packages 21 | 22 | # The blacklist is used to prevent importing configs from sub-packages 23 | _BLACKLIST_PKGS = ["utils"] 24 | # Import all configs in this package 25 | import_packages(__name__, _BLACKLIST_PKGS) 26 | -------------------------------------------------------------------------------- /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 | 51 | # override the default configuration with CLI arguments 52 | if args_cli.seed is not None: 53 | rslrl_cfg.seed = args_cli.seed 54 | if args_cli.resume is not None: 55 | rslrl_cfg.resume = args_cli.resume 56 | if args_cli.load_run is not None: 57 | rslrl_cfg.load_run = args_cli.load_run 58 | if args_cli.checkpoint is not None: 59 | rslrl_cfg.load_checkpoint = args_cli.checkpoint 60 | if args_cli.run_name is not None: 61 | rslrl_cfg.run_name = args_cli.run_name 62 | if args_cli.logger is not None: 63 | rslrl_cfg.logger = args_cli.logger 64 | # set the project name for wandb and neptune 65 | if rslrl_cfg.logger in {"wandb", "neptune"} and args_cli.log_project_name: 66 | rslrl_cfg.wandb_project = args_cli.log_project_name 67 | rslrl_cfg.neptune_project = args_cli.log_project_name 68 | 69 | return rslrl_cfg 70 | -------------------------------------------------------------------------------- /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 | from isaaclab import __version__ as omni_isaac_lab_version 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 | if omni_isaac_lab_version < "0.21.0": 15 | parser.add_argument("--cpu", action="store_true", default=False, help="Use CPU pipeline.") 16 | parser.add_argument("--num_envs", type=int, default=None, help="Number of environments to simulate.") 17 | parser.add_argument("--task", type=str, default=None, help="Name of the task.") 18 | parser.add_argument("--seed", type=int, default=None, help="Seed used for the environment") 19 | # append RSL-RL cli arguments 20 | cli_args.add_rsl_rl_args(parser) 21 | # append AppLauncher cli args 22 | AppLauncher.add_app_launcher_args(parser) 23 | args_cli = parser.parse_args() 24 | 25 | # launch omniverse app 26 | app_launcher = AppLauncher(args_cli) 27 | simulation_app = app_launcher.app 28 | 29 | """Rest everything follows.""" 30 | 31 | 32 | import gymnasium as gym 33 | import os 34 | import torch 35 | 36 | from isaacLab.manipulation.algorithms.rsl_rl.rsl_rl.runners import OnPolicyRunner 37 | 38 | import isaaclab_tasks # noqa: F401 39 | from isaaclab_tasks.utils import get_checkpoint_path, parse_env_cfg 40 | from isaaclab_rl.rsl_rl import ( 41 | RslRlOnPolicyRunnerCfg, 42 | RslRlVecEnvWrapper, 43 | export_policy_as_onnx, 44 | ) 45 | 46 | # Import extensions to set up environment tasks 47 | import isaacLab.manipulation.tasks # noqa: F401 TODO: import lab. 48 | 49 | 50 | def main(): 51 | """Play with RSL-RL agent.""" 52 | # parse configuration 53 | if omni_isaac_lab_version < "0.21.0": 54 | env_cfg = parse_env_cfg(args_cli.task, use_gpu=not args_cli.cpu, num_envs=args_cli.num_envs) 55 | else: 56 | env_cfg = parse_env_cfg(args_cli.task, num_envs=args_cli.num_envs) 57 | agent_cfg: RslRlOnPolicyRunnerCfg = cli_args.parse_rsl_rl_cfg(args_cli.task, args_cli) 58 | 59 | # create isaac environment 60 | env = gym.make(args_cli.task, cfg=env_cfg) 61 | # wrap around environment for rsl-rl 62 | env = RslRlVecEnvWrapper(env) 63 | 64 | # specify directory for logging experiments 65 | log_root_path = os.path.join("logs", "rsl_rl", agent_cfg.experiment_name) 66 | log_root_path = os.path.abspath(log_root_path) 67 | print(f"[INFO] Loading experiment from directory: {log_root_path}") 68 | resume_path = get_checkpoint_path(log_root_path, agent_cfg.load_run, agent_cfg.load_checkpoint) 69 | print(f"[INFO]: Loading model checkpoint from: {resume_path}") 70 | 71 | # load previously trained model 72 | ppo_runner = OnPolicyRunner(env, agent_cfg.to_dict(), log_dir=None, device=agent_cfg.device) 73 | ppo_runner.load(resume_path) 74 | print(f"[INFO]: Loading model checkpoint from: {resume_path}") 75 | 76 | # obtain the trained policy for inference 77 | policy = ppo_runner.get_inference_policy(device=env.unwrapped.device) 78 | 79 | # export policy to onnx 80 | export_model_dir = os.path.join(os.path.dirname(resume_path), "exported") 81 | export_policy_as_onnx(ppo_runner.alg.actor_critic, export_model_dir, filename="policy.onnx") 82 | 83 | # reset environment 84 | obs, _ = env.get_observations() 85 | # simulate environment 86 | while simulation_app.is_running(): 87 | # run everything in inference mode 88 | with torch.inference_mode(): 89 | # agent stepping 90 | actions = policy(obs) 91 | # env stepping 92 | obs, _, _, _ = env.step(actions) 93 | 94 | # close the simulator 95 | env.close() 96 | 97 | 98 | if __name__ == "__main__": 99 | # run the main execution 100 | main() 101 | # close sim app 102 | simulation_app.close() 103 | -------------------------------------------------------------------------------- /scripts/rsl_rl/train.py: -------------------------------------------------------------------------------- 1 | """Script to train RL agent with RSL-RL.""" 2 | 3 | """Launch Isaac Sim Simulator first.""" 4 | 5 | import argparse 6 | import os 7 | from isaaclab import __version__ as omni_isaac_lab_version 8 | from isaaclab.app import AppLauncher 9 | 10 | # local imports 11 | import cli_args # isort: skip 12 | 13 | # add argparse arguments 14 | parser = argparse.ArgumentParser(description="Train an RL agent with RSL-RL.") 15 | parser.add_argument("--video", action="store_true", default=False, help="Record videos during training.") 16 | parser.add_argument("--video_length", type=int, default=200, help="Length of the recorded video (in steps).") 17 | parser.add_argument("--video_interval", type=int, default=2000, help="Interval between video recordings (in steps).") 18 | if omni_isaac_lab_version < "0.21.0": 19 | parser.add_argument("--cpu", action="store_true", default=False, help="Use CPU pipeline.") 20 | parser.add_argument("--num_envs", type=int, default=None, help="Number of environments to simulate.") 21 | parser.add_argument("--task", type=str, default=None, help="Name of the task.") 22 | parser.add_argument("--seed", type=int, default=None, help="Seed used for the environment") 23 | # append RSL-RL cli arguments 24 | cli_args.add_rsl_rl_args(parser) 25 | # append AppLauncher cli args 26 | AppLauncher.add_app_launcher_args(parser) 27 | args_cli = parser.parse_args() 28 | 29 | # launch omniverse app 30 | app_launcher = AppLauncher(args_cli) 31 | simulation_app = app_launcher.app 32 | 33 | """Rest everything follows.""" 34 | 35 | import gymnasium as gym 36 | import os 37 | import torch 38 | from datetime import datetime 39 | 40 | from isaacLab.manipulation.algorithms.rsl_rl.rsl_rl.runners import OnPolicyRunner 41 | 42 | import isaaclab_tasks # noqa: F401 43 | from isaaclab.envs import ManagerBasedRLEnvCfg 44 | from isaaclab.utils.dict import print_dict 45 | from isaaclab.utils.io import dump_pickle, dump_yaml 46 | from isaaclab_tasks.utils import get_checkpoint_path, parse_env_cfg 47 | from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlVecEnvWrapper 48 | 49 | # Import extensions to set up environment tasks 50 | import isaacLab.manipulation.tasks # noqa: F401 TODO: import lab. 51 | 52 | torch.backends.cuda.matmul.allow_tf32 = True 53 | torch.backends.cudnn.allow_tf32 = True 54 | torch.backends.cudnn.deterministic = False 55 | torch.backends.cudnn.benchmark = False 56 | 57 | 58 | def main(): 59 | """Train with RSL-RL agent.""" 60 | # parse configuration 61 | if omni_isaac_lab_version < "0.21.0": 62 | env_cfg: ManagerBasedRLEnvCfg = parse_env_cfg(args_cli.task, use_gpu=not args_cli.cpu, num_envs=args_cli.num_envs) 63 | else: 64 | env_cfg: ManagerBasedRLEnvCfg = parse_env_cfg(args_cli.task, num_envs=args_cli.num_envs) 65 | agent_cfg: RslRlOnPolicyRunnerCfg = cli_args.parse_rsl_rl_cfg(args_cli.task, args_cli) 66 | 67 | # specify directory for logging experiments 68 | log_root_path = os.path.join("logs", "rsl_rl", agent_cfg.experiment_name) 69 | log_root_path = os.path.abspath(log_root_path) 70 | print(f"[INFO] Logging experiment in directory: {log_root_path}") 71 | # specify directory for logging runs: {time-stamp}_{run_name} 72 | log_dir = datetime.now().strftime("%Y-%m-%d_%H-%M-%S") 73 | if agent_cfg.run_name: 74 | log_dir += f"_{agent_cfg.run_name}" 75 | log_dir = os.path.join(log_root_path, log_dir) 76 | 77 | # create isaac environment 78 | env = gym.make(args_cli.task, cfg=env_cfg, render_mode="rgb_array" if args_cli.video else None) 79 | # wrap for video recording 80 | if args_cli.video: 81 | video_kwargs = { 82 | "video_folder": os.path.join(log_dir, "videos"), 83 | "step_trigger": lambda step: step % args_cli.video_interval == 0, 84 | "video_length": args_cli.video_length, 85 | "disable_logger": True, 86 | } 87 | print("[INFO] Recording videos during training.") 88 | print_dict(video_kwargs, nesting=4) 89 | env = gym.wrappers.RecordVideo(env, **video_kwargs) 90 | # wrap around environment for rsl-rl 91 | env = RslRlVecEnvWrapper(env) 92 | 93 | # create runner from rsl-rl 94 | runner = OnPolicyRunner(env, agent_cfg.to_dict(), log_dir=log_dir, device=agent_cfg.device) 95 | # write git state to logs 96 | runner.add_git_repo_to_log(__file__) 97 | # save resume path before creating a new log_dir 98 | if agent_cfg.resume: 99 | # get path to previous checkpoint 100 | resume_path = get_checkpoint_path(log_root_path, agent_cfg.load_run, agent_cfg.load_checkpoint) 101 | print(f"[INFO]: Loading model checkpoint from: {resume_path}") 102 | # load previously trained model 103 | runner.load(resume_path) 104 | 105 | # set seed of the environment 106 | env.seed(agent_cfg.seed) 107 | 108 | # dump the configuration into log-directory 109 | dump_yaml(os.path.join(log_dir, "params", "env.yaml"), env_cfg) 110 | dump_yaml(os.path.join(log_dir, "params", "agent.yaml"), agent_cfg) 111 | dump_pickle(os.path.join(log_dir, "params", "env.pkl"), env_cfg) 112 | dump_pickle(os.path.join(log_dir, "params", "agent.pkl"), agent_cfg) 113 | 114 | # run training 115 | runner.learn(num_learning_iterations=agent_cfg.max_iterations, init_at_random_ep_len=True) 116 | 117 | # close the simulator 118 | env.close() 119 | 120 | 121 | if __name__ == "__main__": 122 | # run the main execution 123 | main() 124 | # close sim app 125 | simulation_app.close() 126 | -------------------------------------------------------------------------------- /scripts/tools/convert_urdf.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 | """ 7 | Utility to convert a URDF into USD format. 8 | 9 | Unified Robot Description Format (URDF) is an XML file format used in ROS to describe all elements of 10 | a robot. For more information, see: http://wiki.ros.org/urdf 11 | 12 | This script uses the URDF importer extension from Isaac Sim (``omni.isaac.urdf_importer``) to convert a 13 | URDF asset into USD format. It is designed as a convenience script for command-line use. For more 14 | information on the URDF importer, see the documentation for the extension: 15 | https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/ext_omni_isaac_urdf.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 | --merge-joints Consolidate links that are connected by fixed joints. (default: False) 25 | --fix-base Fix the base to where it is imported. (default: False) 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 URDF into USD format.") 38 | parser.add_argument("input", type=str, help="The path to the input URDF file.") 39 | parser.add_argument("output", type=str, help="The path to store the USD file.") 40 | parser.add_argument( 41 | "--merge-joints", 42 | action="store_true", 43 | default=False, 44 | help="Consolidate links that are connected by fixed joints.", 45 | ) 46 | parser.add_argument("--fix-base", action="store_true", default=False, help="Fix the base to where it is imported.") 47 | parser.add_argument( 48 | "--make-instanceable", 49 | action="store_true", 50 | default=False, 51 | help="Make the asset instanceable for efficient cloning.", 52 | ) 53 | # append AppLauncher cli args 54 | AppLauncher.add_app_launcher_args(parser) 55 | # parse the arguments 56 | args_cli = parser.parse_args() 57 | 58 | # launch omniverse app 59 | app_launcher = AppLauncher(args_cli) 60 | simulation_app = app_launcher.app 61 | 62 | """Rest everything follows.""" 63 | 64 | import contextlib 65 | import os 66 | 67 | import carb 68 | import omni.isaac.core.utils.stage as stage_utils 69 | import omni.kit.app 70 | 71 | from isaaclab.sim.converters import UrdfConverter, UrdfConverterCfg 72 | from isaaclab.utils.assets import check_file_path 73 | from isaaclab.utils.dict import print_dict 74 | 75 | BASE_DIR = os.path.dirname(os.path.abspath(__file__)) 76 | assets_path = os.path.join(BASE_DIR, "../../isaacLab/manipulation/assets/") 77 | 78 | def main(): 79 | # check valid file path 80 | urdf_path = assets_path + args_cli.input 81 | if not os.path.isabs(urdf_path): 82 | urdf_path = os.path.abspath(urdf_path) 83 | if not check_file_path(urdf_path): 84 | raise ValueError(f"Invalid file path: {urdf_path}") 85 | # create destination path 86 | dest_path = assets_path + args_cli.output 87 | if not os.path.isabs(dest_path): 88 | dest_path = os.path.abspath(dest_path) 89 | 90 | # Create Urdf converter config 91 | urdf_converter_cfg = UrdfConverterCfg( 92 | asset_path=urdf_path, 93 | usd_dir=os.path.dirname(dest_path), 94 | usd_file_name=os.path.basename(dest_path), 95 | fix_base=args_cli.fix_base, 96 | merge_fixed_joints=args_cli.merge_joints, 97 | force_usd_conversion=True, 98 | make_instanceable=args_cli.make_instanceable, 99 | ) 100 | 101 | # Print info 102 | print("-" * 80) 103 | print("-" * 80) 104 | print(f"Input URDF file: {urdf_path}") 105 | print("URDF importer config:") 106 | print_dict(urdf_converter_cfg.to_dict(), nesting=0) 107 | print("-" * 80) 108 | print("-" * 80) 109 | 110 | # Create Urdf converter and import the file 111 | urdf_converter = UrdfConverter(urdf_converter_cfg) 112 | # print output 113 | print("URDF importer output:") 114 | print(f"Generated USD file: {urdf_converter.usd_path}") 115 | print("-" * 80) 116 | print("-" * 80) 117 | 118 | # Determine if there is a GUI to update: 119 | # acquire settings interface 120 | carb_settings_iface = carb.settings.get_settings() 121 | # read flag for whether a local GUI is enabled 122 | local_gui = carb_settings_iface.get("/app/window/enabled") 123 | # read flag for whether livestreaming GUI is enabled 124 | livestream_gui = carb_settings_iface.get("/app/livestream/enabled") 125 | 126 | # Simulate scene (if not headless) 127 | if local_gui or livestream_gui: 128 | # Open the stage with USD 129 | stage_utils.open_stage(urdf_converter.usd_path) 130 | # Reinitialize the simulation 131 | app = omni.kit.app.get_app_interface() 132 | # Run simulation 133 | with contextlib.suppress(KeyboardInterrupt): 134 | while app.is_running(): 135 | # perform step 136 | app.update() 137 | 138 | 139 | if __name__ == "__main__": 140 | # run the main function 141 | main() 142 | # close sim app 143 | simulation_app.close() 144 | -------------------------------------------------------------------------------- /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.0.0", 41 | "Isaac Sim :: 4.0.0", 42 | ], 43 | zip_safe=False, 44 | ) 45 | --------------------------------------------------------------------------------