├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── README_zh-CN.md ├── action_provider ├── __init__.py ├── action_base.py ├── action_provider_dds.py ├── action_provider_replay.py ├── action_provider_wh_dds.py └── create_action_provider.py ├── dds ├── __init__.py ├── commands_dds.py ├── dds_base.py ├── dds_create.py ├── dds_master.py ├── dex3_dds.py ├── g1_robot_dds.py ├── gripper_dds.py ├── inspire_dds.py ├── reset_pose_dds.py ├── rewards_dds.py ├── sharedmemorymanager.py └── sim_state_dds.py ├── doc ├── isaacsim4.5_install.md ├── isaacsim4.5_install_zh.md ├── isaacsim5.0_install.md └── isaacsim5.0_install_zh.md ├── fetch_assets.sh ├── image_server ├── __init__.py ├── image_server.py └── shared_memory_utils.py ├── img ├── Isaac-Move-Cylinder-G129-Dex1-Wholebody.png ├── Isaac-Move-Cylinder-G129-Dex3-Wholebody.png ├── Isaac-Move-Cylinder-G129-Inspire-Wholebody.png ├── Isaac-PickPlace-Cylinder-G129-Inspire-Joint.png ├── Isaac-PickPlace-Cylinder-H12-27dof-Inspire-Joint.png ├── Isaac-PickPlace-RedBlock-G129-Inspire-Joint.png ├── Isaac-PickPlace-RedBlock-H12-27dof-Inspire-Joint.png ├── Isaac-Stack-RgyBlock-G129-Inspire-Joint.png ├── Isaac-Stack-RgyBlock-H12-27dof-Inspire-Joint.png ├── mainview.png ├── pickplace_clinder_g129_dex1.png ├── pickplace_clinder_g129_dex3.png ├── pickplace_redblock_g129_dex1.png ├── pickplace_redblock_g129_dex3.png ├── stack_rgyblock_g129_dex1.png └── stack_rgyblock_g129_dex3.png ├── layeredcontrol └── robot_control_system.py ├── requirements.txt ├── reset_pose_test.py ├── robots └── unitree.py ├── send_commands_8bit.py ├── send_commands_keyboard.py ├── sim_main.py ├── tasks ├── __init__.py ├── common_config │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-310.pyc │ │ ├── camera_configs.cpython-310.pyc │ │ └── robot_configs.cpython-310.pyc │ ├── camera_configs.py │ └── robot_configs.py ├── common_event │ ├── __pycache__ │ │ └── event_manager.cpython-310.pyc │ └── event_manager.py ├── common_observations │ ├── __pycache__ │ │ ├── camera_state.cpython-310.pyc │ │ ├── dex3_state.cpython-310.pyc │ │ ├── g1_29dof_state.cpython-310.pyc │ │ └── gripper_state.cpython-310.pyc │ ├── camera_state.py │ ├── dex3_state.py │ ├── g1_29dof_state.py │ ├── gripper_state.py │ ├── h12_27dof_state.py │ └── inspire_state.py ├── common_rewards │ ├── base_reward_pickplace_cylindercfg.py │ ├── base_reward_pickplace_redblock.py │ └── base_reward_stack_rgyblock.py ├── common_scene │ ├── __pycache__ │ │ ├── base_scene_pickplace_cylindercfg.cpython-310.pyc │ │ ├── base_scene_pickplace_cylindercfg_1.cpython-310.pyc │ │ ├── base_scene_pickplace_cylindercfg_2.cpython-310.pyc │ │ ├── base_scene_pickplace_readblock.cpython-310.pyc │ │ ├── base_scene_pickplace_redblock.cpython-310.pyc │ │ └── base_scene_stack_rgyblock.cpython-310.pyc │ ├── base_scene_pick_redblock_into_drawer.py │ ├── base_scene_pickplace_cylindercfg.py │ ├── base_scene_pickplace_cylindercfg_wholebody.py │ ├── base_scene_pickplace_redblock.py │ └── base_scene_stack_rgyblock.py ├── common_termination │ ├── __pycache__ │ │ ├── base_termination_pick_place_cylinder.cpython-310.pyc │ │ ├── base_termination_pick_place_readblock.cpython-310.pyc │ │ ├── base_termination_pick_place_redblock.cpython-310.pyc │ │ └── base_termination_stack_rgyblock.cpython-310.pyc │ ├── base_termination_pick_place_cylinder.py │ ├── base_termination_pick_place_redblock.py │ ├── base_termination_pick_redblock_into_drawer.py │ └── base_termination_stack_rgyblock.py ├── config │ └── extension.toml ├── g1_tasks │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-310.pyc │ │ └── pickplace_g1_env_cfg.cpython-310.pyc │ ├── move_cylinder_g1_29dof_dex1_wholebody │ │ ├── __init__.py │ │ ├── mdp │ │ │ ├── __init__.py │ │ │ ├── observations.py │ │ │ ├── rewards.py │ │ │ └── terminations.py │ │ └── move_cylinder_g1_29dof_dex1_hw_env_cfg.py │ ├── move_cylinder_g1_29dof_dex3_wholebody │ │ ├── __init__.py │ │ ├── mdp │ │ │ ├── __init__.py │ │ │ ├── observations.py │ │ │ ├── rewards.py │ │ │ └── terminations.py │ │ └── move_cylinder_g1_29dof_dex3_hw_env_cfg.py │ ├── move_cylinder_g1_29dof_inspire_wholebody │ │ ├── __init__.py │ │ ├── mdp │ │ │ ├── __init__.py │ │ │ ├── observations.py │ │ │ ├── rewards.py │ │ │ └── terminations.py │ │ └── move_cylinder_g1_29dof_inspire_hw_env_cfg.py │ ├── pick_place_cylinder_g1_29dof_dex1 │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-310.pyc │ │ │ ├── pickplace_cylinder_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc │ │ │ ├── pickplace_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc │ │ │ ├── pickplace_g1_env_cfg.cpython-310.pyc │ │ │ └── pickplace_g1_joint_env_cfg.cpython-310.pyc │ │ ├── mdp │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-310.pyc │ │ │ │ ├── events.cpython-310.pyc │ │ │ │ ├── observations.cpython-310.pyc │ │ │ │ └── terminations.cpython-310.pyc │ │ │ ├── observations.py │ │ │ ├── rewards.py │ │ │ └── terminations.py │ │ └── pickplace_cylinder_g1_29dof_dex1_joint_env_cfg.py │ ├── pick_place_cylinder_g1_29dof_dex3 │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-310.pyc │ │ │ ├── pickplace_cylinder_g1_29dof_dex3_joint_env_cfg.cpython-310.pyc │ │ │ ├── pickplace_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc │ │ │ ├── pickplace_g1_29dof_dex3_joint_env_cfg.cpython-310.pyc │ │ │ ├── pickplace_g1_env_cfg.cpython-310.pyc │ │ │ └── pickplace_g1_joint_env_cfg.cpython-310.pyc │ │ ├── mdp │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-310.pyc │ │ │ │ ├── events.cpython-310.pyc │ │ │ │ ├── observations.cpython-310.pyc │ │ │ │ └── terminations.cpython-310.pyc │ │ │ ├── observations.py │ │ │ ├── rewards.py │ │ │ └── terminations.py │ │ └── pickplace_cylinder_g1_29dof_dex3_joint_env_cfg.py │ ├── pick_place_cylinder_g1_29dof_inspire │ │ ├── __init__.py │ │ ├── mdp │ │ │ ├── __init__.py │ │ │ ├── observations.py │ │ │ ├── rewards.py │ │ │ └── terminations.py │ │ └── pickplace_cylinder_g1_29dof_inspire_env_cfg.py │ ├── pick_place_redblock_g1_29dof_dex1 │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-310.pyc │ │ │ ├── pickplace_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc │ │ │ ├── pickplace_g1_env_cfg.cpython-310.pyc │ │ │ ├── pickplace_g1_joint_env_cfg.cpython-310.pyc │ │ │ └── pickplace_redblock_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc │ │ ├── mdp │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-310.pyc │ │ │ │ ├── events.cpython-310.pyc │ │ │ │ ├── observations.cpython-310.pyc │ │ │ │ └── terminations.cpython-310.pyc │ │ │ ├── observations.py │ │ │ ├── rewards.py │ │ │ └── terminations.py │ │ └── pickplace_redblock_g1_29dof_dex1_joint_env_cfg.py │ ├── pick_place_redblock_g1_29dof_dex3 │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-310.pyc │ │ │ ├── pickplace_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc │ │ │ ├── pickplace_g1_29dof_dex3_joint_env_cfg.cpython-310.pyc │ │ │ ├── pickplace_g1_env_cfg.cpython-310.pyc │ │ │ ├── pickplace_g1_joint_env_cfg.cpython-310.pyc │ │ │ └── pickplace_redblock_g1_29dof_dex3_joint_env_cfg.cpython-310.pyc │ │ ├── mdp │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-310.pyc │ │ │ │ ├── events.cpython-310.pyc │ │ │ │ ├── observations.cpython-310.pyc │ │ │ │ └── terminations.cpython-310.pyc │ │ │ ├── observations.py │ │ │ ├── rewards.py │ │ │ └── terminations.py │ │ └── pickplace_redblock_g1_29dof_dex3_joint_env_cfg.py │ ├── pick_place_redblock_g1_29dof_inspire │ │ ├── __init__.py │ │ ├── mdp │ │ │ ├── __init__.py │ │ │ ├── observations.py │ │ │ ├── rewards.py │ │ │ └── terminations.py │ │ └── pickplace_redblock_g1_29dof_inspire_joint_env_cfg.py │ ├── pick_redblock_into_drawer_g1_29dof_dex1 │ │ ├── __init__.py │ │ ├── mdp │ │ │ ├── __init__.py │ │ │ ├── observations.py │ │ │ └── terminations.py │ │ └── pick_redblock_into_drawer_g1_29dof_dex1_joint_env_cfg.py │ ├── pick_redblock_into_drawer_g1_29dof_dex3 │ │ ├── __init__.py │ │ ├── mdp │ │ │ ├── __init__.py │ │ │ ├── observations.py │ │ │ └── terminations.py │ │ └── pick_redblock_into_drawer_g1_29dof_dex3_joint_env_cfg.py │ ├── stack_rgyblock_g1_29dof_dex1 │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-310.pyc │ │ │ ├── pickplace_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc │ │ │ ├── pickplace_g1_env_cfg.cpython-310.pyc │ │ │ ├── pickplace_g1_joint_env_cfg.cpython-310.pyc │ │ │ ├── pickplace_redblock_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc │ │ │ └── stack_rgyblock_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc │ │ ├── mdp │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-310.pyc │ │ │ │ ├── events.cpython-310.pyc │ │ │ │ ├── observations.cpython-310.pyc │ │ │ │ └── terminations.cpython-310.pyc │ │ │ ├── observations.py │ │ │ ├── rewards.py │ │ │ └── terminations.py │ │ └── stack_rgyblock_g1_29dof_dex1_joint_env_cfg.py │ ├── stack_rgyblock_g1_29dof_dex3 │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-310.pyc │ │ │ ├── pickplace_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc │ │ │ ├── pickplace_g1_env_cfg.cpython-310.pyc │ │ │ ├── pickplace_g1_joint_env_cfg.cpython-310.pyc │ │ │ ├── pickplace_redblock_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc │ │ │ ├── stack_rgyblock_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc │ │ │ └── stack_rgyblock_g1_29dof_dex3_joint_env_cfg.cpython-310.pyc │ │ ├── mdp │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-310.pyc │ │ │ │ ├── events.cpython-310.pyc │ │ │ │ ├── observations.cpython-310.pyc │ │ │ │ └── terminations.cpython-310.pyc │ │ │ ├── observations.py │ │ │ ├── rewards.py │ │ │ └── terminations.py │ │ └── stack_rgyblock_g1_29dof_dex3_joint_env_cfg.py │ └── stack_rgyblock_g1_29dof_inspire │ │ ├── __init__.py │ │ ├── mdp │ │ ├── __init__.py │ │ ├── observations.py │ │ ├── rewards.py │ │ └── terminations.py │ │ └── stack_rgyblock_g1_29dof_inspire_joint_env_cfg.py ├── h1-2_tasks │ ├── __init__.py │ ├── pick_place_cylinder_h12_27dof_inspire │ │ ├── __init__.py │ │ ├── mdp │ │ │ ├── __init__.py │ │ │ ├── observations.py │ │ │ ├── rewards.py │ │ │ └── terminations.py │ │ └── pickplace_cylinder_h12_27dof_inspire_env_cfg.py │ ├── pick_place_redblock_h12_27dof_inspire │ │ ├── __init__.py │ │ ├── mdp │ │ │ ├── __init__.py │ │ │ ├── observations.py │ │ │ ├── rewards.py │ │ │ └── terminations.py │ │ └── pickplace_redblock_h12_27dof_inspire_joint_env_cfg.py │ └── stack_rgyblock_h12_27dof_inspire │ │ ├── __init__.py │ │ ├── mdp │ │ ├── __init__.py │ │ ├── observations.py │ │ ├── rewards.py │ │ └── terminations.py │ │ └── stack_rgyblock_h12_27dof_inspire_joint_env_cfg.py └── utils │ ├── __init__.py │ ├── __pycache__ │ ├── __init__.cpython-310.pyc │ ├── __init__.cpython-311.pyc │ ├── camera_utils.cpython-310.pyc │ ├── hydra.cpython-310.pyc │ ├── importer.cpython-310.pyc │ ├── importer.cpython-311.pyc │ ├── parse_cfg.cpython-310.pyc │ └── parse_cfg.cpython-311.pyc │ ├── env_config_utils.py │ ├── hydra.py │ ├── importer.py │ └── parse_cfg.py └── tools ├── augmentation_utils.py ├── convert_urdf.py ├── data_convert.py ├── data_json_load.py ├── edit_usda.py ├── edit_usda_tem.py ├── episode_writer.py ├── get_reward.py ├── get_stiffness.py └── rerun_visualizer.py /.gitignore: -------------------------------------------------------------------------------- 1 | # ================================ 2 | # Python 3 | # ================================ 4 | */__pycache__ 5 | */__pycache__/ 6 | __pycache__ 7 | __pycache__ 8 | __pycache__/ 9 | *.py[cod] 10 | *$py.class 11 | *.so 12 | .Python 13 | build/ 14 | develop-eggs/ 15 | dist/ 16 | downloads/ 17 | eggs/ 18 | .eggs/ 19 | lib/ 20 | lib64/ 21 | parts/ 22 | sdist/ 23 | var/ 24 | wheels/ 25 | pip-wheel-metadata/ 26 | share/python-wheels/ 27 | *.egg-info/ 28 | .installed.cfg 29 | *.egg 30 | MANIFEST 31 | 32 | # ================================ 33 | # env 34 | # ================================ 35 | .env 36 | .venv 37 | env/ 38 | venv/ 39 | ENV/ 40 | env.bak/ 41 | venv.bak/ 42 | conda-meta/ 43 | 44 | # ================================ 45 | # IDE 46 | # ================================ 47 | .vscode/ 48 | .idea/ 49 | *.swp 50 | *.swo 51 | *~ 52 | .DS_Store 53 | Thumbs.db 54 | 55 | # ================================ 56 | # Jupyter Notebook 57 | # ================================ 58 | .ipynb_checkpoints 59 | *.ipynb 60 | 61 | # ================================ 62 | # 日志文件 63 | # ================================ 64 | *.log 65 | logs/ 66 | log/ 67 | 68 | # ================================ 69 | # 仿真和机器人相关 70 | # ================================ 71 | # Isaac Lab 相关 72 | .isaac/ 73 | isaac-sim/ 74 | kit/ 75 | logs/ 76 | videos/ 77 | screenshots/ 78 | *.usda 79 | 80 | 81 | # ROS 相关(如果使用) 82 | devel/ 83 | build/ 84 | install/ 85 | .catkin_workspace 86 | *.pyc 87 | 88 | # Gazebo 相关 89 | *.world~ 90 | models/ 91 | 92 | 93 | 94 | 95 | # ================================ 96 | # 缓存和临时文件 97 | # ================================ 98 | .cache/ 99 | .tmp/ 100 | tmp/ 101 | temp/ 102 | *.tmp 103 | *.temp 104 | *.bak 105 | *.backup 106 | *.old 107 | 108 | 109 | 110 | 111 | 112 | # ================================ 113 | # Git 相关 114 | # ================================ 115 | *.orig 116 | *.rej 117 | 118 | 119 | data.* 120 | data/ 121 | 122 | assets/ 123 | assets.* 124 | assets -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # ============================== 2 | # Stage 1: Builder 3 | # ============================== 4 | FROM nvidia/cuda:12.2.0-runtime-ubuntu22.04 AS builder 5 | 6 | ENV DEBIAN_FRONTEND=noninteractive 7 | ENV TZ=Asia/Shanghai 8 | ENV CONDA_DIR=/opt/conda 9 | ENV PATH=$CONDA_DIR/bin:$PATH 10 | 11 | # 设置 HTTP/HTTPS 代理(可选) 12 | ARG http_proxy 13 | ARG https_proxy 14 | ENV http_proxy=${http_proxy} 15 | ENV https_proxy=${https_proxy} 16 | 17 | # 使用阿里云源 18 | RUN sed -i 's|http://archive.ubuntu.com/ubuntu/|http://mirrors.aliyun.com/ubuntu/|g' /etc/apt/sources.list && \ 19 | sed -i 's|http://security.ubuntu.com/ubuntu/|http://mirrors.aliyun.com/ubuntu/|g' /etc/apt/sources.list 20 | 21 | 22 | # 安装构建依赖(GCC 12 + GLU + Vulkan) 23 | RUN apt-get update && apt-get install -y --no-install-recommends \ 24 | gcc-12 g++-12 cmake build-essential unzip git-lfs \ 25 | libglu1-mesa-dev vulkan-tools wget\ 26 | && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100 \ 27 | && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 100 \ 28 | && rm -rf /var/lib/apt/lists/* 29 | # 安装 Miniconda 30 | RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh && \ 31 | bash miniconda.sh -b -p $CONDA_DIR && \ 32 | rm miniconda.sh && \ 33 | $CONDA_DIR/bin/conda clean -afy 34 | # 接受 Conda TOS + 创建环境 35 | RUN conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main && \ 36 | conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r && \ 37 | conda create -n unitree_sim_env python=3.11 -y && \ 38 | conda clean -afy 39 | 40 | # 切换到 Conda 环境 41 | SHELL ["conda", "run", "-n", "unitree_sim_env", "/bin/bash", "-c"] 42 | 43 | 44 | 45 | RUN conda install -y -c conda-forge "libgcc-ng>=12" "libstdcxx-ng>=12" && \ 46 | apt-get update && apt-get install -y libvulkan1 vulkan-tools && rm -rf /var/lib/apt/lists/* 47 | 48 | 49 | # 安装 PyTorch(CUDA 12.6 对应) 50 | RUN pip install --upgrade pip && \ 51 | pip install torch==2.7.0 torchvision==0.22.0 torchaudio==2.7.0 --index-url https://download.pytorch.org/whl/cu126 52 | 53 | 54 | # 安装 Isaac Sim 55 | RUN pip install "isaacsim[all,extscache]==5.0.0" --extra-index-url https://pypi.nvidia.com 56 | 57 | # 创建工作目录 58 | RUN mkdir -p /home/code 59 | WORKDIR /home/code 60 | 61 | # 克隆并安装 IsaacLab 62 | RUN git clone https://github.com/isaac-sim/IsaacLab.git && \ 63 | cd IsaacLab && \ 64 | git checkout v2.2.0 && \ 65 | ./isaaclab.sh --install 66 | 67 | # 构建 CycloneDDS 68 | RUN git clone https://github.com/eclipse-cyclonedds/cyclonedds -b releases/0.10.x /cyclonedds && \ 69 | cd /cyclonedds && mkdir build install && cd build && \ 70 | cmake .. -DCMAKE_INSTALL_PREFIX=../install && \ 71 | cmake --build . --target install 72 | 73 | # 设置 CycloneDDS 环境变量 74 | ENV CYCLONEDDS_HOME=/cyclonedds/install 75 | 76 | # 安装 unitree_sdk2_python 77 | RUN git clone https://github.com/unitreerobotics/unitree_sdk2_python && \ 78 | cd unitree_sdk2_python && pip install -e . 79 | 80 | # 克隆 unitree_sim_isaaclab 81 | RUN git clone https://github.com/unitreerobotics/unitree_sim_isaaclab.git /home/code/unitree_sim_isaaclab && \ 82 | cd /home/code/unitree_sim_isaaclab && pip install -r requirements.txt 83 | 84 | 85 | # ============================== 86 | # Stage 2: Runtime 87 | # ============================== 88 | FROM nvidia/cuda:12.2.0-runtime-ubuntu22.04 AS runtime 89 | 90 | ENV DEBIAN_FRONTEND=noninteractive 91 | ENV TZ=Asia/Shanghai 92 | ENV CONDA_DIR=/opt/conda 93 | ENV PATH=$CONDA_DIR/bin:$PATH 94 | 95 | # 禁止 Isaac Sim 自动启动 96 | ENV OMNI_KIT_ALLOW_ROOT=1 97 | ENV OMNI_KIT_DISABLE_STARTUP=1 98 | 99 | # 安装运行时依赖 100 | RUN apt-get update && apt-get install -y --no-install-recommends \ 101 | libglu1-mesa git-lfs zenity unzip \ 102 | && rm -rf /var/lib/apt/lists/* 103 | 104 | # 复制 Conda 环境和代码 105 | COPY --from=builder /home/code/IsaacLab /home/code/IsaacLab 106 | COPY --from=builder /home/code/unitree_sdk2_python /home/code/unitree_sdk2_python 107 | 108 | COPY --from=builder /cyclonedds /cyclonedds 109 | COPY --from=builder /opt/conda /opt/conda 110 | COPY --from=builder /home/code/unitree_sim_isaaclab /home/code/unitree_sim_isaaclab 111 | 112 | 113 | ENV CYCLONEDDS_HOME=/cyclonedds/install 114 | 115 | # 写入 bashrc 初始化 116 | RUN echo 'source /opt/conda/etc/profile.d/conda.sh' >> ~/.bashrc && \ 117 | echo 'conda activate unitree_sim_env' >> ~/.bashrc && \ 118 | echo 'export OMNI_KIT_ALLOW_ROOT=1' >> ~/.bashrc && \ 119 | echo 'export OMNI_KIT_DISABLE_STARTUP=1' >> ~/.bashrc 120 | 121 | WORKDIR /home/code 122 | 123 | # 默认进入 Conda 环境 bash 124 | CMD ["conda", "run", "-n", "unitree_sim_env", "/bin/bash"] -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright [2025] [HangZhou YuShu TECHNOLOGY CO.,LTD. ("Unitree Robotics")] 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | ------------------ 16 | 17 | This code builds upon following open-source code-bases. Please visit the URLs to see the respective LICENSES: 18 | 19 | 1. https://github.com/isaac-sim/IsaacLab 20 | 2. https://github.com/isaac-sim/IsaacSim 21 | 3. https://github.com/zeromq/pyzmq 22 | 4. https://github.com/unitreerobotics/unitree_sdk2_python 23 | 24 | ------------------ 25 | -------------------------------------------------------------------------------- /action_provider/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/action_provider/__init__.py -------------------------------------------------------------------------------- /action_provider/action_base.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # Author: wei.li 3 | # License: Apache License, Version 2.0 4 | 5 | from abc import ABC, abstractmethod 6 | from typing import Optional 7 | import torch 8 | import time 9 | import threading 10 | 11 | class ActionProvider(ABC): 12 | """Abstract base class for action providers""" 13 | 14 | def __init__(self, name: str): 15 | print(f"ActionProvider init") 16 | self.name = name 17 | self.is_running = False 18 | self._thread = None 19 | 20 | @abstractmethod 21 | def get_action(self, env) -> Optional[torch.Tensor]: 22 | """Get action 23 | 24 | Args: 25 | env: environment instance 26 | 27 | Returns: 28 | torch.Tensor: action tensor, return None if no action is available 29 | """ 30 | pass 31 | 32 | def start(self): 33 | """Start action provider""" 34 | if not self.is_running: 35 | self.is_running = True 36 | self._thread = threading.Thread(target=self._run_loop, daemon=True) 37 | self._thread.start() 38 | print(f"[{self.name}] ActionProvider started") 39 | 40 | def stop(self): 41 | """Stop action provider""" 42 | print(f"[{self.name}] ActionProvider stop") 43 | self.is_running = False 44 | if self._thread and self._thread.is_alive(): 45 | self._thread.join(timeout=1.0) 46 | print(f"[{self.name}] ActionProvider stopped") 47 | 48 | def _run_loop(self): 49 | """Run loop (subclass can override)""" 50 | while self.is_running: 51 | time.sleep(0.01) 52 | 53 | def cleanup(self): 54 | """Clean up resources (subclass can override)""" 55 | pass -------------------------------------------------------------------------------- /action_provider/create_action_provider.py: -------------------------------------------------------------------------------- 1 | from action_provider.action_provider_dds import DDSActionProvider 2 | 3 | 4 | from action_provider.action_provider_replay import FileActionProviderReplay 5 | 6 | from action_provider.action_provider_wh_dds import DDSRLActionProvider 7 | from pathlib import Path 8 | 9 | 10 | def create_action_provider(env,args): 11 | """create action provider based on parameters""" 12 | if args.action_source == "dds": 13 | return DDSActionProvider( 14 | env=env, 15 | args_cli=args 16 | ) 17 | elif args.action_source == "dds_wholebody": 18 | return DDSRLActionProvider( 19 | env=env, 20 | args_cli=args 21 | ) 22 | elif args.action_source == "replay": 23 | return FileActionProviderReplay(env=env,args_cli=args) 24 | else: 25 | print(f"unknown action source: {args.action_source}") 26 | return None -------------------------------------------------------------------------------- /dds/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/dds/__init__.py -------------------------------------------------------------------------------- /dds/commands_dds.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | """ 4 | Run command DDS communication class 5 | Specialized in receiving the run command 6 | """ 7 | 8 | import threading 9 | from typing import Any, Dict, Optional 10 | from dds.dds_base import DDSObject 11 | from unitree_sdk2py.core.channel import ChannelSubscriber 12 | from unitree_sdk2py.idl.std_msgs.msg.dds_ import String_ 13 | 14 | 15 | class RunCommandDDS(DDSObject): 16 | """Run command DDS node (singleton pattern)""" 17 | 18 | def __init__(self,node_name:str="run_command_dds"): 19 | """Initialize the run command DDS node""" 20 | # avoid duplicate initialization 21 | if hasattr(self, '_initialized'): 22 | return 23 | super().__init__() 24 | 25 | self._initialized = True 26 | self.node_name = node_name 27 | # setup the shared memory 28 | self.setup_shared_memory( 29 | output_shm_name="isaac_run_command_cmd", 30 | input_shm_name="isaac_run_command_state", 31 | output_size=512, 32 | input_size=3072, 33 | outputshm_flag=True, 34 | inputshm_flag=True, 35 | ) 36 | print(f"[{self.node_name}] Run command DDS node initialized") 37 | 38 | 39 | def setup_publisher(self) -> bool: 40 | """Setup the run command publisher (this node is mainly used for subscribe, the publisher is optional)""" 41 | pass 42 | 43 | def setup_subscriber(self) -> bool: 44 | """Setup the run command subscriber""" 45 | try: 46 | self.subscriber = ChannelSubscriber("rt/run_command/cmd", String_) 47 | self.subscriber.Init(lambda msg: self.dds_subscriber(msg, ""), 1) 48 | 49 | print(f"[{self.node_name}] Run command subscriber initialized") 50 | return True 51 | except Exception as e: 52 | print(f"run_command_dds [{self.node_name}] Failed to initialize the run command subscriber: {e}") 53 | return False 54 | 55 | 56 | def dds_publisher(self) -> Any: 57 | """Process the publish data (this node is mainly used for subscribe, the publish function is optional)""" 58 | pass 59 | 60 | def dds_subscriber(self, msg: String_,datatype:str=None) -> Dict[str, Any]: 61 | """Process the subscribe data""" 62 | try: 63 | cmd_data = { 64 | "run_command": msg.data 65 | } 66 | self.output_shm.write_data(cmd_data) 67 | except Exception as e: 68 | print(f"run_command_dds [{self.node_name}] Failed to process the subscribe data: {e}") 69 | return {} 70 | 71 | def get_run_command(self) -> Optional[Dict[str, Any]]: 72 | """Get the run command 73 | 74 | Returns: 75 | Dict: the run command, if no command return None 76 | """ 77 | if self.output_shm: 78 | return self.output_shm.read_data() 79 | return None 80 | 81 | def write_run_command(self, flag_category): 82 | """Write the run command to the shared memory 83 | 84 | Args: 85 | positions: the run command, if no command return None 86 | """ 87 | try: 88 | # prepare the reset pose data 89 | cmd_data = { 90 | "run_command":flag_category 91 | } 92 | 93 | # write the reset pose data to the shared memory 94 | if self.output_shm: 95 | self.output_shm.write_data(cmd_data) 96 | 97 | except Exception as e: 98 | print(f"run_command_dds [{self.node_name}] Failed to write the run command: {e}") 99 | 100 | def write_run_state(self, ang_vel,projected_gravity,joint_pos,joint_vel): 101 | """Write the robot state to the shared memory 102 | 103 | Args: 104 | ang_vel: the angular velocity list or torch.Tensor 105 | projected_gravity: the projected gravity list or torch.Tensor 106 | joint_pos: the joint position list or torch.Tensor 107 | joint_vel: the joint velocity list or torch.Tensor 108 | """ 109 | if self.input_shm is None: 110 | return 111 | try: 112 | state_data = { 113 | "ang_vel": ang_vel.tolist() if hasattr(ang_vel, 'tolist') else ang_vel, 114 | "projected_gravity": projected_gravity.tolist() if hasattr(projected_gravity, 'tolist') else projected_gravity, 115 | "joint_pos": joint_pos.tolist() if hasattr(joint_pos, 'tolist') else joint_pos, 116 | "joint_vel": joint_vel.tolist() if hasattr(joint_vel, 'tolist') else joint_vel, 117 | } 118 | self.input_shm.write_data(state_data) 119 | except Exception as e: 120 | print(f"run_command_dds [{self.node_name}] Error writing robot state: {e}") 121 | def get_run_state(self): 122 | if self.input_shm is None: 123 | return None 124 | state_data = self.input_shm.read_data() 125 | if state_data is None: 126 | return None 127 | return state_data -------------------------------------------------------------------------------- /dds/dds_base.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from abc import ABC, abstractmethod 4 | from dds.sharedmemorymanager import SharedMemoryManager 5 | from typing import Any 6 | class DDSObject(ABC): 7 | def __init__(self): 8 | self.publishing = False 9 | self.subscribing = False 10 | 11 | @abstractmethod 12 | def dds_publisher(self) -> None: 13 | pass 14 | @abstractmethod 15 | def dds_subscriber(self,msg:Any,datatype:str=None) -> None: 16 | """Process subscribe data""" 17 | pass 18 | @abstractmethod 19 | def setup_subscriber(): 20 | """Process hand command""" 21 | pass 22 | @abstractmethod 23 | def setup_publisher(): 24 | """Process hand command""" 25 | pass 26 | def setup_shared_memory(self, input_shm_name: str = None, output_shm_name: str = None, 27 | input_size: int = 4096, output_size: int = 4096,inputshm_flag:bool=True,outputshm_flag:bool=True): 28 | """Setup shared memory 29 | 30 | Args: 31 | input_shm_name: input shared memory name 32 | output_shm_name: output shared memory name 33 | input_size: input shared memory size 34 | output_size: output shared memory size 35 | """ 36 | if inputshm_flag: 37 | if input_shm_name: 38 | self.input_shm = SharedMemoryManager(input_shm_name, input_size) 39 | print(f"[{self.node_name}] Input shared memory: {self.input_shm.get_name()}") 40 | else: 41 | self.input_shm = SharedMemoryManager(size=input_size) 42 | print(f"[{self.node_name}] Input shared memory: {self.input_shm.get_name()}") 43 | if outputshm_flag: 44 | if output_shm_name: 45 | self.output_shm = SharedMemoryManager(output_shm_name, output_size) 46 | print(f"[{self.node_name}] Output shared memory: {self.output_shm.get_name()}") 47 | else: 48 | self.output_shm = SharedMemoryManager(size=output_size) 49 | print(f"[{self.node_name}] Output shared memory: {self.output_shm.get_name()}") 50 | def stop_communication(self): 51 | self.publishing = False 52 | self.subscribing = False -------------------------------------------------------------------------------- /dds/dds_create.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from dds.dds_master import dds_manager 4 | 5 | def create_dds_objects(args_cli,env): 6 | publish_names = [] 7 | subscribe_names = [] 8 | if args_cli.robot_type=="g129" or args_cli.robot_type=="h1_2": 9 | from dds.g1_robot_dds import G1RobotDDS 10 | g1_robot = G1RobotDDS() 11 | dds_manager.register_object("g129", g1_robot) 12 | publish_names.append("g129") 13 | subscribe_names.append("g129") 14 | if args_cli.enable_dex3_dds: 15 | from dds.dex3_dds import Dex3DDS 16 | dex3 = Dex3DDS() 17 | dds_manager.register_object("dex3", dex3) 18 | publish_names.append("dex3") 19 | subscribe_names.append("dex3") 20 | elif args_cli.enable_dex1_dds: 21 | from dds.gripper_dds import GripperDDS 22 | gripper = GripperDDS() 23 | dds_manager.register_object("dex1", gripper) 24 | publish_names.append("dex1") 25 | subscribe_names.append("dex1") 26 | elif args_cli.enable_inspire_dds: 27 | from dds.inspire_dds import InspireDDS 28 | inspire = InspireDDS() 29 | dds_manager.register_object("inspire", inspire) 30 | publish_names.append("inspire") 31 | subscribe_names.append("inspire") 32 | if "Wholebody" in args_cli.task or args_cli.enable_wholebody_dds: 33 | from dds.commands_dds import RunCommandDDS 34 | run_command_dds = RunCommandDDS() 35 | dds_manager.register_object("run_command", run_command_dds) 36 | publish_names.append("run_command") 37 | subscribe_names.append("run_command") 38 | from dds.reset_pose_dds import ResetPoseCmdDDS 39 | reset_pose_dds = ResetPoseCmdDDS() 40 | dds_manager.register_object("reset_pose", reset_pose_dds) 41 | subscribe_names.append("reset_pose") 42 | from dds.sim_state_dds import SimStateDDS 43 | sim_state_dds = SimStateDDS(env,args_cli.task) 44 | dds_manager.register_object("sim_state", sim_state_dds) 45 | publish_names.append("sim_state") 46 | from dds.rewards_dds import RewardsDDS 47 | rewards_dds = RewardsDDS(env,args_cli.task) 48 | dds_manager.register_object("rewards", rewards_dds) 49 | publish_names.append("rewards") 50 | 51 | dds_manager.start_publishing(publish_names) 52 | dds_manager.start_subscribing(subscribe_names) 53 | return reset_pose_dds,sim_state_dds,dds_manager 54 | 55 | def create_dds_objects_replay(args_cli,env): 56 | publish_names = [] 57 | subscribe_names = [] 58 | if args_cli.robot_type=="g129" or args_cli.robot_type=="h1_2": 59 | from dds.g1_robot_dds import G1RobotDDS 60 | g1_robot = G1RobotDDS() 61 | dds_manager.register_object("g129", g1_robot) 62 | publish_names.append("g129") 63 | subscribe_names.append("g129") 64 | if args_cli.enable_dex3_dds: 65 | from dds.dex3_dds import Dex3DDS 66 | dex3 = Dex3DDS() 67 | dds_manager.register_object("dex3", dex3) 68 | publish_names.append("dex3") 69 | subscribe_names.append("dex3") 70 | elif args_cli.enable_dex1_dds: 71 | from dds.gripper_dds import GripperDDS 72 | gripper = GripperDDS() 73 | dds_manager.register_object("dex1", gripper) 74 | publish_names.append("dex1") 75 | subscribe_names.append("dex1") 76 | elif args_cli.enable_inspire_dds: 77 | from dds.inspire_dds import InspireDDS 78 | inspire = InspireDDS() 79 | dds_manager.register_object("inspire", inspire) 80 | publish_names.append("inspire") 81 | subscribe_names.append("inspire") 82 | 83 | dds_manager.start_publishing(publish_names) 84 | dds_manager.start_subscribing(subscribe_names) -------------------------------------------------------------------------------- /dds/reset_pose_dds.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | """ 4 | Reset pose DDS communication class 5 | Specialized in receiving the reset pose command 6 | """ 7 | 8 | import threading 9 | from typing import Any, Dict, Optional 10 | from dds.dds_base import DDSObject 11 | from unitree_sdk2py.core.channel import ChannelSubscriber 12 | from unitree_sdk2py.idl.std_msgs.msg.dds_ import String_ 13 | 14 | 15 | class ResetPoseCmdDDS(DDSObject): 16 | """Reset pose command DDS node (singleton pattern)""" 17 | 18 | 19 | def __init__(self,node_name:str="reset_pose_dds"): 20 | """Initialize the reset pose DDS node""" 21 | # avoid duplicate initialization 22 | if hasattr(self, '_initialized'): 23 | return 24 | super().__init__() 25 | 26 | self._initialized = True 27 | self.node_name = node_name 28 | # setup the shared memory 29 | self.setup_shared_memory( 30 | output_shm_name="isaac_reset_pose_cmd", 31 | output_size=512, 32 | outputshm_flag=True, 33 | inputshm_flag=False, 34 | ) 35 | print(f"[{self.node_name}] Reset pose DDS node initialized") 36 | 37 | 38 | def setup_publisher(self) -> bool: 39 | """Setup the reset pose command publisher (this node is mainly used for subscribe, the publisher is optional)""" 40 | pass 41 | 42 | def setup_subscriber(self) -> bool: 43 | """Setup the reset pose command subscriber""" 44 | try: 45 | self.subscriber = ChannelSubscriber("rt/reset_pose/cmd", String_) 46 | self.subscriber.Init(lambda msg: self.dds_subscriber(msg, ""), 1) 47 | 48 | print(f"[{self.node_name}] Reset pose command subscriber initialized") 49 | return True 50 | except Exception as e: 51 | print(f"reset_pose_dds [{self.node_name}] Failed to initialize the reset pose command subscriber: {e}") 52 | return False 53 | 54 | 55 | def dds_publisher(self) -> Any: 56 | """Process the publish data (this node is mainly used for subscribe, the publish function is optional)""" 57 | pass 58 | 59 | def dds_subscriber(self, msg: String_,datatype:str=None) -> Dict[str, Any]: 60 | """Process the subscribe data""" 61 | try: 62 | cmd_data = { 63 | "reset_category": msg.data 64 | } 65 | self.output_shm.write_data(cmd_data) 66 | except Exception as e: 67 | print(f"reset_pose_dds [{self.node_name}] Failed to process the subscribe data: {e}") 68 | return {} 69 | 70 | def get_reset_pose_command(self) -> Optional[Dict[str, Any]]: 71 | """Get the reset pose command 72 | 73 | Returns: 74 | Dict: the reset pose command, if no command return None 75 | """ 76 | if self.output_shm: 77 | return self.output_shm.read_data() 78 | return None 79 | 80 | def write_reset_pose_command(self, flag_category): 81 | """Write the reset pose command to the shared memory 82 | 83 | Args: 84 | positions: the reset pose command, if no command return None 85 | """ 86 | try: 87 | # prepare the reset pose data 88 | cmd_data = { 89 | "reset_category":flag_category 90 | } 91 | 92 | # write the reset pose data to the shared memory 93 | if self.output_shm: 94 | self.output_shm.write_data(cmd_data) 95 | 96 | except Exception as e: 97 | print(f"reset_pose_dds [{self.node_name}] Failed to write the reset pose command: {e}") -------------------------------------------------------------------------------- /dds/sharedmemorymanager.py: -------------------------------------------------------------------------------- 1 | import json 2 | import time 3 | import threading 4 | from typing import Dict, Any, Optional 5 | from multiprocessing import shared_memory 6 | 7 | 8 | class SharedMemoryManager: 9 | """Shared memory manager""" 10 | 11 | def __init__(self, name: str = None, size: int = 512): 12 | """Initialize shared memory manager 13 | 14 | Args: 15 | name: shared memory name, if None, create new one 16 | size: shared memory size (bytes) 17 | """ 18 | self.size = size 19 | self.lock = threading.RLock() # reentrant lock 20 | 21 | if name: 22 | try: 23 | self.shm = shared_memory.SharedMemory(name=name) 24 | self.shm_name = name 25 | self.created = False 26 | except FileNotFoundError: 27 | self.shm = shared_memory.SharedMemory(create=True, size=size) 28 | self.shm_name = self.shm.name 29 | self.created = True 30 | else: 31 | self.shm = shared_memory.SharedMemory(create=True, size=size) 32 | self.shm_name = self.shm.name 33 | self.created = True 34 | 35 | def write_data(self, data: Dict[str, Any]) -> bool: 36 | """Write data to shared memory 37 | 38 | Args: 39 | data: data to write 40 | 41 | Returns: 42 | bool: write success or not 43 | """ 44 | try: 45 | with self.lock: 46 | json_str = json.dumps(data) 47 | json_bytes = json_str.encode('utf-8') 48 | 49 | if len(json_bytes) > self.size - 8: # reserve 8 bytes for length and timestamp 50 | print(f"Warning: Data too large for shared memory ({len(json_bytes)} > {self.size - 8})") 51 | return False 52 | 53 | # write timestamp (4 bytes) and data length (4 bytes) 54 | timestamp = int(time.time()) & 0xFFFFFFFF # 32-bit timestamp, use bitmask to ensure in range 55 | self.shm.buf[0:4] = timestamp.to_bytes(4, 'little') 56 | self.shm.buf[4:8] = len(json_bytes).to_bytes(4, 'little') 57 | 58 | # write data 59 | self.shm.buf[8:8+len(json_bytes)] = json_bytes 60 | return True 61 | 62 | except Exception as e: 63 | print(f"Error writing to shared memory: {e}") 64 | return False 65 | 66 | def read_data(self) -> Optional[Dict[str, Any]]: 67 | """Read data from shared memory 68 | 69 | Returns: 70 | Dict[str, Any]: read data dictionary, return None if failed 71 | """ 72 | try: 73 | with self.lock: 74 | # read timestamp and data length 75 | timestamp = int.from_bytes(self.shm.buf[0:4], 'little') 76 | data_len = int.from_bytes(self.shm.buf[4:8], 'little') 77 | 78 | if data_len == 0: 79 | return None 80 | 81 | # read data 82 | json_bytes = bytes(self.shm.buf[8:8+data_len]) 83 | data = json.loads(json_bytes.decode('utf-8')) 84 | data['_timestamp'] = timestamp # add timestamp information 85 | return data 86 | 87 | except Exception as e: 88 | print(f"Error reading from shared memory: {e}") 89 | return None 90 | 91 | def get_name(self) -> str: 92 | """Get shared memory name""" 93 | return self.shm_name 94 | 95 | def cleanup(self): 96 | """Clean up shared memory""" 97 | if hasattr(self, 'shm') and self.shm: 98 | self.shm.close() 99 | if self.created: 100 | try: 101 | self.shm.unlink() 102 | except: 103 | pass 104 | 105 | def __del__(self): 106 | """Destructor""" 107 | self.cleanup() 108 | -------------------------------------------------------------------------------- /dds/sim_state_dds.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | """ 4 | Sim state DDS communication class 5 | Specialized in publishing and receiving sim state data 6 | """ 7 | 8 | import threading 9 | import torch 10 | from typing import Any, Dict, Optional 11 | from dds.dds_base import DDSObject 12 | from unitree_sdk2py.core.channel import ChannelPublisher, ChannelSubscriber 13 | from unitree_sdk2py.idl.std_msgs.msg.dds_ import String_ 14 | from unitree_sdk2py.idl.default import std_msgs_msg_dds__String_ 15 | 16 | import json 17 | 18 | class SimStateDDS(DDSObject): 19 | """Sim state DDS node (singleton pattern)""" 20 | 21 | def __init__(self, env, task_name,node_name:str="sim_state_dds"): 22 | """Initialize the sim state DDS node""" 23 | # avoid duplicate initialization 24 | if hasattr(self, '_initialized') and self._initialized: 25 | return 26 | super().__init__() 27 | self.node_name = node_name 28 | self.env = env 29 | self.task_name = task_name 30 | self._initialized = True 31 | self.sim_state = std_msgs_msg_dds__String_() 32 | 33 | # setup the shared memory 34 | self.setup_shared_memory( 35 | input_shm_name="isaac_sim_state", # read sim state data for publishing 36 | input_size=4096, 37 | outputshm_flag=False 38 | ) 39 | 40 | print(f"[{self.node_name}] Sim state DDS node initialized") 41 | 42 | 43 | def setup_publisher(self) -> bool: 44 | """Setup the publisher of the sim state""" 45 | try: 46 | self.publisher = ChannelPublisher("rt/sim_state", String_) 47 | self.publisher.Init() 48 | 49 | print(f"[{self.node_name}] Sim state publisher initialized") 50 | return True 51 | except Exception as e: 52 | print(f"sim_state_dds [{self.node_name}] Sim state publisher initialization failed: {e}") 53 | return False 54 | 55 | def setup_subscriber(self) -> bool: 56 | """Setup the subscriber of the sim state""" 57 | try: 58 | self.subscriber = ChannelSubscriber("rt/sim_state_cmd", String_) 59 | self.subscriber.Init(lambda msg: self.dds_subscriber(msg, ""), 1) 60 | 61 | print(f"[{self.node_name}] Sim state subscriber initialized") 62 | return True 63 | except Exception as e: 64 | print(f"sim_state_dds [{self.node_name}] Sim state subscriber initialization failed: {e}") 65 | return False 66 | 67 | 68 | def dds_publisher(self) -> Any: 69 | """Process the publish data""" 70 | try: 71 | data = self.input_shm.read_data() 72 | if data is None: 73 | return 74 | # get sim state from environment 75 | sim_state = json.dumps(data) 76 | self.sim_state.data = sim_state 77 | self.publisher.Write(self.sim_state) 78 | except Exception as e: 79 | print(f"sim_state_dds [{self.node_name}] Error processing publish data: {e}") 80 | return None 81 | 82 | def dds_subscriber(self, msg: String_,datatype:str=None) -> Dict[str, Any]: 83 | """Process the subscribe data""" 84 | try: 85 | # Parse received sim state command 86 | data = json.loads(msg.data) 87 | 88 | # Process the command (implement according to your needs) 89 | # For example, you might want to apply the received state to the environment 90 | return data 91 | except Exception as e: 92 | print(f"sim_state_dds [{self.node_name}] Error processing subscribe data: {e}") 93 | return None 94 | 95 | def tensors_to_list(self, obj): 96 | if isinstance(obj, torch.Tensor): 97 | return obj.tolist() 98 | elif isinstance(obj, dict): 99 | return {k: self.tensors_to_list(v) for k, v in obj.items()} 100 | elif isinstance(obj, list): 101 | return [self.tensors_to_list(i) for i in obj] 102 | return obj 103 | 104 | def sim_state_to_json(self,data): 105 | data_serializable = self.tensors_to_list(data) 106 | json_str = json.dumps(data_serializable) 107 | return json_str 108 | 109 | def write_sim_state_data(self, sim_state_data=None): 110 | """Write sim state data to shared memory to trigger publishing 111 | 112 | Args: 113 | sim_state_data: Optional sim state data. If None, will get current state from environment 114 | """ 115 | try: 116 | if sim_state_data is None: 117 | # Get current sim state from environment 118 | sim_state_data = {"trigger": "publish_sim_state"} 119 | 120 | # write to the input shared memory for publishing 121 | if self.input_shm: 122 | self.input_shm.write_data(sim_state_data) 123 | 124 | except Exception as e: 125 | print(f"sim_state_dds [{self.node_name}] Error writing sim state data: {e}") 126 | 127 | def get_sim_state_command(self) -> Optional[Dict[str, Any]]: 128 | """Get the sim state control command 129 | 130 | Returns: 131 | Dict: the sim state command, return None if there is no new command 132 | """ 133 | if self.output_shm: 134 | return self.output_shm.read_data() 135 | return None -------------------------------------------------------------------------------- /doc/isaacsim4.5_install.md: -------------------------------------------------------------------------------- 1 | ## Isaac Sim 4.5.0 Environment Installation 2 | ### 2.1 Installation on Ubuntu 22.04 and Later(pip install) 3 | 4 | - **Create Virtual Environment** 5 | 6 | ``` 7 | conda create -n unitree_sim_env python=3.10 8 | conda activate unitree_sim_env 9 | ``` 10 | - **Install Pytorch** 11 | 12 | This needs to be installed according to your CUDA version. Please refer to the [official PyTorch installation guide](https://pytorch.org/get-started/locally/). The following example uses CUDA 12: 13 | 14 | ``` 15 | pip install torch==2.5.1 torchvision==0.20.1 --index-url https://download.pytorch.org/whl/cu121 16 | ``` 17 | - **Install Isaac Sim 4.5.0** 18 | 19 | ``` 20 | pip install --upgrade pip 21 | 22 | pip install 'isaacsim[all,extscache]==4.5.0' --extra-index-url https://pypi.nvidia.com 23 | ``` 24 | Verify successful installation: 25 | ``` 26 | isaacsim 27 | ``` 28 | First execution will show: Do you accept the EULA? (Yes/No): Yes 29 | 30 | - **Install Isaac Lab** 31 | 32 | The current IsaacLab version used is 91ad4944f2b7fad29d52c04a5264a082bcaad71d 33 | 34 | ``` 35 | git clone git@github.com:isaac-sim/IsaacLab.git 36 | 37 | sudo apt install cmake build-essential 38 | 39 | cd IsaacLab 40 | 41 | ./isaaclab.sh --install 42 | 43 | ``` 44 | 45 | Verify successful installation: 46 | ``` 47 | python scripts/tutorials/00_sim/create_empty.py 48 | or 49 | ./isaaclab.sh -p scripts/tutorials/00_sim/create_empty.py 50 | ``` 51 | 52 | - **Install unitree_sdk2_python** 53 | 54 | ``` 55 | git clone https://github.com/unitreerobotics/unitree_sdk2_python 56 | 57 | cd unitree_sdk2_python 58 | 59 | pip3 install -e . 60 | ``` 61 | 62 | - **Install other dependencies** 63 | ``` 64 | pip install -r requirements.txt 65 | ``` 66 | 67 | ### 2.2 Installation on Ubuntu 20.04(binary install) 68 | 69 | - **Download Isaac Sim Binary** 70 | 71 | Download the [Isaac Sim 4.5.0 binary](https://docs.isaacsim.omniverse.nvidia.com/4.5.0/installation/download.html) and extract it. 72 | 73 | Assume the path to Isaac Sim is ``/home/unitree/tools/isaac-sim``. Follow the steps below: 74 | 75 | - **Set environment variables** 76 | 77 | Please replace with your own path 78 | 79 | ``` 80 | export ISAACSIM_PATH="${HOME}/tools/isaac-sim" 81 | export ISAACSIM_PYTHON_EXE="${ISAACSIM_PATH}/python.sh" 82 | ``` 83 | Verify the setup: 84 | ``` 85 | ${ISAACSIM_PATH}/isaac-sim.sh 86 | # or 87 | ${ISAACSIM_PYTHON_EXE} -c "print('Isaac Sim configuration is now complete.')" 88 | 89 | Note: All conda environments (including base) must be deactivated before running this. 90 | ``` 91 | **Note:** You can add the above commands to your ~/.bashrc file for convenience. 92 | 93 | - **Install Isaac Lab** 94 | 95 | Using IsaacLab commit `91ad4944f2b7fad29d52c04a5264a082bcaad71d` 96 | 97 | ``` 98 | git clone git@github.com:isaac-sim/IsaacLab.git 99 | 100 | sudo apt install cmake build-essential 101 | 102 | cd IsaacLab 103 | 104 | ln -s ${HOME}/tools/isaac-sim/ _isaac_sim (Please replace with your own path) 105 | 106 | ./isaaclab.sh --conda unitree_sim_env 107 | 108 | conda activate unitree_sim_env 109 | 110 | ./isaaclab.sh --install 111 | 112 | ``` 113 | 114 | - **Install unitree_sdk2_python** 115 | 116 | ``` 117 | git clone https://github.com/unitreerobotics/unitree_sdk2_python 118 | 119 | cd unitree_sdk2_python 120 | 121 | pip3 install -e . 122 | 123 | ``` 124 | 125 | - **Install other dependencies** 126 | 127 | ``` 128 | pip install -r requirements.txt 129 | ``` -------------------------------------------------------------------------------- /doc/isaacsim4.5_install_zh.md: -------------------------------------------------------------------------------- 1 | ## Isaac Sim 4.5.0环境安装 2 | ### 2.1 Ubuntu 22.04 以及以上的安装 3 | 4 | - 创建虚拟环境 5 | 6 | ``` 7 | conda create -n unitree_sim_env python=3.10 8 | conda activate unitree_sim_env 9 | ``` 10 | - 安装Pytorch 11 | 12 | 这个需要根据自己的CUDA版本进行安装,具体参考[Pytorch官方教程](https://pytorch.org/get-started/locally/),下面以CUDA 12为例进行安装 13 | 14 | ``` 15 | pip install torch==2.5.1 torchvision==0.20.1 --index-url https://download.pytorch.org/whl/cu121 16 | ``` 17 | - 安装 Isaac Sim 4.5.0 18 | 19 | ``` 20 | pip install --upgrade pip 21 | 22 | pip install 'isaacsim[all,extscache]==4.5.0' --extra-index-url https://pypi.nvidia.com 23 | 24 | ``` 25 | 验证是否安装成功 26 | ``` 27 | isaacsim 28 | ``` 29 | 第一次执行会有:Do you accept the EULA? (Yes/No): Yes 30 | 31 | 32 | 33 | - 安装Isaac Lab 34 | 35 | 目前使用的IsaacLab 的版本号是91ad4944f2b7fad29d52c04a5264a082bcaad71d 36 | 37 | ``` 38 | git clone git@github.com:isaac-sim/IsaacLab.git 39 | 40 | sudo apt install cmake build-essential 41 | 42 | cd IsaacLab 43 | 44 | ./isaaclab.sh --install 45 | 46 | ``` 47 | 48 | 验证安装是否成功 49 | ``` 50 | python scripts/tutorials/00_sim/create_empty.py 51 | or 52 | ./isaaclab.sh -p scripts/tutorials/00_sim/create_empty.py 53 | ``` 54 | 55 | - 安装unitree_sdk2_python 56 | 57 | ``` 58 | git clone https://github.com/unitreerobotics/unitree_sdk2_python 59 | 60 | cd unitree_sdk2_python 61 | 62 | pip3 install -e . 63 | ``` 64 | - 安装其他依赖 65 | ``` 66 | pip install -r requirements.txt 67 | ``` 68 | 69 | ### 2.2 Ubuntu 20.4(二进制)安装 70 | 71 | - 下载二进制的Isaaac Sim 72 | 73 | 下载对应版本的 74 | [二进制Isaac Sim 4.5.0](https://docs.isaacsim.omniverse.nvidia.com/4.5.0/installation/download.html)并解压; 75 | 76 | 假设isaac sim放在`/home/unitree/tools/isaac-sim`,请按照下面的步骤进行安装; 77 | 78 | - 设在环境变量 79 | 80 | ``` 81 | export ISAACSIM_PATH="${HOME}/tools/isaac-sim" 82 | 83 | export ISAACSIM_PYTHON_EXE="${ISAACSIM_PATH}/python.sh" 84 | 85 | ``` 86 | 测试设置是否成功 87 | 88 | ``` 89 | ${ISAACSIM_PATH}/isaac-sim.sh 90 | 91 | 或 92 | 93 | ${ISAACSIM_PYTHON_EXE} -c "print('Isaac Sim configuration is now complete.')" 94 | 95 | 需要退出包括base在内的所有的conda环境 96 | 97 | ``` 98 | 99 | **注意:** 可以把上面命令写到bashrc文件中 100 | 101 | - 安装 Isaac Lab 102 | 103 | 目前使用的IsaacLab 的版本号是91ad4944f2b7fad29d52c04a5264a082bcaad71d 104 | 105 | ``` 106 | git clone git@github.com:isaac-sim/IsaacLab.git 107 | 108 | sudo apt install cmake build-essential 109 | 110 | cd IsaacLab 111 | 112 | ln -s ${HOME}/tools/isaac-sim/ _isaac_sim (请根据自己路径填写) 113 | 114 | ./isaaclab.sh --conda unitree_sim_env 115 | 116 | conda activate unitree_sim_env 117 | 118 | ./isaaclab.sh --install 119 | 120 | ``` 121 | 122 | - 安装 unitree_sdk2_python 123 | 124 | ``` 125 | git clone https://github.com/unitreerobotics/unitree_sdk2_python 126 | 127 | cd unitree_sdk2_python 128 | 129 | pip3 install -e . 130 | 131 | ``` 132 | 133 | - 安装其他的依赖 134 | 135 | ``` 136 | pip install -r requirements.txt 137 | 138 | ``` -------------------------------------------------------------------------------- /doc/isaacsim5.0_install.md: -------------------------------------------------------------------------------- 1 | ## Isaac Sim 5.0.0 Environment Installation 2 | ### 2.1 Installation on Ubuntu 22.04 and Later(pip install) 3 | 4 | - **Create Virtual Environment** 5 | 6 | ``` 7 | conda create -n unitree_sim_env python=3.11 8 | conda activate unitree_sim_env 9 | ``` 10 | - **Install Pytorch** 11 | 12 | This needs to be installed according to your CUDA version. Please refer to the [official PyTorch installation guide](https://pytorch.org/get-started/locally/). The following example uses CUDA 12: 13 | 14 | ``` 15 | pip install torch==2.7.0 torchvision==0.22.0 torchaudio==2.7.0 --index-url https://download.pytorch.org/whl/cu126 16 | ``` 17 | - **Install Isaac Sim 5.0.0** 18 | 19 | ``` 20 | pip install --upgrade pip 21 | 22 | pip install "isaacsim[all,extscache]==5.0.0" --extra-index-url https://pypi.nvidia.com 23 | ``` 24 | Verify successful installation: 25 | ``` 26 | isaacsim 27 | ``` 28 | First execution will show: Do you accept the EULA? (Yes/No): Yes 29 | 30 | - **Install Isaac Lab** 31 | 32 | ``` 33 | git clone git@github.com:isaac-sim/IsaacLab.git 34 | 35 | sudo apt install cmake build-essential 36 | 37 | cd IsaacLab 38 | 39 | git checkout v2.2.0 40 | 41 | ./isaaclab.sh --install 42 | 43 | ``` 44 | 45 | Verify successful installation: 46 | ``` 47 | python scripts/tutorials/00_sim/create_empty.py 48 | or 49 | ./isaaclab.sh -p scripts/tutorials/00_sim/create_empty.py 50 | ``` 51 | 52 | - **Install unitree_sdk2_python** 53 | 54 | ``` 55 | git clone https://github.com/unitreerobotics/unitree_sdk2_python 56 | 57 | cd unitree_sdk2_python 58 | 59 | pip3 install -e . 60 | ``` 61 | 62 | - **Install other dependencies** 63 | ``` 64 | pip install -r requirements.txt 65 | ``` 66 | 67 | ### 2.2 Installation on Ubuntu 20.04(binary install) 68 | 69 | - **Download Isaac Sim Binary** 70 | 71 | Download the [Isaac Sim 5.0.0 binary](https://docs.isaacsim.omniverse.nvidia.com/latest/installation/download.html#download-isaac-sim-shortl) and extract it. 72 | 73 | Assume the path to Isaac Sim is ``/home/unitree/tools/isaac-sim``. Follow the steps below: 74 | 75 | - **Set environment variables** 76 | 77 | Please replace with your own path 78 | 79 | ``` 80 | export ISAACSIM_PATH="${HOME}/tools/isaac-sim" 81 | export ISAACSIM_PYTHON_EXE="${ISAACSIM_PATH}/python.sh" 82 | ``` 83 | Verify the setup: 84 | ``` 85 | ${ISAACSIM_PATH}/isaac-sim.sh 86 | # or 87 | ${ISAACSIM_PYTHON_EXE} -c "print('Isaac Sim configuration is now complete.')" 88 | 89 | Note: All conda environments (including base) must be deactivated before running this. 90 | ``` 91 | **Note:** You can add the above commands to your ~/.bashrc file for convenience. 92 | 93 | - **Install Isaac Lab** 94 | 95 | ``` 96 | git clone git@github.com:isaac-sim/IsaacLab.git 97 | 98 | sudo apt install cmake build-essential 99 | 100 | cd IsaacLab 101 | 102 | git checkout v2.2.0 103 | 104 | ln -s ${HOME}/tools/isaac-sim/ _isaac_sim (Please replace with your own path) 105 | 106 | ./isaaclab.sh --conda unitree_sim_env 107 | 108 | conda activate unitree_sim_env 109 | 110 | ./isaaclab.sh --install 111 | 112 | ``` 113 | 114 | - **Install unitree_sdk2_python** 115 | 116 | ``` 117 | git clone https://github.com/unitreerobotics/unitree_sdk2_python 118 | 119 | cd unitree_sdk2_python 120 | 121 | pip3 install -e . 122 | 123 | ``` 124 | 125 | - **Install other dependencies** 126 | 127 | ``` 128 | pip install -r requirements.txt 129 | ``` 130 | 131 | **Problem:** 132 | 133 | * 1 `libstdc++.so.6` version is too low 134 | 135 | ``` 136 | OSError: /home/unitree/tools/anaconda3/envs/env_isaaclab_tem/bin/../lib/libstdc++.so.6: version GLIBCXX_3.4.30' not found (required by /home/unitree/tools/anaconda3/envs/env_isaaclab_tem/lib/python3.11/site-packages/omni/libcarb.so) 137 | ``` 138 | **Solution:** 139 | `conda install -c conda-forge libstdcxx-ng` 140 | 141 | * 2 Installation Issue with `unitree_sdk2_python` 142 | 143 | If you encounter the following error when installing `unitree_sdk2_python`: 144 | 145 | ``` 146 | Could not locate cyclonedds. Try to set CYCLONEDDS_HOME or CMAKE_PREFIX_PATH 147 | ``` 148 | 149 | or 150 | 151 | ``` 152 | Collecting cyclonedds==0.10.2 (from unitree_sdk2py==1.0.1) 153 | Downloading cyclonedds-0.10.2.tar.gz (156 kB) 154 | Installing build dependencies ... done 155 | Getting requirements to build wheel ... error 156 | error: subprocess-exited-with-error 157 | 158 | × Getting requirements to build wheel did not run successfully. 159 | │ exit code: 1 160 | ╰─> [1 lines of output] 161 | Could not locate cyclonedds. Try to set CYCLONEDDS_HOME or CMAKE_PREFIX_PATH 162 | [end of output] 163 | 164 | note: This error originates from a subprocess, and is likely not a problem with pip. 165 | error: subprocess-exited-with-error 166 | 167 | × Getting requirements to build wheel did not run successfully. 168 | │ exit code: 1 169 | ╰─> See above for output. 170 | 171 | note: This error originates from a subprocess, and is likely not a problem with pip. 172 | ``` 173 | 174 | **Solution**: Please refer to the [unitree\_sdk2\_python FAQ](https://github.com/unitreerobotics/unitree_sdk2_python?tab=readme-ov-file#faq) for instructions. 175 | -------------------------------------------------------------------------------- /doc/isaacsim5.0_install_zh.md: -------------------------------------------------------------------------------- 1 | ## Isaac Sim 5.0.0环境安装 2 | ### 2.1 Ubuntu 22.04 以及以上的安装(pip install) 3 | 4 | - 创建虚拟环境 5 | 6 | ``` 7 | conda create -n unitree_sim_env python=3.11 8 | conda activate unitree_sim_env 9 | ``` 10 | - 安装Pytorch 11 | 12 | 这个需要根据自己的CUDA版本进行安装,具体参考[Pytorch官方教程](https://pytorch.org/get-started/locally/),下面以CUDA 12为例进行安装 13 | 14 | ``` 15 | pip install torch==2.7.0 torchvision==0.22.0 torchaudio==2.7.0 --index-url https://download.pytorch.org/whl/cu126 16 | ``` 17 | - 安装 Isaac Sim 5.0.0 18 | 19 | ``` 20 | pip install --upgrade pip 21 | 22 | pip install "isaacsim[all,extscache]==5.0.0" --extra-index-url https://pypi.nvidia.com 23 | 24 | ``` 25 | 验证是否安装成功 26 | ``` 27 | isaacsim 28 | ``` 29 | 第一次执行会有:Do you accept the EULA? (Yes/No): Yes 30 | 31 | 32 | 33 | - 安装Isaac Lab 34 | 35 | ``` 36 | git clone git@github.com:isaac-sim/IsaacLab.git 37 | 38 | sudo apt install cmake build-essential 39 | 40 | cd IsaacLab 41 | 42 | git checkout v2.2.0 43 | 44 | ./isaaclab.sh --install 45 | 46 | ``` 47 | 48 | 验证安装是否成功 49 | ``` 50 | python scripts/tutorials/00_sim/create_empty.py 51 | or 52 | ./isaaclab.sh -p scripts/tutorials/00_sim/create_empty.py 53 | ``` 54 | 55 | - 安装unitree_sdk2_python 56 | 57 | ``` 58 | git clone https://github.com/unitreerobotics/unitree_sdk2_python 59 | 60 | cd unitree_sdk2_python 61 | 62 | pip3 install -e . 63 | ``` 64 | - 安装其他依赖 65 | ``` 66 | pip install -r requirements.txt 67 | ``` 68 | 69 | ### 2.2 Ubuntu 20.4安装(二进制安装) 70 | 71 | - 下载二进制的Isaaac Sim 72 | 73 | 下载对应版本的 74 | [二进制Isaac Sim 5.0.0](https://docs.isaacsim.omniverse.nvidia.com/latest/installation/download.html#download-isaac-sim-short)并解压; 75 | 76 | 假设isaac sim放在`/home/unitree/tools/isaac-sim`,请按照下面的步骤进行安装; 77 | 78 | - 设在环境变量 79 | 80 | ``` 81 | export ISAACSIM_PATH="${HOME}/tools/isaac-sim" 82 | 83 | export ISAACSIM_PYTHON_EXE="${ISAACSIM_PATH}/python.sh" 84 | 85 | ``` 86 | 测试设置是否成功 87 | 88 | ``` 89 | ${ISAACSIM_PATH}/isaac-sim.sh 90 | 91 | 或 92 | 93 | ${ISAACSIM_PYTHON_EXE} -c "print('Isaac Sim configuration is now complete.')" 94 | 95 | 需要退出包括base在内的所有的conda环境 96 | 97 | ``` 98 | 99 | **注意:** 可以把上面命令写到bashrc文件中 100 | 101 | - 安装 Isaac Lab 102 | 103 | ``` 104 | git clone git@github.com:isaac-sim/IsaacLab.git 105 | 106 | sudo apt install cmake build-essential 107 | 108 | cd IsaacLab 109 | 110 | git checkout v2.2.0 111 | 112 | ln -s ${HOME}/tools/isaac-sim/ _isaac_sim (请根据自己路径填写) 113 | 114 | ./isaaclab.sh --conda unitree_sim_env 115 | 116 | conda activate unitree_sim_env 117 | 118 | ./isaaclab.sh --install 119 | 120 | ``` 121 | 122 | - 安装 unitree_sdk2_python 123 | 124 | ``` 125 | git clone https://github.com/unitreerobotics/unitree_sdk2_python 126 | 127 | cd unitree_sdk2_python 128 | 129 | pip3 install -e . 130 | 131 | ``` 132 | 133 | - 安装其他的依赖 134 | 135 | ``` 136 | pip install -r requirements.txt 137 | 138 | ``` 139 | 140 | 141 | **问题:** 142 | - 1 libstdc++.so.6版本低 143 | ``` 144 | OSError: /home/unitree/tools/anaconda3/envs/env_isaaclab_tem/bin/../lib/libstdc++.so.6: version GLIBCXX_3.4.30' not found (required by /home/unitree/tools/anaconda3/envs/env_isaaclab_tem/lib/python3.11/site-packages/omni/libcarb.so) 145 | ``` 146 | 解决: conda install -c conda-forge libstdcxx-ng 147 | 148 | - 2 安装unitree_sdk2_python 问题 149 | 150 | 如果在安装unitree_sdk2_python 遇到以下问题 151 | 152 | ``` 153 | Could not locate cyclonedds. Try to set CYCLONEDDS_HOME or CMAKE_PREFIX_PATH 154 | 155 | ``` 156 | 或 157 | 158 | ``` 159 | Collecting cyclonedds==0.10.2 (from unitree_sdk2py==1.0.1) 160 | Downloading cyclonedds-0.10.2.tar.gz (156 kB) 161 | Installing build dependencies ... done 162 | Getting requirements to build wheel ... error 163 | error: subprocess-exited-with-error 164 | 165 | × Getting requirements to build wheel did not run successfully. 166 | │ exit code: 1 167 | ╰─> [1 lines of output] 168 | Could not locate cyclonedds. Try to set CYCLONEDDS_HOME or CMAKE_PREFIX_PATH 169 | [end of output] 170 | 171 | note: This error originates from a subprocess, and is likely not a problem with pip. 172 | error: subprocess-exited-with-error 173 | 174 | × Getting requirements to build wheel did not run successfully. 175 | │ exit code: 1 176 | ╰─> See above for output. 177 | 178 | note: This error originates from a subprocess, and is likely not a problem with pip. 179 | ``` 180 | 解决: 请参考[unitree_sdk2_python FAQ](https://github.com/unitreerobotics/unitree_sdk2_python?tab=readme-ov-file#faq) 181 | 182 | -------------------------------------------------------------------------------- /fetch_assets.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e # Exit script if any command fails 4 | set -o pipefail 5 | 6 | # 1. Clone repository 7 | echo "Cloning repository..." 8 | git lfs install 9 | git clone https://huggingface.co/datasets/unitreerobotics/unitree_sim_isaaclab_usds 10 | 11 | # 2. Enter repository directory 12 | cd unitree_sim_isaaclab_usds 13 | 14 | # 3. Check if assets.zip exists and is greater than 1GB 15 | if [ ! -f "assets.zip" ]; then 16 | echo "Error: assets.zip does not exist" 17 | exit 1 18 | fi 19 | 20 | filesize=$(stat -c%s "assets.zip") 21 | if [ "$filesize" -le $((1024 * 1024 * 1024)) ]; then 22 | echo "Error: assets.zip is less than 1GB" 23 | exit 1 24 | fi 25 | 26 | echo "assets.zip check passed, size is $((filesize / 1024 / 1024)) MB" 27 | 28 | # 4. Unzip assets.zip 29 | echo "Unzipping assets.zip..." 30 | unzip -q assets.zip 31 | 32 | # 5. Move assets folder to parent directory 33 | if [ -d "assets" ]; then 34 | echo "Moving assets to parent directory..." 35 | mv assets ../ 36 | else 37 | echo "Error: assets unzip failed or folder does not exist" 38 | exit 1 39 | fi 40 | 41 | # 6. Return to parent directory and delete original folder 42 | cd .. 43 | echo "Deleting unitree_sim_isaaclab_usds folder..." 44 | rm -rf unitree_sim_isaaclab_usds 45 | 46 | echo "✅ All done!" 47 | -------------------------------------------------------------------------------- /image_server/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/image_server/__init__.py -------------------------------------------------------------------------------- /image_server/image_server.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | """ 4 | A ZMQ-based image server that reads multi-image data from shared memory and publishes it 5 | """ 6 | 7 | import cv2 8 | import zmq 9 | import time 10 | import threading 11 | from image_server.shared_memory_utils import MultiImageReader 12 | 13 | 14 | class ImageServer: 15 | def __init__(self, fps=30, port=5555, Unit_Test=False): 16 | """ 17 | Multi-image server - read multi-image data from shared memory and publish it 18 | """ 19 | print("[Image Server] Initializing multi-image server from shared memory") 20 | 21 | self.fps = fps 22 | self.port = port 23 | self.Unit_Test = Unit_Test 24 | self.running = False 25 | self.publish_thread = None 26 | self.frame_count = 0 27 | 28 | # Initialize multi-image shared memory reader 29 | self.multi_image_reader = MultiImageReader() 30 | 31 | # Set ZeroMQ context and socket 32 | self.context = zmq.Context() 33 | self.socket = self.context.socket(zmq.PUB) 34 | self.socket.bind(f"tcp://*:{self.port}") 35 | 36 | if self.Unit_Test: 37 | self._init_performance_metrics() 38 | 39 | print(f"[Image Server] Multi-image server initialized on port {self.port}") 40 | 41 | # start the publishing thread 42 | self.start_publishing() 43 | 44 | def _init_performance_metrics(self): 45 | self.frame_count = 0 46 | self.time_window = 1.0 47 | self.frame_times = [] 48 | self.start_time = time.time() 49 | 50 | def _update_performance_metrics(self, current_time): 51 | self.frame_times.append(current_time) 52 | # Remove timestamps outside the time window 53 | self.frame_times = [t for t in self.frame_times if t >= current_time - self.time_window] 54 | self.frame_count += 1 55 | 56 | def _print_performance_metrics(self, current_time): 57 | if self.frame_count % 30 == 0: 58 | elapsed_time = current_time - self.start_time 59 | real_time_fps = len(self.frame_times) / self.time_window if self.frame_times else 0 60 | print(f"[Image Server] Real-time FPS: {real_time_fps:.2f}, Total frames sent: {self.frame_count}, Elapsed time: {elapsed_time:.2f} sec") 61 | 62 | def send_process(self): 63 | """Read the concatenated images from shared memory and send them""" 64 | print("[Image Server] Starting send_process from shared memory...") 65 | 66 | try: 67 | while True: 68 | # read the concatenated images from shared memory 69 | concatenated_image = self.multi_image_reader.read_concatenated_image() 70 | 71 | if concatenated_image is None: 72 | # if there is no image data, wait a moment and try again 73 | time.sleep(0.01) 74 | continue 75 | 76 | # show the concatenated images 77 | # cv2.imshow('Concatenated Images (Head + Left + Right)', concatenated_image) 78 | # key = cv2.waitKey(1) & 0xFF 79 | # if key == ord('q') or key == 27: # 'q' 或 ESC 键退出 80 | # print("[Image Server] User pressed quit key") 81 | # break 82 | 83 | # encode the images 84 | ret, buffer = cv2.imencode('.jpg', concatenated_image) 85 | if not ret: 86 | print("[Image Server] Frame imencode is failed.") 87 | continue 88 | 89 | jpg_bytes = buffer.tobytes() 90 | 91 | # build the message 92 | message = jpg_bytes 93 | 94 | # send the message 95 | self.socket.send(message) 96 | self.frame_count += 1 97 | 98 | except KeyboardInterrupt: 99 | print("[Image Server] Interrupted by user.") 100 | finally: 101 | cv2.destroyAllWindows() # close the display window 102 | self._close() 103 | 104 | def start_publishing(self): 105 | """Start the publishing thread""" 106 | if not self.running: 107 | self.running = True 108 | self.publish_thread = threading.Thread(target=self.send_process) 109 | self.publish_thread.daemon = True 110 | self.publish_thread.start() 111 | print("[Image Server] Multi-image publishing thread started") 112 | 113 | def stop_publishing(self): 114 | """Stop the publishing thread""" 115 | if self.running: 116 | self.running = False 117 | if self.publish_thread: 118 | self.publish_thread.join(timeout=1.0) 119 | print("[Image Server] Publishing thread stopped") 120 | 121 | def _close(self): 122 | """Close the server""" 123 | self.stop_publishing() 124 | cv2.destroyAllWindows() 125 | 126 | # close the shared memory reader 127 | if hasattr(self, 'multi_image_reader'): 128 | self.multi_image_reader.close() 129 | 130 | # close the network connection 131 | self.socket.close() 132 | self.context.term() 133 | print("[Image Server] Multi-image server closed") 134 | 135 | def __del__(self): 136 | """Destructor""" 137 | self._close() 138 | 139 | 140 | if __name__ == "__main__": 141 | # use the send_process mode example 142 | server = ImageServer(fps=30, Unit_Test=False) 143 | 144 | # use the send_process method (blocking) 145 | server.send_process() 146 | 147 | # or use the thread mode 148 | # try: 149 | # server.start_publishing() 150 | # print("[Image Server] Server running... Press Ctrl+C to stop") 151 | # while True: 152 | # time.sleep(1) 153 | # except KeyboardInterrupt: 154 | # print("\n[Image Server] Interrupted by user") 155 | # finally: 156 | # server._close() -------------------------------------------------------------------------------- /img/Isaac-Move-Cylinder-G129-Dex1-Wholebody.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/img/Isaac-Move-Cylinder-G129-Dex1-Wholebody.png -------------------------------------------------------------------------------- /img/Isaac-Move-Cylinder-G129-Dex3-Wholebody.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/img/Isaac-Move-Cylinder-G129-Dex3-Wholebody.png -------------------------------------------------------------------------------- /img/Isaac-Move-Cylinder-G129-Inspire-Wholebody.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/img/Isaac-Move-Cylinder-G129-Inspire-Wholebody.png -------------------------------------------------------------------------------- /img/Isaac-PickPlace-Cylinder-G129-Inspire-Joint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/img/Isaac-PickPlace-Cylinder-G129-Inspire-Joint.png -------------------------------------------------------------------------------- /img/Isaac-PickPlace-Cylinder-H12-27dof-Inspire-Joint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/img/Isaac-PickPlace-Cylinder-H12-27dof-Inspire-Joint.png -------------------------------------------------------------------------------- /img/Isaac-PickPlace-RedBlock-G129-Inspire-Joint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/img/Isaac-PickPlace-RedBlock-G129-Inspire-Joint.png -------------------------------------------------------------------------------- /img/Isaac-PickPlace-RedBlock-H12-27dof-Inspire-Joint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/img/Isaac-PickPlace-RedBlock-H12-27dof-Inspire-Joint.png -------------------------------------------------------------------------------- /img/Isaac-Stack-RgyBlock-G129-Inspire-Joint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/img/Isaac-Stack-RgyBlock-G129-Inspire-Joint.png -------------------------------------------------------------------------------- /img/Isaac-Stack-RgyBlock-H12-27dof-Inspire-Joint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/img/Isaac-Stack-RgyBlock-H12-27dof-Inspire-Joint.png -------------------------------------------------------------------------------- /img/mainview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/img/mainview.png -------------------------------------------------------------------------------- /img/pickplace_clinder_g129_dex1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/img/pickplace_clinder_g129_dex1.png -------------------------------------------------------------------------------- /img/pickplace_clinder_g129_dex3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/img/pickplace_clinder_g129_dex3.png -------------------------------------------------------------------------------- /img/pickplace_redblock_g129_dex1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/img/pickplace_redblock_g129_dex1.png -------------------------------------------------------------------------------- /img/pickplace_redblock_g129_dex3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/img/pickplace_redblock_g129_dex3.png -------------------------------------------------------------------------------- /img/stack_rgyblock_g129_dex1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/img/stack_rgyblock_g129_dex1.png -------------------------------------------------------------------------------- /img/stack_rgyblock_g129_dex3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/img/stack_rgyblock_g129_dex3.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | rerun-sdk==0.20.1 2 | pyzmq==27.0.0 3 | logging_mp==0.1.5 4 | onnxruntime==1.22.1 5 | onnx 6 | pynput==1.8.1 -------------------------------------------------------------------------------- /reset_pose_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | publish reset category command to rt/reset_pose/cmd 4 | """ 5 | 6 | import time 7 | from unitree_sdk2py.core.channel import ChannelPublisher, ChannelFactoryInitialize 8 | from unitree_sdk2py.idl.std_msgs.msg.dds_ import String_ 9 | 10 | def publish_reset_category(category: int,publisher): 11 | # construct message 12 | msg = String_(data=str(category)) # pass data parameter directly during initialization 13 | 14 | # create publisher 15 | 16 | # publish message 17 | publisher.Write(msg) 18 | print(f"published reset category: {category}") 19 | 20 | if __name__ == "__main__": 21 | # initialize DDS 22 | ChannelFactoryInitialize(1) 23 | publisher = ChannelPublisher("rt/reset_pose/cmd", String_) 24 | publisher.Init() 25 | 26 | for cat in [1]: 27 | publish_reset_category(cat,publisher) 28 | time.sleep(1) # wait for 1 second 29 | print("test publish completed") -------------------------------------------------------------------------------- /tasks/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Package containing task implementations for various robotic environments.""" 7 | 8 | import os 9 | import toml 10 | 11 | # Conveniences to other module directories via relative paths 12 | ISAACLAB_TASKS_EXT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "./")) 13 | """Path to the extension source directory.""" 14 | 15 | ISAACLAB_TASKS_METADATA = toml.load(os.path.join(ISAACLAB_TASKS_EXT_DIR, "config", "extension.toml")) 16 | """Extension metadata dictionary parsed from the extension.toml file.""" 17 | 18 | # Configure the module-level variables 19 | __version__ = ISAACLAB_TASKS_METADATA["package"]["version"] 20 | 21 | ## 22 | # Register Gym environments. 23 | ## 24 | 25 | from .utils import import_packages 26 | 27 | # The blacklist is used to prevent importing configs from sub-packages 28 | # TODO(@ashwinvk): Remove pick_place from the blacklist once pinocchio from Isaac Sim is compatibility 29 | _BLACKLIST_PKGS = ["utils", ".mdp", "pick_place"] 30 | # Import all configs in this package 31 | import_packages(__name__, _BLACKLIST_PKGS) 32 | -------------------------------------------------------------------------------- /tasks/common_config/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | 公共配置模块 3 | 提供可复用的机器人和相机配置 4 | """ 5 | 6 | from .robot_configs import RobotBaseCfg, H12RobotPresets, RobotJointTemplates,G1RobotPresets 7 | from .camera_configs import CameraBaseCfg, CameraPresets 8 | 9 | __all__ = [ 10 | "RobotBaseCfg", 11 | "G1RobotPresets", 12 | "H12RobotPresets", 13 | "RobotJointTemplates", 14 | "CameraBaseCfg", 15 | "CameraPresets" 16 | ] -------------------------------------------------------------------------------- /tasks/common_config/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/common_config/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/common_config/__pycache__/camera_configs.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/common_config/__pycache__/camera_configs.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/common_config/__pycache__/robot_configs.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/common_config/__pycache__/robot_configs.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/common_event/__pycache__/event_manager.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/common_event/__pycache__/event_manager.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/common_event/event_manager.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | """ 4 | event manager 5 | """ 6 | import torch 7 | from isaaclab.managers import SceneEntityCfg 8 | import isaaclab.envs.mdp as base_mdp 9 | 10 | 11 | class SimpleEvent: 12 | def __init__(self, func, params=None): 13 | self.func = func 14 | self.params = params or {} 15 | 16 | def trigger(self, env): 17 | return self.func(env, **self.params) 18 | 19 | 20 | class MultiObjectEvent: 21 | """支持多个物体操作的事件类""" 22 | 23 | def __init__(self, reset_configs=None): 24 | """ 25 | Args: 26 | reset_configs: 多物体重置配置列表,格式为: 27 | [ 28 | { 29 | "asset_cfg": SceneEntityCfg("red_block"), 30 | "pose_range": {"x": [-0.05, 0.05], "y": [-0.05, 0.05]}, 31 | "velocity_range": {} 32 | }, 33 | { 34 | "asset_cfg": SceneEntityCfg("yellow_block"), 35 | "pose_range": {"x": [-0.03, 0.03], "y": [-0.03, 0.03]}, 36 | "velocity_range": {} 37 | } 38 | ] 39 | """ 40 | self.reset_configs = reset_configs or [] 41 | 42 | def trigger(self, env): 43 | """ 44 | 触发多物体重置事件 45 | """ 46 | env_ids = torch.arange(env.num_envs, device=env.device) 47 | results = [] 48 | 49 | for config in self.reset_configs: 50 | try: 51 | result = base_mdp.reset_root_state_uniform( 52 | env=env, 53 | env_ids=env_ids, 54 | pose_range=config.get("pose_range", {}), 55 | velocity_range=config.get("velocity_range", {}), 56 | asset_cfg=config["asset_cfg"] 57 | ) 58 | results.append(result) 59 | print(f"重置物体: {config['asset_cfg'].name}") 60 | except Exception as e: 61 | print(f"物体 {config['asset_cfg'].name} 重置失败: {e}") 62 | 63 | return results 64 | 65 | 66 | class BatchObjectEvent: 67 | """批量物体事件类 - 更灵活的配置方式""" 68 | 69 | def __init__(self, object_names=None, pose_ranges=None, velocity_ranges=None): 70 | """ 71 | Args: 72 | object_names: 物体名称列表,如 ["red_block", "yellow_block", "green_block"] 73 | pose_ranges: 位置范围配置,可以是: 74 | - 单个配置(所有物体使用相同范围): {"x": [-0.05, 0.05], "y": [-0.05, 0.05]} 75 | - 字典配置(每个物体不同范围): {"red_block": {...}, "yellow_block": {...}} 76 | velocity_ranges: 速度范围配置,格式同pose_ranges 77 | """ 78 | self.object_names = object_names or [] 79 | self.pose_ranges = pose_ranges or {} 80 | self.velocity_ranges = velocity_ranges or {} 81 | 82 | def trigger(self, env): 83 | """触发批量重置""" 84 | env_ids = torch.arange(env.num_envs, device=env.device) 85 | results = [] 86 | 87 | for obj_name in self.object_names: 88 | try: 89 | # 获取该物体的pose_range配置 90 | if isinstance(self.pose_ranges, dict) and obj_name in self.pose_ranges: 91 | pose_range = self.pose_ranges[obj_name] 92 | elif isinstance(self.pose_ranges, dict) and "x" in self.pose_ranges: 93 | # 单个配置,所有物体使用相同配置 94 | pose_range = self.pose_ranges 95 | else: 96 | pose_range = {} 97 | 98 | # 获取该物体的velocity_range配置 99 | if isinstance(self.velocity_ranges, dict) and obj_name in self.velocity_ranges: 100 | velocity_range = self.velocity_ranges[obj_name] 101 | elif isinstance(self.velocity_ranges, dict) and "linear" in self.velocity_ranges: 102 | # 单个配置,所有物体使用相同配置 103 | velocity_range = self.velocity_ranges 104 | else: 105 | velocity_range = {} 106 | 107 | result = base_mdp.reset_root_state_uniform( 108 | env=env, 109 | env_ids=env_ids, 110 | pose_range=pose_range, 111 | velocity_range=velocity_range, 112 | asset_cfg=SceneEntityCfg(obj_name) 113 | ) 114 | results.append(result) 115 | print(f"✅ 重置物体: {obj_name}") 116 | 117 | except Exception as e: 118 | print(f"❌ 物体 {obj_name} 重置失败: {e}") 119 | 120 | return results 121 | 122 | 123 | class SimpleEventManager: 124 | def __init__(self): 125 | self._events = {} 126 | 127 | def register(self, name, event): 128 | self._events[name] = event 129 | 130 | def trigger(self, name, env): 131 | event = self._events.get(name) 132 | if event: 133 | return event.trigger(env) 134 | else: 135 | print(f"Event {name} not registered") 136 | 137 | def register_multi_object_reset(self, name, object_names, pose_ranges=None, velocity_ranges=None): 138 | """ 139 | 便捷方法:注册多物体重置事件 140 | 141 | Args: 142 | name: 事件名称 143 | object_names: 物体名称列表 144 | pose_ranges: 位置范围配置 145 | velocity_ranges: 速度范围配置 146 | """ 147 | event = BatchObjectEvent( 148 | object_names=object_names, 149 | pose_ranges=pose_ranges, 150 | velocity_ranges=velocity_ranges 151 | ) 152 | self.register(name, event) -------------------------------------------------------------------------------- /tasks/common_observations/__pycache__/camera_state.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/common_observations/__pycache__/camera_state.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/common_observations/__pycache__/dex3_state.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/common_observations/__pycache__/dex3_state.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/common_observations/__pycache__/g1_29dof_state.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/common_observations/__pycache__/g1_29dof_state.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/common_observations/__pycache__/gripper_state.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/common_observations/__pycache__/gripper_state.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/common_observations/gripper_state.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | """ 4 | gripper state 5 | """ 6 | 7 | from __future__ import annotations 8 | 9 | import torch 10 | from typing import TYPE_CHECKING 11 | import sys 12 | import os 13 | if TYPE_CHECKING: 14 | from isaaclab.envs import ManagerBasedRLEnv 15 | 16 | 17 | import torch 18 | 19 | 20 | _obs_cache = { 21 | "device": None, 22 | "batch": None, 23 | "gripper_idx_t": None, 24 | "gripper_idx_batch": None, 25 | "pos_buf": None, 26 | "vel_buf": None, 27 | "torque_buf": None, 28 | "dds_last_ms": 0, 29 | "dds_min_interval_ms": 20, 30 | } 31 | 32 | def get_robot_girl_joint_names() -> list[str]: 33 | return [ 34 | "right_hand_Joint1_1", 35 | "left_hand_Joint1_1", 36 | ] 37 | 38 | # global variable to cache the DDS instance 39 | _gripper_dds = None 40 | _dds_initialized = False 41 | 42 | def _get_gripper_dds_instance(): 43 | """get the DDS instance, delay initialization""" 44 | global _gripper_dds, _dds_initialized 45 | 46 | if not _dds_initialized or _gripper_dds is None: 47 | try: 48 | # dynamically import the DDS module 49 | sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)), 'dds')) 50 | from dds.dds_master import dds_manager 51 | 52 | _gripper_dds = dds_manager.get_object("dex1") 53 | print("[Observations] DDS communication instance obtained") 54 | 55 | # register the cleanup function 56 | import atexit 57 | def cleanup_dds(): 58 | try: 59 | if _gripper_dds: 60 | dds_manager.unregister_object("dex1") 61 | print("[gripper_state] DDS communication closed correctly") 62 | except Exception as e: 63 | print(f"[gripper_state] Error closing DDS: {e}") 64 | atexit.register(cleanup_dds) 65 | 66 | except Exception as e: 67 | print(f"[Observations] Failed to get DDS instances: {e}") 68 | _gripper_dds = None 69 | 70 | _dds_initialized = True 71 | 72 | return _gripper_dds 73 | 74 | def initialize_gripper_dds(): 75 | """explicitly initialize the DDS communication 76 | 77 | this function can be called manually to initialize the DDS communication, 78 | instead of relying on delayed initialization 79 | """ 80 | return _get_gripper_dds_instance() 81 | 82 | 83 | def get_robot_gipper_joint_states( 84 | env: ManagerBasedRLEnv, 85 | enable_dds: bool = True, 86 | ) -> torch.Tensor: 87 | """get the robot gripper joint states and publish them to DDS 88 | 89 | Args: 90 | env: ManagerBasedRLEnv - reinforcement learning environment instance 91 | enable_dds: bool - whether to enable the DDS publish function 92 | 93 | 返回: 94 | torch.Tensor 95 | """ 96 | # get the gripper joint states 97 | joint_pos = env.scene["robot"].data.joint_pos 98 | joint_vel = env.scene["robot"].data.joint_vel 99 | joint_torque = env.scene["robot"].data.applied_torque 100 | device = joint_pos.device 101 | batch = joint_pos.shape[0] 102 | 103 | 104 | global _obs_cache 105 | if _obs_cache["device"] != device or _obs_cache["gripper_idx_t"] is None: 106 | gripper_joint_indices = [31, 29] 107 | _obs_cache["gripper_idx_t"] = torch.tensor(gripper_joint_indices, dtype=torch.long, device=device) 108 | _obs_cache["device"] = device 109 | _obs_cache["batch"] = None 110 | idx_t = _obs_cache["gripper_idx_t"] 111 | n = idx_t.numel() 112 | 113 | 114 | if _obs_cache["batch"] != batch or _obs_cache["gripper_idx_batch"] is None: 115 | _obs_cache["gripper_idx_batch"] = idx_t.unsqueeze(0).expand(batch, n) 116 | _obs_cache["pos_buf"] = torch.empty(batch, n, device=device, dtype=joint_pos.dtype) 117 | _obs_cache["vel_buf"] = torch.empty(batch, n, device=device, dtype=joint_pos.dtype) 118 | _obs_cache["torque_buf"] = torch.empty(batch, n, device=device, dtype=joint_pos.dtype) 119 | _obs_cache["batch"] = batch 120 | 121 | idx_batch = _obs_cache["gripper_idx_batch"] 122 | pos_buf = _obs_cache["pos_buf"] 123 | vel_buf = _obs_cache["vel_buf"] 124 | torque_buf = _obs_cache["torque_buf"] 125 | 126 | 127 | try: 128 | torch.gather(joint_pos, 1, idx_batch, out=pos_buf) 129 | torch.gather(joint_vel, 1, idx_batch, out=vel_buf) 130 | torch.gather(joint_torque, 1, idx_batch, out=torque_buf) 131 | except TypeError: 132 | pos_buf.copy_(torch.gather(joint_pos, 1, idx_batch)) 133 | vel_buf.copy_(torch.gather(joint_vel, 1, idx_batch)) 134 | torque_buf.copy_(torch.gather(joint_torque, 1, idx_batch)) 135 | 136 | # publish to DDS (only publish the data of the first environment) 137 | if enable_dds and len(pos_buf) > 0: 138 | try: 139 | import time 140 | now_ms = int(time.time() * 1000) 141 | if now_ms - _obs_cache["dds_last_ms"] >= _obs_cache["dds_min_interval_ms"]: 142 | gripper_dds = _get_gripper_dds_instance() 143 | if gripper_dds: 144 | pos = pos_buf[0].contiguous().cpu().numpy() 145 | vel = vel_buf[0].contiguous().cpu().numpy() 146 | torque = torque_buf[0].contiguous().cpu().numpy() 147 | right_pos = pos[:1] 148 | left_pos = pos[1:] 149 | right_vel = vel[:1] 150 | left_vel = vel[1:] 151 | right_torque = torque[:1] 152 | left_torque = torque[1:] 153 | # write the gripper state to shared memory 154 | gripper_dds.write_gripper_state(left_pos, left_vel, left_torque, right_pos, right_vel, right_torque) 155 | _obs_cache["dds_last_ms"] = now_ms 156 | except Exception as e: 157 | print(f"[gripper_state] Failed to write to shared memory: {e}") 158 | 159 | return pos_buf 160 | 161 | -------------------------------------------------------------------------------- /tasks/common_observations/inspire_state.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | """ 4 | gripper state 5 | """ 6 | 7 | from __future__ import annotations 8 | 9 | import torch 10 | from typing import TYPE_CHECKING 11 | import sys 12 | import os 13 | if TYPE_CHECKING: 14 | from isaaclab.envs import ManagerBasedRLEnv 15 | 16 | 17 | import torch 18 | 19 | 20 | _obs_cache = { 21 | "device": None, 22 | "batch": None, 23 | "inspire_idx_t": None, 24 | "inspire_idx_batch": None, 25 | "pos_buf": None, 26 | "vel_buf": None, 27 | "torque_buf": None, 28 | "dds_last_ms": 0, 29 | "dds_min_interval_ms": 20, 30 | } 31 | 32 | def get_robot_girl_joint_names() -> list[str]: 33 | return [ 34 | "R_pinky_proximal_joint", 35 | "R_ring_proximal_joint", 36 | "R_middle_proximal_joint", 37 | "R_index_proximal_joint", 38 | "R_thumb_proximal_pitch_joint", 39 | "R_thumb_proximal_yaw_joint", 40 | "L_pinky_proximal_joint", 41 | "L_ring_proximal_joint", 42 | "L_middle_proximal_joint", 43 | "L_index_proximal_joint", 44 | "L_thumb_proximal_pitch_joint", 45 | "L_thumb_proximal_yaw_joint", 46 | ] 47 | 48 | # global variable to cache the DDS instance 49 | _inspire_dds = None 50 | _dds_initialized = False 51 | 52 | def _get_inspire_dds_instance(): 53 | """get the DDS instance, delay initialization""" 54 | global _inspire_dds, _dds_initialized 55 | 56 | if not _dds_initialized or _inspire_dds is None: 57 | try: 58 | # dynamically import the DDS module 59 | sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)), 'dds')) 60 | from dds.dds_master import dds_manager 61 | _inspire_dds = dds_manager.get_object("inspire") 62 | print("[Observations] DDS communication instance obtained") 63 | 64 | # register the cleanup function 65 | import atexit 66 | def cleanup_dds(): 67 | try: 68 | if _inspire_dds: 69 | dds_manager.unregister_object("inspire") 70 | print("[gripper_state] DDS communication closed correctly") 71 | except Exception as e: 72 | print(f"[gripper_state] Error closing DDS: {e}") 73 | atexit.register(cleanup_dds) 74 | 75 | except Exception as e: 76 | print(f"[Observations] Failed to get DDS instances: {e}") 77 | _inspire_dds = None 78 | 79 | _dds_initialized = True 80 | 81 | return _inspire_dds 82 | 83 | 84 | 85 | def get_robot_inspire_joint_states( 86 | env: ManagerBasedRLEnv, 87 | enable_dds: bool = True, 88 | ) -> torch.Tensor: 89 | """get the robot gripper joint states and publish them to DDS 90 | 91 | Args: 92 | env: ManagerBasedRLEnv - reinforcement learning environment instance 93 | enable_dds: bool - whether to enable the DDS publish function 94 | 95 | 返回: 96 | torch.Tensor 97 | """ 98 | # get the gripper joint states 99 | joint_pos = env.scene["robot"].data.joint_pos 100 | joint_vel = env.scene["robot"].data.joint_vel 101 | joint_torque = env.scene["robot"].data.applied_torque 102 | device = joint_pos.device 103 | batch = joint_pos.shape[0] 104 | 105 | 106 | global _obs_cache 107 | if _obs_cache["device"] != device or _obs_cache["inspire_idx_t"] is None: 108 | inspire_joint_indices = [36, 37, 35, 34, 48, 38, 31, 32, 30, 29, 43, 33] 109 | _obs_cache["inspire_idx_t"] = torch.tensor(inspire_joint_indices, dtype=torch.long, device=device) 110 | _obs_cache["device"] = device 111 | _obs_cache["batch"] = None 112 | idx_t = _obs_cache["inspire_idx_t"] 113 | n = idx_t.numel() 114 | 115 | 116 | if _obs_cache["batch"] != batch or _obs_cache["inspire_idx_batch"] is None: 117 | _obs_cache["inspire_idx_batch"] = idx_t.unsqueeze(0).expand(batch, n) 118 | _obs_cache["pos_buf"] = torch.empty(batch, n, device=device, dtype=joint_pos.dtype) 119 | _obs_cache["vel_buf"] = torch.empty(batch, n, device=device, dtype=joint_pos.dtype) 120 | _obs_cache["torque_buf"] = torch.empty(batch, n, device=device, dtype=joint_pos.dtype) 121 | _obs_cache["batch"] = batch 122 | 123 | idx_batch = _obs_cache["inspire_idx_batch"] 124 | pos_buf = _obs_cache["pos_buf"] 125 | vel_buf = _obs_cache["vel_buf"] 126 | torque_buf = _obs_cache["torque_buf"] 127 | 128 | 129 | try: 130 | torch.gather(joint_pos, 1, idx_batch, out=pos_buf) 131 | torch.gather(joint_vel, 1, idx_batch, out=vel_buf) 132 | torch.gather(joint_torque, 1, idx_batch, out=torque_buf) 133 | except TypeError: 134 | pos_buf.copy_(torch.gather(joint_pos, 1, idx_batch)) 135 | vel_buf.copy_(torch.gather(joint_vel, 1, idx_batch)) 136 | torque_buf.copy_(torch.gather(joint_torque, 1, idx_batch)) 137 | 138 | # publish to DDS (only publish the data of the first environment) 139 | if enable_dds and len(pos_buf) > 0: 140 | try: 141 | import time 142 | now_ms = int(time.time() * 1000) 143 | if now_ms - _obs_cache["dds_last_ms"] >= _obs_cache["dds_min_interval_ms"]: 144 | inspire_dds = _get_inspire_dds_instance() 145 | if inspire_dds: 146 | pos = pos_buf[0].contiguous().cpu().numpy() 147 | vel = vel_buf[0].contiguous().cpu().numpy() 148 | torque = torque_buf[0].contiguous().cpu().numpy() 149 | # write the gripper state to shared memory 150 | inspire_dds.write_inspire_state(pos, vel, torque) 151 | _obs_cache["dds_last_ms"] = now_ms 152 | except Exception as e: 153 | print(f"[gripper_state] Failed to write to shared memory: {e}") 154 | 155 | return pos_buf 156 | 157 | 158 | -------------------------------------------------------------------------------- /tasks/common_rewards/base_reward_pickplace_cylindercfg.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from __future__ import annotations 4 | 5 | import torch 6 | from typing import TYPE_CHECKING 7 | 8 | from isaaclab.assets import RigidObject 9 | from isaaclab.managers import SceneEntityCfg 10 | if TYPE_CHECKING: 11 | from isaaclab.envs import ManagerBasedRLEnv 12 | # global variable to cache the DDS instance 13 | _rewards_dds = None 14 | _dds_initialized = False 15 | import sys 16 | import os 17 | def _get_rewards_dds_instance(): 18 | """get the DDS instance, delay initialization""" 19 | global _rewards_dds, _dds_initialized 20 | 21 | if not _dds_initialized or _rewards_dds is None: 22 | try: 23 | # dynamically import the DDS module 24 | sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)), 'dds')) 25 | from dds.dds_master import dds_manager 26 | 27 | _rewards_dds = dds_manager.get_object("rewards") 28 | print("[Observations Rewards] DDS communication instance obtained") 29 | 30 | # register the cleanup function 31 | import atexit 32 | def cleanup_dds(): 33 | try: 34 | if _rewards_dds: 35 | dds_manager.unregister_object("rewards") 36 | print("[rewards_dds] DDS communication closed correctly") 37 | except Exception as e: 38 | print(f"[rewards_dds] Error closing DDS: {e}") 39 | atexit.register(cleanup_dds) 40 | 41 | except Exception as e: 42 | print(f"[Observations Rewards] Failed to get DDS instances: {e}") 43 | _rewards_dds = None 44 | 45 | _dds_initialized = True 46 | 47 | return _rewards_dds 48 | def compute_reward( 49 | env: ManagerBasedRLEnv, 50 | object_cfg: SceneEntityCfg = SceneEntityCfg("object"), 51 | min_x: float = -0.42, # minimum x position threshold 52 | max_x: float = 1.0, # maximum x position threshold 53 | min_y: float = 0.2, # minimum y position threshold 54 | max_y: float = 0.7, # maximum y position threshold 55 | min_height: float = 0.5, 56 | post_min_x: float = 0.28, 57 | post_max_x: float = 0.96, 58 | post_min_y: float = 0.24, 59 | post_max_y: float = 0.57, 60 | post_min_height: float = 0.81, 61 | post_max_height: float = 0.9, 62 | ) -> torch.Tensor: 63 | # when the object is not in the set return, reset 64 | 65 | interval = getattr(env, "_reward_interval", 1) or 1 66 | counter = getattr(env, "_reward_counter", 0) 67 | last = getattr(env, "_reward_last", None) 68 | if interval > 1 and last is not None and counter % interval != 0: 69 | env._reward_counter = counter + 1 70 | return last 71 | 72 | # 1. get object entity from the scene 73 | object: RigidObject = env.scene[object_cfg.name] 74 | 75 | # 2. get object position 76 | wheel_x = object.data.root_pos_w[:, 0] # x position 77 | wheel_y = object.data.root_pos_w[:, 1] # y position 78 | wheel_height = object.data.root_pos_w[:, 2] # z position (height) 79 | 80 | # element-wise operations 81 | done_x = (wheel_x < max_x) & (wheel_x > min_x) 82 | done_y = (wheel_y < max_y) & (wheel_y > min_y) 83 | done_height = (wheel_height > min_height) 84 | done = done_x & done_y & done_height 85 | 86 | # 3. get post position conditions 87 | done_post_x = (wheel_x < post_max_x) & (wheel_x > post_min_x) 88 | done_post_y = (wheel_y < post_max_y) & (wheel_y > post_min_y) 89 | done_post_height = (wheel_height > post_min_height) & (wheel_height < post_max_height) 90 | done_post = done_post_x & done_post_y & done_post_height 91 | 92 | # Create reward tensor for all environments 93 | reward = torch.zeros(env.num_envs, device=env.device, dtype=torch.float) 94 | 95 | # Set rewards based on conditions 96 | reward[~done] = -1.0 # Not in valid area 97 | reward[done_post] = 1.0 # In target post area 98 | reward[done & ~done_post] = 0.0 # In valid area but not target 99 | 100 | rewards_dds = _get_rewards_dds_instance() 101 | if rewards_dds: 102 | rewards_dds.write_rewards_data(reward) 103 | env._reward_last = reward 104 | env._reward_counter = counter + 1 105 | return reward 106 | -------------------------------------------------------------------------------- /tasks/common_rewards/base_reward_pickplace_redblock.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from __future__ import annotations 4 | 5 | import torch 6 | from typing import TYPE_CHECKING 7 | import sys 8 | import os 9 | from isaaclab.assets import RigidObject 10 | from isaaclab.managers import SceneEntityCfg 11 | if TYPE_CHECKING: 12 | from isaaclab.envs import ManagerBasedRLEnv 13 | # global variable to cache the DDS instance 14 | _rewards_dds = None 15 | _dds_initialized = False 16 | import sys 17 | import os 18 | def _get_rewards_dds_instance(): 19 | """get the DDS instance, delay initialization""" 20 | global _rewards_dds, _dds_initialized 21 | 22 | if not _dds_initialized or _rewards_dds is None: 23 | try: 24 | # dynamically import the DDS module 25 | sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)), 'dds')) 26 | from dds.dds_master import dds_manager 27 | 28 | _rewards_dds = dds_manager.get_object("rewards") 29 | print("[Observations Rewards] DDS communication instance obtained") 30 | 31 | # register the cleanup function 32 | import atexit 33 | def cleanup_dds(): 34 | try: 35 | if _rewards_dds: 36 | dds_manager.unregister_object("rewards") 37 | print("[rewards_dds] DDS communication closed correctly") 38 | except Exception as e: 39 | print(f"[rewards_dds] Error closing DDS: {e}") 40 | atexit.register(cleanup_dds) 41 | 42 | except Exception as e: 43 | print(f"[Observations Rewards] Failed to get DDS instances: {e}") 44 | _rewards_dds = None 45 | 46 | _dds_initialized = True 47 | 48 | return _rewards_dds 49 | def compute_reward( 50 | env: ManagerBasedRLEnv, 51 | object_cfg: SceneEntityCfg = SceneEntityCfg("object"), 52 | min_x: float = -5.4, # minimum x position threshold 53 | max_x: float = -2.9, # maximum x position threshold 54 | min_y: float = -5.05, # minimum y position threshold 55 | max_y: float = -2.8, # maximum y position threshold 56 | post_min_x: float = -4.2125, 57 | post_max_x: float = -4.1755, 58 | post_min_y: float = -3.9606, 59 | post_max_y: float = -3.9121, 60 | min_height: float = 0.5, 61 | post_min_height: float = 0.82, 62 | post_max_height: float = 0.825, 63 | ) -> torch.Tensor: 64 | # when the object is not in the set return, reset 65 | interval = getattr(env, "_reward_interval", 1) or 1 66 | counter = getattr(env, "_reward_counter", 0) 67 | last = getattr(env, "_reward_last", None) 68 | if interval > 1 and last is not None and counter % interval != 0: 69 | env._reward_counter = counter + 1 70 | return last 71 | 72 | # 1. get object entity from the scene 73 | object: RigidObject = env.scene[object_cfg.name] 74 | 75 | # 2. get object position 76 | wheel_x = object.data.root_pos_w[:, 0] # x position 77 | wheel_y = object.data.root_pos_w[:, 1] # y position 78 | wheel_height = object.data.root_pos_w[:, 2] # z position (height) 79 | 80 | # element-wise operations 81 | done_x = (wheel_x < max_x) & (wheel_x > min_x) 82 | done_y = (wheel_y < max_y) & (wheel_y > min_y) 83 | done_height = (wheel_height > min_height) 84 | done = done_x & done_y & done_height 85 | 86 | # 3. get post position conditions 87 | done_post_x = (wheel_x < post_max_x) & (wheel_x > post_min_x) 88 | done_post_y = (wheel_y < post_max_y) & (wheel_y > post_min_y) 89 | done_post_height = (wheel_height > post_min_height) & (wheel_height < post_max_height) 90 | done_post = done_post_x & done_post_y & done_post_height 91 | 92 | # Create reward tensor for all environments 93 | reward = torch.zeros(env.num_envs, device=env.device, dtype=torch.float) 94 | 95 | # Set rewards based on conditions 96 | reward[~done] = -1.0 # Not in valid area 97 | reward[done_post] = 1.0 # In target post area 98 | reward[done & ~done_post] = 0.0 # In valid area but not target 99 | 100 | env._reward_last = reward 101 | env._reward_counter = counter + 1 102 | rewards_dds = _get_rewards_dds_instance() 103 | if rewards_dds: 104 | rewards_dds.write_rewards_data(reward) 105 | return reward 106 | -------------------------------------------------------------------------------- /tasks/common_scene/__pycache__/base_scene_pickplace_cylindercfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/common_scene/__pycache__/base_scene_pickplace_cylindercfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/common_scene/__pycache__/base_scene_pickplace_cylindercfg_1.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/common_scene/__pycache__/base_scene_pickplace_cylindercfg_1.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/common_scene/__pycache__/base_scene_pickplace_cylindercfg_2.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/common_scene/__pycache__/base_scene_pickplace_cylindercfg_2.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/common_scene/__pycache__/base_scene_pickplace_readblock.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/common_scene/__pycache__/base_scene_pickplace_readblock.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/common_scene/__pycache__/base_scene_pickplace_redblock.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/common_scene/__pycache__/base_scene_pickplace_redblock.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/common_scene/__pycache__/base_scene_stack_rgyblock.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/common_scene/__pycache__/base_scene_stack_rgyblock.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/common_scene/base_scene_pickplace_cylindercfg_wholebody.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | """ 4 | public base scene configuration module 5 | provides reusable scene element configurations, such as tables, objects, ground, lights, etc. 6 | """ 7 | import isaaclab.sim as sim_utils 8 | from isaaclab.assets import AssetBaseCfg, RigidObjectCfg 9 | from isaaclab.scene import InteractiveSceneCfg 10 | from isaaclab.sim.spawners.from_files.from_files_cfg import GroundPlaneCfg, UsdFileCfg 11 | from isaaclab.utils import configclass 12 | from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR 13 | from tasks.common_config import CameraBaseCfg # isort: skip 14 | import os 15 | project_root = os.environ.get("PROJECT_ROOT") 16 | @configclass 17 | class TableCylinderSceneCfgWH(InteractiveSceneCfg): # inherit from the interactive scene configuration class 18 | """object table scene configuration class 19 | defines a complete scene containing robot, object, table, etc. 20 | """ 21 | # 1. room wall configuration - simplified configuration to avoid rigid body property conflicts 22 | room_walls = AssetBaseCfg( 23 | prim_path="/World/envs/env_.*/Room", 24 | init_state=AssetBaseCfg.InitialStateCfg( 25 | pos=[0.0, 0.0, 0], # room center point 26 | rot=[1.0, 0.0, 0.0, 0.0] 27 | ), 28 | spawn=UsdFileCfg( 29 | usd_path=f"{project_root}/assets/objects/small_warehouse/small_warehouse_digital_twin.usd", 30 | ), 31 | ) 32 | 33 | 34 | # 1. table configuration 35 | packing_table1 = AssetBaseCfg( 36 | prim_path="/World/envs/env_.*/PackingTable_1", # table in the scene 37 | init_state=AssetBaseCfg.InitialStateCfg(pos=[-2.35644,-3.45572,-0.2], # initial position [x, y, z] 38 | rot=[0.70091, 0.0, 0.0, 0.71325]), # initial rotation [x, y, z, w] 39 | spawn=UsdFileCfg( 40 | usd_path=f"{project_root}/assets/objects/PackingTable_2/PackingTable.usd", # table model file 41 | rigid_props=sim_utils.RigidBodyPropertiesCfg(kinematic_enabled=True), # set to kinematic object 42 | ), 43 | ) 44 | 45 | packing_table2 = AssetBaseCfg( 46 | prim_path="/World/envs/env_.*/PackingTable_2", # table in the scene 47 | init_state=AssetBaseCfg.InitialStateCfg(pos=[-3.97225,-4.3424,-0.2], # initial position [x, y, z] 48 | rot=[1.0, 0.0, 0.0, 0.0]), # initial rotation [x, y, z, w] 49 | spawn=UsdFileCfg( 50 | usd_path=f"{project_root}/assets/objects/PackingTable/PackingTable.usd", # table model file 51 | rigid_props=sim_utils.RigidBodyPropertiesCfg(kinematic_enabled=True), # set to kinematic object 52 | ), 53 | ) 54 | # # Object 55 | # 2. object configuration (cylinder) 56 | object = RigidObjectCfg( 57 | prim_path="/World/envs/env_.*/Object", # object in the scene 58 | init_state=RigidObjectCfg.InitialStateCfg(pos=[-2.58514,-2.78975,0.84], # initial position (pos) 59 | rot=[1, 0, 0, 0]), # initial rotation (rot) 60 | spawn=sim_utils.CylinderCfg( 61 | radius=0.018, # cylinder radius (radius) 62 | height=0.35, # cylinder height (height) 63 | 64 | rigid_props=sim_utils.RigidBodyPropertiesCfg( 65 | ), # rigid body properties configuration (rigid_props) 66 | mass_props=sim_utils.MassPropertiesCfg(mass=0.4), # mass properties configuration (mass) 67 | collision_props=sim_utils.CollisionPropertiesCfg(), # collision properties configuration (collision_props) 68 | visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(0.15, 0.15, 0.15), metallic=1.0), # visual material configuration (visual_material) 69 | physics_material=sim_utils.RigidBodyMaterialCfg( 70 | friction_combine_mode="max", # friction combine mode 71 | restitution_combine_mode="min", # restitution combine mode 72 | static_friction=1.5, # static friction coefficient 73 | dynamic_friction=1.5, # dynamic friction coefficient 74 | restitution=0.0, # restitution coefficient (no restitution) 75 | ), 76 | ), 77 | ) 78 | # Ground plane 79 | 80 | 81 | # Lights 82 | # 4. light configuration 83 | light = AssetBaseCfg( 84 | prim_path="/World/light", # light in the scene 85 | spawn=sim_utils.DomeLightCfg(color=(0.75, 0.75, 0.75), # light color (white) 86 | intensity=3000.0), # light intensity 87 | ) 88 | world_camera = CameraBaseCfg.get_camera_config(prim_path="/World/PerspectiveCamera", 89 | pos_offset=(-1.9, -5.0, 1.8), 90 | rot_offset=( -0.40614,0.78544, 0.4277, -0.16986)) -------------------------------------------------------------------------------- /tasks/common_scene/base_scene_pickplace_redblock.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | """ 4 | public base scene configuration module 5 | provides reusable scene element configurations, such as tables, objects, ground, lights, etc. 6 | """ 7 | import isaaclab.sim as sim_utils 8 | from isaaclab.assets import AssetBaseCfg, RigidObjectCfg 9 | from isaaclab.scene import InteractiveSceneCfg 10 | from isaaclab.sim.spawners.from_files.from_files_cfg import GroundPlaneCfg, UsdFileCfg 11 | from isaaclab.utils import configclass 12 | from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR 13 | from tasks.common_config import CameraBaseCfg # isort: skip 14 | import os 15 | project_root = os.environ.get("PROJECT_ROOT") 16 | @configclass 17 | class TableRedBlockSceneCfg(InteractiveSceneCfg): # inherit from the interactive scene configuration class 18 | """object table scene configuration class 19 | defines a complete scene containing robot, object, table, etc. 20 | """ 21 | # 1. room wall configuration - simplified configuration to avoid rigid body property conflicts 22 | room_walls = AssetBaseCfg( 23 | prim_path="/World/envs/env_.*/Room", 24 | init_state=AssetBaseCfg.InitialStateCfg( 25 | pos=[0.0, 0.0, 0], # room center point 26 | rot=[1.0, 0.0, 0.0, 0.0] 27 | ), 28 | spawn=UsdFileCfg( 29 | usd_path=f"{project_root}/assets/objects/small_warehouse_digital_twin/small_warehouse_digital_twin.usd", 30 | ), 31 | ) 32 | 33 | 34 | # 1. table configuration 35 | packing_table = AssetBaseCfg( 36 | prim_path="/World/envs/env_.*/PackingTable", # table in the scene 37 | init_state=AssetBaseCfg.InitialStateCfg(pos=[-4.3,-4.2,-0.2], # initial position [x, y, z] 38 | rot=[1.0, 0.0, 0.0, 0.0]), # initial rotation [x, y, z, w] 39 | spawn=UsdFileCfg( 40 | usd_path=f"{project_root}/assets/objects/table_with_yellowbox.usd", # table model file 41 | # rigid_props=sim_utils.RigidBodyPropertiesCfg(kinematic_enabled=True), # set to kinematic object 42 | ), 43 | ) 44 | # Object 45 | # 2. object configuration 46 | object = RigidObjectCfg( 47 | prim_path="/World/envs/env_.*/Object", 48 | init_state=RigidObjectCfg.InitialStateCfg( 49 | pos=[-4.25, -4.03, 0.84], 50 | rot=[1, 0, 0, 0] 51 | ), 52 | spawn=sim_utils.CuboidCfg( 53 | size=(0.06, 0.06, 0.06), 54 | rigid_props=sim_utils.RigidBodyPropertiesCfg( 55 | disable_gravity=False, 56 | retain_accelerations=False 57 | ), 58 | mass_props=sim_utils.MassPropertiesCfg(mass=1.0), 59 | collision_props=sim_utils.CollisionPropertiesCfg( 60 | collision_enabled=True, 61 | contact_offset=0.01, 62 | rest_offset=0.0 63 | ), 64 | visual_material=sim_utils.PreviewSurfaceCfg( 65 | diffuse_color=(1.0, 0.0, 0.0), metallic=0 66 | ), 67 | physics_material=sim_utils.RigidBodyMaterialCfg( 68 | friction_combine_mode="max", 69 | restitution_combine_mode="min", 70 | static_friction=10, 71 | dynamic_friction=1.5, 72 | restitution=0.01, 73 | ), 74 | ), 75 | ) 76 | 77 | 78 | # Ground plane 79 | # 3. ground configuration 80 | # ground = AssetBaseCfg( 81 | # prim_path="/World/GroundPlane", # ground in the scene 82 | # spawn=GroundPlaneCfg( ), # ground configuration 83 | # ) 84 | 85 | # Lights 86 | # 4. light configuration 87 | # light = AssetBaseCfg( 88 | # prim_path="/World/light", # light in the scene 89 | # spawn=sim_utils.DomeLightCfg(color=(0.75, 0.75, 0.75), # light color (white) 90 | # intensity=3000.0), # light intensity 91 | # ) 92 | 93 | 94 | 95 | world_camera = CameraBaseCfg.get_camera_config(prim_path="/World/PerspectiveCamera", 96 | pos_offset=(-4.1, -4.9, 1.8), 97 | rot_offset=( -0.3173,0.94833, 0.0, 0.0)) 98 | 99 | 100 | -------------------------------------------------------------------------------- /tasks/common_termination/__pycache__/base_termination_pick_place_cylinder.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/common_termination/__pycache__/base_termination_pick_place_cylinder.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/common_termination/__pycache__/base_termination_pick_place_readblock.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/common_termination/__pycache__/base_termination_pick_place_readblock.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/common_termination/__pycache__/base_termination_pick_place_redblock.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/common_termination/__pycache__/base_termination_pick_place_redblock.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/common_termination/__pycache__/base_termination_stack_rgyblock.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/common_termination/__pycache__/base_termination_stack_rgyblock.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/common_termination/base_termination_pick_place_cylinder.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from __future__ import annotations 4 | 5 | import torch 6 | from typing import TYPE_CHECKING 7 | 8 | from isaaclab.assets import RigidObject 9 | from isaaclab.managers import SceneEntityCfg 10 | 11 | if TYPE_CHECKING: 12 | from isaaclab.envs import ManagerBasedRLEnv 13 | 14 | 15 | def reset_object_estimate( 16 | env: ManagerBasedRLEnv, 17 | object_cfg: SceneEntityCfg = SceneEntityCfg("object"), 18 | min_x: float = -0.42, # minimum x position threshold 19 | max_x: float = 1.0, # maximum x position threshold 20 | min_y: float = 0.2, # minimum y position threshold 21 | max_y: float = 0.7, # maximum y position threshold 22 | min_height: float = 0.5, 23 | ) -> torch.Tensor: 24 | # when the object is not in the set return, reset 25 | # Get object entity from the scene 26 | # 1. get object entity from the scene 27 | object: RigidObject = env.scene[object_cfg.name] 28 | 29 | # Extract wheel position relative to environment origin 30 | # 2. get object position 31 | wheel_x = object.data.root_pos_w[:, 0] # x position 32 | wheel_y = object.data.root_pos_w[:, 1] # y position 33 | wheel_height = object.data.root_pos_w[:, 2] # z position (height) 34 | done_x = (wheel_x < max_x) and (wheel_x > min_x) 35 | done_y = (wheel_y < max_y) and (wheel_y > min_y) 36 | done_height = (wheel_height > min_height) 37 | done = done_x and done_y and done_height 38 | 39 | 40 | return not done 41 | -------------------------------------------------------------------------------- /tasks/common_termination/base_termination_pick_place_redblock.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from __future__ import annotations 4 | 5 | import torch 6 | from typing import TYPE_CHECKING 7 | 8 | from isaaclab.assets import RigidObject 9 | from isaaclab.managers import SceneEntityCfg 10 | 11 | if TYPE_CHECKING: 12 | from isaaclab.envs import ManagerBasedRLEnv 13 | 14 | 15 | def reset_object_estimate( 16 | env: ManagerBasedRLEnv, 17 | object_cfg: SceneEntityCfg = SceneEntityCfg("object"), 18 | min_x: float = -5.4, # minimum x position threshold 19 | max_x: float = -2.9, # maximum x position threshold 20 | min_y: float = -5.05, # minimum y position threshold 21 | max_y: float = -2.8, # maximum y position threshold 22 | min_height: float = 0.5, 23 | ) -> torch.Tensor: 24 | # when the object is not in the set return, reset 25 | # Get object entity from the scene 26 | # 1. get object entity from the scene 27 | object: RigidObject = env.scene[object_cfg.name] 28 | 29 | # Extract wheel position relative to environment origin 30 | # 2. get object position 31 | wheel_x = object.data.root_pos_w[:, 0] # x position 32 | wheel_y = object.data.root_pos_w[:, 1] # y position 33 | wheel_height = object.data.root_pos_w[:, 2] # z position (height) 34 | done_x = (wheel_x < max_x) and (wheel_x > min_x) 35 | done_y = (wheel_y < max_y) and (wheel_y > min_y) 36 | done_height = (wheel_height > min_height) 37 | done = done_x and done_y and done_height 38 | return not done 39 | -------------------------------------------------------------------------------- /tasks/common_termination/base_termination_pick_redblock_into_drawer.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from __future__ import annotations 4 | 5 | import torch 6 | from typing import TYPE_CHECKING 7 | 8 | from isaaclab.assets import RigidObject 9 | from isaaclab.managers import SceneEntityCfg 10 | 11 | if TYPE_CHECKING: 12 | from isaaclab.envs import ManagerBasedRLEnv 13 | 14 | 15 | def reset_object_estimate( 16 | env: ManagerBasedRLEnv, 17 | object_cfg: SceneEntityCfg = SceneEntityCfg("object"), 18 | min_x: float = -2.7, # minimum x position threshold 19 | max_x: float = -2.2, # maximum x position threshold 20 | min_y: float = -4.15, # minimum y position threshold 21 | max_y: float = -3.55, # maximum y position threshold 22 | min_height: float = 0.2, 23 | ) -> torch.Tensor: 24 | # when the object is not in the set return, reset 25 | # Get object entity from the scene 26 | # 1. get object entity from the scene 27 | object: RigidObject = env.scene[object_cfg.name] 28 | 29 | # Extract wheel position relative to environment origin 30 | # 2. get object position 31 | wheel_x = object.data.root_pos_w[:, 0] # x position 32 | wheel_y = object.data.root_pos_w[:, 1] # y position 33 | wheel_height = object.data.root_pos_w[:, 2] # z position (height) 34 | done_x = (wheel_x < max_x) and (wheel_x > min_x) 35 | done_y = (wheel_y < max_y) and (wheel_y > min_y) 36 | done_height = (wheel_height > min_height) 37 | done = done_x and done_y and done_height 38 | # print(f"done_x: {done_x}, done_y: {done_y}, done_height: {done_height}, done: {done}") 39 | # print(f"wheel_x: {wheel_x}, wheel_y: {wheel_y}, wheel_height: {wheel_height}") 40 | return not done 41 | -------------------------------------------------------------------------------- /tasks/common_termination/base_termination_stack_rgyblock.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from __future__ import annotations 4 | 5 | import torch 6 | from typing import TYPE_CHECKING 7 | 8 | from isaaclab.assets import RigidObject 9 | from isaaclab.managers import SceneEntityCfg 10 | 11 | if TYPE_CHECKING: 12 | from isaaclab.envs import ManagerBasedRLEnv 13 | 14 | 15 | def reset_object_estimate( 16 | env: ManagerBasedRLEnv, 17 | red_block_cfg: SceneEntityCfg = SceneEntityCfg("red_block"), 18 | yellow_block_cfg: SceneEntityCfg = SceneEntityCfg("yellow_block"), 19 | green_block_cfg: SceneEntityCfg = SceneEntityCfg("green_block"), 20 | min_x: float = -5.4, # minimum x position threshold 21 | max_x: float = -2.9, # maximum x position threshold 22 | min_y: float = -5.05, # minimum y position threshold 23 | max_y: float = -2.8, # maximum y position threshold 24 | min_height: float = 0.5, 25 | ) -> torch.Tensor: 26 | # when the object is not in the set return, reset 27 | # Get object entity from the scene 28 | # 1. get object entity from the scene 29 | red_block: RigidObject = env.scene[red_block_cfg.name] 30 | yellow_block: RigidObject = env.scene[yellow_block_cfg.name] 31 | green_block: RigidObject = env.scene[green_block_cfg.name] 32 | 33 | # Extract wheel position relative to environment origin 34 | # 2. get object position 35 | red_block_x = red_block.data.root_pos_w[:, 0] # x position 36 | red_block_y = red_block.data.root_pos_w[:, 1] # y position 37 | red_block_height = red_block.data.root_pos_w[:, 2] # z position (height) 38 | 39 | yellow_block_x = yellow_block.data.root_pos_w[:, 0] # x position 40 | yellow_block_y = yellow_block.data.root_pos_w[:, 1] # y position 41 | yellow_block_height = yellow_block.data.root_pos_w[:, 2] # z position (height) 42 | 43 | green_block_x = green_block.data.root_pos_w[:, 0] # x position 44 | green_block_y = green_block.data.root_pos_w[:, 1] # y position 45 | green_block_height = green_block.data.root_pos_w[:, 2] # z position (height) 46 | 47 | red_done_x = (red_block_x < max_x) and (red_block_x > min_x) 48 | red_done_y = (red_block_y < max_y) and (red_block_y > min_y) 49 | red_done_height = (red_block_height > min_height) 50 | red_done = red_done_x and red_done_y and red_done_height 51 | 52 | yellow_done_x = (yellow_block_x < max_x) and (yellow_block_x > min_x) 53 | yellow_done_y = (yellow_block_y < max_y) and (yellow_block_y > min_y) 54 | yellow_done_height = (yellow_block_height > min_height) 55 | yellow_done = yellow_done_x and yellow_done_y and yellow_done_height 56 | 57 | green_done_x = (green_block_x < max_x) and (green_block_x > min_x) 58 | green_done_y = (green_block_y < max_y) and (green_block_y > min_y) 59 | green_done_height = (green_block_height > min_height) 60 | green_done = green_done_x and green_done_y and green_done_height 61 | 62 | done = not (red_done and yellow_done and green_done) 63 | 64 | return done 65 | -------------------------------------------------------------------------------- /tasks/config/extension.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | 3 | # Note: Semantic Versioning is used: https://semver.org/ 4 | version = "0.10.31" 5 | 6 | # Description 7 | title = "Isaac Lab Environments" 8 | description="Extension containing suite of environments for robot learning." 9 | readme = "docs/README.md" 10 | repository = "https://github.com/isaac-sim/IsaacLab" 11 | category = "robotics" 12 | keywords = ["robotics", "rl", "il", "learning"] 13 | 14 | [dependencies] 15 | "isaaclab" = {} 16 | "isaaclab_assets" = {} 17 | 18 | [core] 19 | reloadable = false 20 | 21 | [[python.module]] 22 | name = "isaaclab_tasks" 23 | -------------------------------------------------------------------------------- /tasks/g1_tasks/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | """Unitree G1 robot task module 5 | contains various task implementations for the G1 robot, such as pick and place, motion control, etc. 6 | """ 7 | 8 | # use relative import 9 | from . import pick_place_cylinder_g1_29dof_dex3 10 | from . import pick_place_cylinder_g1_29dof_dex1 11 | from . import pick_place_cylinder_g1_29dof_inspire 12 | 13 | from . import pick_place_redblock_g1_29dof_dex1 14 | from . import pick_place_redblock_g1_29dof_dex3 15 | from . import stack_rgyblock_g1_29dof_dex1 16 | from . import stack_rgyblock_g1_29dof_dex3 17 | from . import stack_rgyblock_g1_29dof_inspire 18 | from . import pick_redblock_into_drawer_g1_29dof_dex1 19 | from . import pick_redblock_into_drawer_g1_29dof_dex3 20 | from . import pick_place_redblock_g1_29dof_inspire 21 | from . import move_cylinder_g1_29dof_dex1_wholebody 22 | from . import move_cylinder_g1_29dof_dex3_wholebody 23 | from . import move_cylinder_g1_29dof_inspire_wholebody 24 | 25 | # export all modules 26 | __all__ = [ 27 | "pick_place_cylinder_g1_29dof_dex3", "pick_place_cylinder_g1_29dof_dex1", 28 | "pick_place_redblock_g1_29dof_dex1", "pick_place_redblock_g1_29dof_dex3", 29 | "stack_rgyblock_g1_29dof_dex1", "stack_rgyblock_g1_29dof_dex3", 30 | "stack_rgyblock_g1_29dof_inspire", 31 | "pick_redblock_into_drawer_g1_29dof_dex1","pick_redblock_into_drawer_g1_29dof_dex3", 32 | "pick_place_redblock_g1_29dof_inspire", 33 | "pick_place_cylinder_g1_29dof_inspire", 34 | "move_cylinder_g1_29dof_dex1_wholebody", 35 | "move_cylinder_g1_29dof_dex3_wholebody", 36 | "move_cylinder_g1_29dof_inspire_wholebody" 37 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/__pycache__/pickplace_g1_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/__pycache__/pickplace_g1_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/move_cylinder_g1_29dof_dex1_wholebody/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | import gymnasium as gym 6 | 7 | from . import move_cylinder_g1_29dof_dex1_hw_env_cfg 8 | 9 | 10 | gym.register( 11 | id="Isaac-Move-Cylinder-G129-Dex1-Wholebody", 12 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 13 | kwargs={ 14 | "env_cfg_entry_point": move_cylinder_g1_29dof_dex1_hw_env_cfg.MoveCylinderG129Dex1WholebodyEnvCfg, 15 | }, 16 | disable_env_checker=True, 17 | ) 18 | 19 | -------------------------------------------------------------------------------- /tasks/g1_tasks/move_cylinder_g1_29dof_dex1_wholebody/mdp/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | """This sub-module contains the functions that are specific to the pick place environments.""" 6 | 7 | from isaaclab.envs.mdp import * 8 | 9 | from .observations import * 10 | from .terminations import * 11 | from .rewards import * 12 | 13 | -------------------------------------------------------------------------------- /tasks/g1_tasks/move_cylinder_g1_29dof_dex1_wholebody/mdp/observations.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | from tasks.common_observations.g1_29dof_state import get_robot_boy_joint_states 5 | from tasks.common_observations.gripper_state import get_robot_gipper_joint_states 6 | from tasks.common_observations.camera_state import get_camera_image 7 | 8 | # ensure functions can be accessed by external modules 9 | __all__ = [ 10 | "get_robot_boy_joint_states", 11 | "get_robot_gipper_joint_states", 12 | "get_camera_image" 13 | ] 14 | 15 | -------------------------------------------------------------------------------- /tasks/g1_tasks/move_cylinder_g1_29dof_dex1_wholebody/mdp/rewards.py: -------------------------------------------------------------------------------- 1 | from tasks.common_rewards.base_reward_pickplace_cylindercfg import compute_reward 2 | 3 | __all__ = [ 4 | "compute_reward" 5 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/move_cylinder_g1_29dof_dex1_wholebody/mdp/terminations.py: -------------------------------------------------------------------------------- 1 | from tasks.common_termination.base_termination_pick_place_cylinder import reset_object_estimate 2 | __all__ = [ 3 | "reset_object_estimate" 4 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/move_cylinder_g1_29dof_dex3_wholebody/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | import gymnasium as gym 6 | 7 | from . import move_cylinder_g1_29dof_dex3_hw_env_cfg 8 | 9 | 10 | gym.register( 11 | id="Isaac-Move-Cylinder-G129-Dex3-Wholebody", 12 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 13 | kwargs={ 14 | "env_cfg_entry_point": move_cylinder_g1_29dof_dex3_hw_env_cfg.MoveCylinderG129Dex3WholebodyEnvCfg, 15 | }, 16 | disable_env_checker=True, 17 | ) 18 | 19 | -------------------------------------------------------------------------------- /tasks/g1_tasks/move_cylinder_g1_29dof_dex3_wholebody/mdp/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | """This sub-module contains the functions that are specific to the pick place environments.""" 6 | 7 | from isaaclab.envs.mdp import * 8 | 9 | from .observations import * 10 | from .terminations import * 11 | from .rewards import * 12 | 13 | -------------------------------------------------------------------------------- /tasks/g1_tasks/move_cylinder_g1_29dof_dex3_wholebody/mdp/observations.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | from tasks.common_observations.g1_29dof_state import get_robot_boy_joint_states 5 | from tasks.common_observations.dex3_state import get_robot_dex3_joint_states 6 | from tasks.common_observations.camera_state import get_camera_image 7 | 8 | # ensure functions can be accessed by external modules 9 | __all__ = [ 10 | "get_robot_boy_joint_states", 11 | "get_robot_dex3_joint_states", 12 | "get_camera_image" 13 | ] 14 | 15 | -------------------------------------------------------------------------------- /tasks/g1_tasks/move_cylinder_g1_29dof_dex3_wholebody/mdp/rewards.py: -------------------------------------------------------------------------------- 1 | from tasks.common_rewards.base_reward_pickplace_cylindercfg import compute_reward 2 | 3 | __all__ = [ 4 | "compute_reward" 5 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/move_cylinder_g1_29dof_dex3_wholebody/mdp/terminations.py: -------------------------------------------------------------------------------- 1 | from tasks.common_termination.base_termination_pick_place_cylinder import reset_object_estimate 2 | __all__ = [ 3 | "reset_object_estimate" 4 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/move_cylinder_g1_29dof_inspire_wholebody/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | import gymnasium as gym 6 | 7 | from . import move_cylinder_g1_29dof_inspire_hw_env_cfg 8 | 9 | 10 | gym.register( 11 | id="Isaac-Move-Cylinder-G129-Inspire-Wholebody", 12 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 13 | kwargs={ 14 | "env_cfg_entry_point": move_cylinder_g1_29dof_inspire_hw_env_cfg.MoveCylinderG129InspireWholebodyEnvCfg, 15 | }, 16 | disable_env_checker=True, 17 | ) 18 | 19 | -------------------------------------------------------------------------------- /tasks/g1_tasks/move_cylinder_g1_29dof_inspire_wholebody/mdp/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | """This sub-module contains the functions that are specific to the pick place environments.""" 6 | 7 | from isaaclab.envs.mdp import * 8 | 9 | from .observations import * 10 | from .terminations import * 11 | from .rewards import * 12 | -------------------------------------------------------------------------------- /tasks/g1_tasks/move_cylinder_g1_29dof_inspire_wholebody/mdp/observations.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | from tasks.common_observations.g1_29dof_state import get_robot_boy_joint_states 5 | from tasks.common_observations.inspire_state import get_robot_inspire_joint_states 6 | from tasks.common_observations.camera_state import get_camera_image 7 | 8 | # ensure functions can be accessed by external modules 9 | __all__ = [ 10 | "get_robot_boy_joint_states", 11 | "get_robot_inspire_joint_states", 12 | "get_camera_image" 13 | ] 14 | 15 | -------------------------------------------------------------------------------- /tasks/g1_tasks/move_cylinder_g1_29dof_inspire_wholebody/mdp/rewards.py: -------------------------------------------------------------------------------- 1 | from tasks.common_rewards.base_reward_pickplace_cylindercfg import compute_reward 2 | 3 | __all__ = [ 4 | "compute_reward" 5 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/move_cylinder_g1_29dof_inspire_wholebody/mdp/terminations.py: -------------------------------------------------------------------------------- 1 | from tasks.common_termination.base_termination_pick_place_cylinder import reset_object_estimate 2 | __all__ = [ 3 | "reset_object_estimate" 4 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | import gymnasium as gym 6 | 7 | from . import pickplace_cylinder_g1_29dof_dex1_joint_env_cfg 8 | 9 | 10 | gym.register( 11 | id="Isaac-PickPlace-Cylinder-G129-Dex1-Joint", 12 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 13 | kwargs={ 14 | "env_cfg_entry_point": pickplace_cylinder_g1_29dof_dex1_joint_env_cfg.PickPlaceG129DEX1BaseFixEnvCfg, 15 | }, 16 | disable_env_checker=True, 17 | ) 18 | 19 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/__pycache__/pickplace_cylinder_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/__pycache__/pickplace_cylinder_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/__pycache__/pickplace_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/__pycache__/pickplace_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/__pycache__/pickplace_g1_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/__pycache__/pickplace_g1_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/__pycache__/pickplace_g1_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/__pycache__/pickplace_g1_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/mdp/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | """This sub-module contains the functions that are specific to the pick place environments.""" 6 | 7 | from isaaclab.envs.mdp import * 8 | 9 | from .observations import * 10 | from .terminations import * 11 | from .rewards import * 12 | 13 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/mdp/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/mdp/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/mdp/__pycache__/events.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/mdp/__pycache__/events.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/mdp/__pycache__/observations.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/mdp/__pycache__/observations.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/mdp/__pycache__/terminations.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/mdp/__pycache__/terminations.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/mdp/observations.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | from tasks.common_observations.g1_29dof_state import get_robot_boy_joint_states 5 | from tasks.common_observations.gripper_state import get_robot_gipper_joint_states 6 | from tasks.common_observations.camera_state import get_camera_image 7 | 8 | # ensure functions can be accessed by external modules 9 | __all__ = [ 10 | "get_robot_boy_joint_states", 11 | "get_robot_gipper_joint_states", 12 | "get_camera_image" 13 | ] 14 | 15 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/mdp/rewards.py: -------------------------------------------------------------------------------- 1 | from tasks.common_rewards.base_reward_pickplace_cylindercfg import compute_reward 2 | 3 | __all__ = [ 4 | "compute_reward" 5 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex1/mdp/terminations.py: -------------------------------------------------------------------------------- 1 | from tasks.common_termination.base_termination_pick_place_cylinder import reset_object_estimate 2 | __all__ = [ 3 | "reset_object_estimate" 4 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | import gymnasium as gym 6 | import os 7 | 8 | from . import pickplace_cylinder_g1_29dof_dex3_joint_env_cfg 9 | 10 | 11 | gym.register( 12 | id="Isaac-PickPlace-Cylinder-G129-Dex3-Joint", 13 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 14 | kwargs={ 15 | "env_cfg_entry_point": pickplace_cylinder_g1_29dof_dex3_joint_env_cfg.PickPlaceG129DEX3JointEnvCfg, 16 | }, 17 | disable_env_checker=True, 18 | ) 19 | 20 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/__pycache__/pickplace_cylinder_g1_29dof_dex3_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/__pycache__/pickplace_cylinder_g1_29dof_dex3_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/__pycache__/pickplace_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/__pycache__/pickplace_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/__pycache__/pickplace_g1_29dof_dex3_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/__pycache__/pickplace_g1_29dof_dex3_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/__pycache__/pickplace_g1_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/__pycache__/pickplace_g1_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/__pycache__/pickplace_g1_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/__pycache__/pickplace_g1_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/mdp/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | 4 | """This sub-module contains the functions that are specific to the pick place environments.""" 5 | 6 | from isaaclab.envs.mdp import * 7 | 8 | from .observations import * 9 | from .terminations import * 10 | from .rewards import * 11 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/mdp/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/mdp/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/mdp/__pycache__/events.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/mdp/__pycache__/events.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/mdp/__pycache__/observations.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/mdp/__pycache__/observations.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/mdp/__pycache__/terminations.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/mdp/__pycache__/terminations.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/mdp/observations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from tasks.common_observations.g1_29dof_state import get_robot_boy_joint_states 4 | from tasks.common_observations.dex3_state import get_robot_dex3_joint_states 5 | from tasks.common_observations.camera_state import get_camera_image 6 | 7 | # ensure functions can be accessed by external modules 8 | __all__ = [ 9 | "get_robot_boy_joint_states", 10 | "get_robot_dex3_joint_states", 11 | "get_camera_image" 12 | ] 13 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/mdp/rewards.py: -------------------------------------------------------------------------------- 1 | from tasks.common_rewards.base_reward_pickplace_cylindercfg import compute_reward 2 | 3 | __all__ = [ 4 | "compute_reward" 5 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_dex3/mdp/terminations.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | from tasks.common_termination.base_termination_pick_place_cylinder import reset_object_estimate 5 | __all__ = [ 6 | "reset_object_estimate" 7 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_inspire/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | import gymnasium as gym 6 | 7 | from . import pickplace_cylinder_g1_29dof_inspire_env_cfg 8 | 9 | 10 | gym.register( 11 | id="Isaac-PickPlace-Cylinder-G129-Inspire-Joint", 12 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 13 | kwargs={ 14 | "env_cfg_entry_point": pickplace_cylinder_g1_29dof_inspire_env_cfg.PickPlaceG129InspireBaseFixEnvCfg, 15 | }, 16 | disable_env_checker=True, 17 | ) 18 | 19 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_inspire/mdp/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | """This sub-module contains the functions that are specific to the pick place environments.""" 6 | 7 | from isaaclab.envs.mdp import * 8 | 9 | from .observations import * 10 | from .terminations import * 11 | from .rewards import * 12 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_inspire/mdp/observations.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | from tasks.common_observations.g1_29dof_state import get_robot_boy_joint_states 5 | from tasks.common_observations.inspire_state import get_robot_inspire_joint_states 6 | from tasks.common_observations.camera_state import get_camera_image 7 | 8 | # ensure functions can be accessed by external modules 9 | __all__ = [ 10 | "get_robot_boy_joint_states", 11 | "get_robot_inspire_joint_states", 12 | "get_camera_image" 13 | ] 14 | 15 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_inspire/mdp/rewards.py: -------------------------------------------------------------------------------- 1 | from tasks.common_rewards.base_reward_pickplace_cylindercfg import compute_reward 2 | 3 | __all__ = [ 4 | "compute_reward" 5 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_cylinder_g1_29dof_inspire/mdp/terminations.py: -------------------------------------------------------------------------------- 1 | from tasks.common_termination.base_termination_pick_place_cylinder import reset_object_estimate 2 | __all__ = [ 3 | "reset_object_estimate" 4 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | import gymnasium as gym 4 | import os 5 | 6 | from . import pickplace_redblock_g1_29dof_dex1_joint_env_cfg 7 | 8 | 9 | gym.register( 10 | id="Isaac-PickPlace-RedBlock-G129-Dex1-Joint", 11 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 12 | kwargs={ 13 | "env_cfg_entry_point": pickplace_redblock_g1_29dof_dex1_joint_env_cfg.PickPlaceG129DEX1BaseFixEnvCfg, 14 | }, 15 | disable_env_checker=True, 16 | ) 17 | 18 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/__pycache__/pickplace_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/__pycache__/pickplace_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/__pycache__/pickplace_g1_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/__pycache__/pickplace_g1_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/__pycache__/pickplace_g1_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/__pycache__/pickplace_g1_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/__pycache__/pickplace_redblock_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/__pycache__/pickplace_redblock_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/mdp/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | """This sub-module contains the functions that are specific to the pick place environments.""" 6 | 7 | from isaaclab.envs.mdp import * 8 | 9 | from .observations import * 10 | from .terminations import * 11 | from .rewards import * -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/mdp/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/mdp/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/mdp/__pycache__/events.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/mdp/__pycache__/events.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/mdp/__pycache__/observations.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/mdp/__pycache__/observations.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/mdp/__pycache__/terminations.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/mdp/__pycache__/terminations.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/mdp/observations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from tasks.common_observations.g1_29dof_state import get_robot_boy_joint_states 4 | from tasks.common_observations.gripper_state import get_robot_gipper_joint_states 5 | from tasks.common_observations.camera_state import get_camera_image 6 | 7 | # ensure functions can be accessed by external modules 8 | __all__ = [ 9 | "get_robot_boy_joint_states", 10 | "get_robot_gipper_joint_states", 11 | "get_camera_image" 12 | ] 13 | 14 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/mdp/rewards.py: -------------------------------------------------------------------------------- 1 | from tasks.common_rewards.base_reward_pickplace_redblock import compute_reward 2 | 3 | __all__ = [ 4 | "compute_reward" 5 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex1/mdp/terminations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from tasks.common_termination.base_termination_pick_place_redblock import reset_object_estimate 4 | 5 | 6 | __all__ = [ 7 | "reset_object_estimate" 8 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | 4 | import gymnasium as gym 5 | import os 6 | 7 | from . import pickplace_redblock_g1_29dof_dex3_joint_env_cfg 8 | 9 | 10 | gym.register( 11 | id="Isaac-PickPlace-RedBlock-G129-Dex3-Joint", 12 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 13 | kwargs={ 14 | "env_cfg_entry_point": pickplace_redblock_g1_29dof_dex3_joint_env_cfg.PickPlaceG129DEX3BaseFixEnvCfg, 15 | }, 16 | disable_env_checker=True, 17 | ) 18 | 19 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/__pycache__/pickplace_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/__pycache__/pickplace_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/__pycache__/pickplace_g1_29dof_dex3_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/__pycache__/pickplace_g1_29dof_dex3_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/__pycache__/pickplace_g1_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/__pycache__/pickplace_g1_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/__pycache__/pickplace_g1_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/__pycache__/pickplace_g1_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/__pycache__/pickplace_redblock_g1_29dof_dex3_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/__pycache__/pickplace_redblock_g1_29dof_dex3_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/mdp/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | """This sub-module contains the functions that are specific to the pick place environments.""" 6 | 7 | from isaaclab.envs.mdp import * 8 | 9 | from .observations import * 10 | from .terminations import * 11 | from .rewards import * 12 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/mdp/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/mdp/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/mdp/__pycache__/events.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/mdp/__pycache__/events.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/mdp/__pycache__/observations.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/mdp/__pycache__/observations.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/mdp/__pycache__/terminations.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/mdp/__pycache__/terminations.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/mdp/observations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from tasks.common_observations.g1_29dof_state import get_robot_boy_joint_states 4 | from tasks.common_observations.dex3_state import get_robot_dex3_joint_states 5 | from tasks.common_observations.camera_state import get_camera_image 6 | 7 | # ensure functions can be accessed by external modules 8 | __all__ = [ 9 | "get_robot_boy_joint_states", 10 | "get_robot_dex3_joint_states", 11 | "get_camera_image" 12 | ] 13 | 14 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/mdp/rewards.py: -------------------------------------------------------------------------------- 1 | from tasks.common_rewards.base_reward_pickplace_redblock import compute_reward 2 | 3 | __all__ = [ 4 | "compute_reward" 5 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_dex3/mdp/terminations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from tasks.common_termination.base_termination_pick_place_redblock import reset_object_estimate 4 | 5 | 6 | __all__ = [ 7 | "reset_object_estimate" 8 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_inspire/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | import gymnasium as gym 4 | import os 5 | 6 | from . import pickplace_redblock_g1_29dof_inspire_joint_env_cfg 7 | 8 | 9 | gym.register( 10 | id="Isaac-PickPlace-RedBlock-G129-Inspire-Joint", 11 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 12 | kwargs={ 13 | "env_cfg_entry_point": pickplace_redblock_g1_29dof_inspire_joint_env_cfg.PickPlaceG129InspireHandBaseFixEnvCfg, 14 | }, 15 | disable_env_checker=True, 16 | ) 17 | 18 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_inspire/mdp/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | """This sub-module contains the functions that are specific to the pick place environments.""" 6 | 7 | from isaaclab.envs.mdp import * 8 | 9 | from .observations import * 10 | from .terminations import * 11 | from .rewards import * 12 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_inspire/mdp/observations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from tasks.common_observations.g1_29dof_state import get_robot_boy_joint_states 4 | from tasks.common_observations.inspire_state import get_robot_inspire_joint_states 5 | from tasks.common_observations.camera_state import get_camera_image 6 | 7 | # ensure functions can be accessed by external modules 8 | __all__ = [ 9 | "get_robot_boy_joint_states", 10 | "get_robot_inspire_joint_states", 11 | "get_camera_image" 12 | ] 13 | 14 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_inspire/mdp/rewards.py: -------------------------------------------------------------------------------- 1 | from tasks.common_rewards.base_reward_pickplace_redblock import compute_reward 2 | 3 | __all__ = [ 4 | "compute_reward" 5 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_place_redblock_g1_29dof_inspire/mdp/terminations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from tasks.common_termination.base_termination_pick_place_redblock import reset_object_estimate 4 | 5 | 6 | __all__ = [ 7 | "reset_object_estimate" 8 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_redblock_into_drawer_g1_29dof_dex1/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | import gymnasium as gym 4 | import os 5 | 6 | from . import pick_redblock_into_drawer_g1_29dof_dex1_joint_env_cfg 7 | 8 | 9 | gym.register( 10 | id="Isaac-Pick-Redblock-Into-Drawer-G129-Dex1-Joint", 11 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 12 | kwargs={ 13 | "env_cfg_entry_point": pick_redblock_into_drawer_g1_29dof_dex1_joint_env_cfg.PickRedblockIntoDrawerG129DEX1BaseFixEnvCfg, 14 | }, 15 | disable_env_checker=True, 16 | ) 17 | 18 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_redblock_into_drawer_g1_29dof_dex1/mdp/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | """This sub-module contains the functions that are specific to the pick place environments.""" 6 | 7 | from isaaclab.envs.mdp import * 8 | 9 | from .observations import * 10 | from .terminations import * 11 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_redblock_into_drawer_g1_29dof_dex1/mdp/observations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from tasks.common_observations.g1_29dof_state import get_robot_boy_joint_states 4 | from tasks.common_observations.gripper_state import get_robot_gipper_joint_states 5 | from tasks.common_observations.camera_state import get_camera_image 6 | 7 | # ensure functions can be accessed by external modules 8 | __all__ = [ 9 | "get_robot_boy_joint_states", 10 | "get_robot_gipper_joint_states", 11 | "get_camera_image" 12 | ] 13 | 14 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_redblock_into_drawer_g1_29dof_dex1/mdp/terminations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from tasks.common_termination.base_termination_pick_redblock_into_drawer import reset_object_estimate 4 | __all__ = [ 5 | "reset_object_estimate" 6 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_redblock_into_drawer_g1_29dof_dex3/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | 4 | import gymnasium as gym 5 | import os 6 | 7 | from . import pick_redblock_into_drawer_g1_29dof_dex3_joint_env_cfg 8 | 9 | 10 | gym.register( 11 | id="Isaac-Pick-Redblock-Into-Drawer-G129-Dex3-Joint", 12 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 13 | kwargs={ 14 | "env_cfg_entry_point": pick_redblock_into_drawer_g1_29dof_dex3_joint_env_cfg.PickRedblockIntoDrawerG129DEX3JointEnvCfg, 15 | }, 16 | disable_env_checker=True, 17 | ) 18 | 19 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_redblock_into_drawer_g1_29dof_dex3/mdp/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | """This sub-module contains the functions that are specific to the pick place environments.""" 6 | 7 | from isaaclab.envs.mdp import * 8 | 9 | from .observations import * 10 | from .terminations import * 11 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_redblock_into_drawer_g1_29dof_dex3/mdp/observations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from tasks.common_observations.g1_29dof_state import get_robot_boy_joint_states 4 | from tasks.common_observations.dex3_state import get_robot_dex3_joint_states 5 | from tasks.common_observations.camera_state import get_camera_image 6 | 7 | # ensure functions can be accessed by external modules 8 | __all__ = [ 9 | "get_robot_boy_joint_states", 10 | "get_robot_dex3_joint_states", 11 | "get_camera_image" 12 | ] 13 | 14 | -------------------------------------------------------------------------------- /tasks/g1_tasks/pick_redblock_into_drawer_g1_29dof_dex3/mdp/terminations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from tasks.common_termination.base_termination_pick_redblock_into_drawer import reset_object_estimate 4 | __all__ = [ 5 | "reset_object_estimate" 6 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | import gymnasium as gym 4 | import os 5 | 6 | from . import stack_rgyblock_g1_29dof_dex1_joint_env_cfg 7 | 8 | 9 | gym.register( 10 | id="Isaac-Stack-RgyBlock-G129-Dex1-Joint", 11 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 12 | kwargs={ 13 | "env_cfg_entry_point": stack_rgyblock_g1_29dof_dex1_joint_env_cfg.StackRgyBlockG129DEX1BaseFixEnvCfg, 14 | }, 15 | disable_env_checker=True, 16 | ) 17 | 18 | -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/__pycache__/pickplace_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/__pycache__/pickplace_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/__pycache__/pickplace_g1_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/__pycache__/pickplace_g1_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/__pycache__/pickplace_g1_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/__pycache__/pickplace_g1_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/__pycache__/pickplace_redblock_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/__pycache__/pickplace_redblock_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/__pycache__/stack_rgyblock_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/__pycache__/stack_rgyblock_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/mdp/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | """This sub-module contains the functions that are specific to the pick place environments.""" 6 | 7 | from isaaclab.envs.mdp import * 8 | 9 | from .observations import * 10 | from .terminations import * 11 | from .rewards import * 12 | -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/mdp/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/mdp/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/mdp/__pycache__/events.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/mdp/__pycache__/events.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/mdp/__pycache__/observations.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/mdp/__pycache__/observations.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/mdp/__pycache__/terminations.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/mdp/__pycache__/terminations.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/mdp/observations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from tasks.common_observations.g1_29dof_state import get_robot_boy_joint_states 4 | from tasks.common_observations.gripper_state import get_robot_gipper_joint_states 5 | from tasks.common_observations.camera_state import get_camera_image 6 | 7 | # ensure functions can be accessed by external modules 8 | __all__ = [ 9 | "get_robot_boy_joint_states", 10 | "get_robot_gipper_joint_states", 11 | "get_camera_image" 12 | ] 13 | 14 | -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/mdp/rewards.py: -------------------------------------------------------------------------------- 1 | from tasks.common_rewards.base_reward_stack_rgyblock import compute_reward 2 | 3 | __all__ = [ 4 | "compute_reward" 5 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex1/mdp/terminations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from tasks.common_termination.base_termination_stack_rgyblock import reset_object_estimate 4 | 5 | 6 | __all__ = [ 7 | "reset_object_estimate" 8 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | import gymnasium as gym 4 | import os 5 | 6 | from . import stack_rgyblock_g1_29dof_dex3_joint_env_cfg 7 | 8 | 9 | gym.register( 10 | id="Isaac-Stack-RgyBlock-G129-Dex3-Joint", 11 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 12 | kwargs={ 13 | "env_cfg_entry_point": stack_rgyblock_g1_29dof_dex3_joint_env_cfg.StackRgyBlockG129DEX3BaseFixEnvCfg, 14 | }, 15 | disable_env_checker=True, 16 | ) 17 | 18 | -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/__pycache__/pickplace_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/__pycache__/pickplace_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/__pycache__/pickplace_g1_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/__pycache__/pickplace_g1_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/__pycache__/pickplace_g1_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/__pycache__/pickplace_g1_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/__pycache__/pickplace_redblock_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/__pycache__/pickplace_redblock_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/__pycache__/stack_rgyblock_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/__pycache__/stack_rgyblock_g1_29dof_dex1_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/__pycache__/stack_rgyblock_g1_29dof_dex3_joint_env_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/__pycache__/stack_rgyblock_g1_29dof_dex3_joint_env_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/mdp/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | """This sub-module contains the functions that are specific to the pick place environments.""" 6 | 7 | from isaaclab.envs.mdp import * 8 | 9 | from .observations import * 10 | from .terminations import * 11 | from .rewards import * 12 | -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/mdp/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/mdp/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/mdp/__pycache__/events.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/mdp/__pycache__/events.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/mdp/__pycache__/observations.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/mdp/__pycache__/observations.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/mdp/__pycache__/terminations.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/mdp/__pycache__/terminations.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/mdp/observations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from tasks.common_observations.g1_29dof_state import get_robot_boy_joint_states 4 | from tasks.common_observations.dex3_state import get_robot_dex3_joint_states 5 | from tasks.common_observations.camera_state import get_camera_image 6 | 7 | # ensure functions can be accessed by external modules 8 | __all__ = [ 9 | "get_robot_boy_joint_states", 10 | "get_robot_dex3_joint_states", 11 | "get_camera_image" 12 | ] 13 | 14 | -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/mdp/rewards.py: -------------------------------------------------------------------------------- 1 | from tasks.common_rewards.base_reward_stack_rgyblock import compute_reward 2 | 3 | __all__ = [ 4 | "compute_reward" 5 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_dex3/mdp/terminations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from tasks.common_termination.base_termination_stack_rgyblock import reset_object_estimate 4 | 5 | 6 | __all__ = [ 7 | "reset_object_estimate" 8 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_inspire/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | import gymnasium as gym 4 | import os 5 | 6 | from . import stack_rgyblock_g1_29dof_inspire_joint_env_cfg 7 | 8 | 9 | gym.register( 10 | id="Isaac-Stack-RgyBlock-G129-Inspire-Joint", 11 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 12 | kwargs={ 13 | "env_cfg_entry_point": stack_rgyblock_g1_29dof_inspire_joint_env_cfg.StackRgyBlockG129InspireBaseFixEnvCfg, 14 | }, 15 | disable_env_checker=True, 16 | ) 17 | 18 | -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_inspire/mdp/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | """This sub-module contains the functions that are specific to the pick place environments.""" 6 | 7 | from isaaclab.envs.mdp import * 8 | 9 | from .observations import * 10 | from .terminations import * 11 | from .rewards import * 12 | -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_inspire/mdp/observations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from tasks.common_observations.g1_29dof_state import get_robot_boy_joint_states 4 | from tasks.common_observations.inspire_state import get_robot_inspire_joint_states 5 | from tasks.common_observations.camera_state import get_camera_image 6 | 7 | # ensure functions can be accessed by external modules 8 | __all__ = [ 9 | "get_robot_boy_joint_states", 10 | "get_robot_inspire_joint_states", 11 | "get_camera_image" 12 | ] 13 | 14 | -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_inspire/mdp/rewards.py: -------------------------------------------------------------------------------- 1 | from tasks.common_rewards.base_reward_stack_rgyblock import compute_reward 2 | 3 | __all__ = [ 4 | "compute_reward" 5 | ] -------------------------------------------------------------------------------- /tasks/g1_tasks/stack_rgyblock_g1_29dof_inspire/mdp/terminations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from tasks.common_termination.base_termination_stack_rgyblock import reset_object_estimate 4 | 5 | 6 | __all__ = [ 7 | "reset_object_estimate" 8 | ] -------------------------------------------------------------------------------- /tasks/h1-2_tasks/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | """Unitree G1 robot task module 5 | contains various task implementations for the G1 robot, such as pick and place, motion control, etc. 6 | """ 7 | 8 | # use relative import 9 | 10 | from . import pick_place_cylinder_h12_27dof_inspire 11 | from . import stack_rgyblock_h12_27dof_inspire 12 | from . import pick_place_redblock_h12_27dof_inspire 13 | 14 | 15 | # export all modules 16 | __all__ = [ 17 | "pick_place_cylinder_h12_27dof_inspire", 18 | "stack_rgyblock_h12_27dof_inspire", 19 | "pick_place_redblock_h12_27dof_inspire", 20 | 21 | ] -------------------------------------------------------------------------------- /tasks/h1-2_tasks/pick_place_cylinder_h12_27dof_inspire/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | import gymnasium as gym 6 | 7 | from . import pickplace_cylinder_h12_27dof_inspire_env_cfg 8 | 9 | 10 | gym.register( 11 | id="Isaac-PickPlace-Cylinder-H12-27dof-Inspire-Joint", 12 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 13 | kwargs={ 14 | "env_cfg_entry_point": pickplace_cylinder_h12_27dof_inspire_env_cfg.PickPlaceH1227dofInspireBaseFixEnvCfg, 15 | }, 16 | disable_env_checker=True, 17 | ) 18 | -------------------------------------------------------------------------------- /tasks/h1-2_tasks/pick_place_cylinder_h12_27dof_inspire/mdp/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | """This sub-module contains the functions that are specific to the pick place environments.""" 6 | 7 | from isaaclab.envs.mdp import * 8 | 9 | from .observations import * 10 | from .terminations import * 11 | from .rewards import * 12 | -------------------------------------------------------------------------------- /tasks/h1-2_tasks/pick_place_cylinder_h12_27dof_inspire/mdp/observations.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | from tasks.common_observations.h12_27dof_state import get_robot_boy_joint_states 5 | from tasks.common_observations.inspire_state import get_robot_inspire_joint_states 6 | from tasks.common_observations.camera_state import get_camera_image 7 | 8 | # ensure functions can be accessed by external modules 9 | __all__ = [ 10 | "get_robot_boy_joint_states", 11 | "get_robot_inspire_joint_states", 12 | "get_camera_image" 13 | ] 14 | 15 | -------------------------------------------------------------------------------- /tasks/h1-2_tasks/pick_place_cylinder_h12_27dof_inspire/mdp/rewards.py: -------------------------------------------------------------------------------- 1 | from tasks.common_rewards.base_reward_pickplace_cylindercfg import compute_reward 2 | 3 | __all__ = [ 4 | "compute_reward" 5 | ] -------------------------------------------------------------------------------- /tasks/h1-2_tasks/pick_place_cylinder_h12_27dof_inspire/mdp/terminations.py: -------------------------------------------------------------------------------- 1 | from tasks.common_termination.base_termination_pick_place_cylinder import reset_object_estimate 2 | __all__ = [ 3 | "reset_object_estimate" 4 | ] -------------------------------------------------------------------------------- /tasks/h1-2_tasks/pick_place_redblock_h12_27dof_inspire/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | import gymnasium as gym 4 | import os 5 | 6 | from . import pickplace_redblock_h12_27dof_inspire_joint_env_cfg 7 | 8 | 9 | gym.register( 10 | id="Isaac-PickPlace-RedBlock-H12-27dof-Inspire-Joint", 11 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 12 | kwargs={ 13 | "env_cfg_entry_point": pickplace_redblock_h12_27dof_inspire_joint_env_cfg.PickPlaceH1227dofInspireHandBaseFixEnvCfg, 14 | }, 15 | disable_env_checker=True, 16 | ) 17 | 18 | -------------------------------------------------------------------------------- /tasks/h1-2_tasks/pick_place_redblock_h12_27dof_inspire/mdp/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | """This sub-module contains the functions that are specific to the pick place environments.""" 6 | 7 | from isaaclab.envs.mdp import * 8 | 9 | from .observations import * 10 | from .terminations import * 11 | from .rewards import * 12 | -------------------------------------------------------------------------------- /tasks/h1-2_tasks/pick_place_redblock_h12_27dof_inspire/mdp/observations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from tasks.common_observations.h12_27dof_state import get_robot_boy_joint_states 4 | from tasks.common_observations.inspire_state import get_robot_inspire_joint_states 5 | from tasks.common_observations.camera_state import get_camera_image 6 | 7 | # ensure functions can be accessed by external modules 8 | __all__ = [ 9 | "get_robot_boy_joint_states", 10 | "get_robot_inspire_joint_states", 11 | "get_camera_image" 12 | ] 13 | 14 | -------------------------------------------------------------------------------- /tasks/h1-2_tasks/pick_place_redblock_h12_27dof_inspire/mdp/rewards.py: -------------------------------------------------------------------------------- 1 | from tasks.common_rewards.base_reward_pickplace_redblock import compute_reward 2 | 3 | __all__ = [ 4 | "compute_reward" 5 | ] -------------------------------------------------------------------------------- /tasks/h1-2_tasks/pick_place_redblock_h12_27dof_inspire/mdp/terminations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from tasks.common_termination.base_termination_pick_place_redblock import reset_object_estimate 4 | 5 | 6 | __all__ = [ 7 | "reset_object_estimate" 8 | ] -------------------------------------------------------------------------------- /tasks/h1-2_tasks/stack_rgyblock_h12_27dof_inspire/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | import gymnasium as gym 4 | import os 5 | 6 | from . import stack_rgyblock_h12_27dof_inspire_joint_env_cfg 7 | 8 | 9 | gym.register( 10 | id="Isaac-Stack-RgyBlock-H12-27dof-Inspire-Joint", 11 | entry_point="isaaclab.envs:ManagerBasedRLEnv", 12 | kwargs={ 13 | "env_cfg_entry_point": stack_rgyblock_h12_27dof_inspire_joint_env_cfg.StackRgyBlockH1227dofInspireBaseFixEnvCfg, 14 | }, 15 | disable_env_checker=True, 16 | ) 17 | 18 | -------------------------------------------------------------------------------- /tasks/h1-2_tasks/stack_rgyblock_h12_27dof_inspire/mdp/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 3 | # License: Apache License, Version 2.0 4 | 5 | """This sub-module contains the functions that are specific to the pick place environments.""" 6 | 7 | from isaaclab.envs.mdp import * 8 | 9 | from .observations import * 10 | from .terminations import * 11 | from .rewards import * 12 | -------------------------------------------------------------------------------- /tasks/h1-2_tasks/stack_rgyblock_h12_27dof_inspire/mdp/observations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from tasks.common_observations.h12_27dof_state import get_robot_boy_joint_states 4 | from tasks.common_observations.inspire_state import get_robot_inspire_joint_states 5 | from tasks.common_observations.camera_state import get_camera_image 6 | 7 | # ensure functions can be accessed by external modules 8 | __all__ = [ 9 | "get_robot_boy_joint_states", 10 | "get_robot_inspire_joint_states", 11 | "get_camera_image" 12 | ] 13 | 14 | -------------------------------------------------------------------------------- /tasks/h1-2_tasks/stack_rgyblock_h12_27dof_inspire/mdp/rewards.py: -------------------------------------------------------------------------------- 1 | from tasks.common_rewards.base_reward_stack_rgyblock import compute_reward 2 | 3 | __all__ = [ 4 | "compute_reward" 5 | ] -------------------------------------------------------------------------------- /tasks/h1-2_tasks/stack_rgyblock_h12_27dof_inspire/mdp/terminations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025, Unitree Robotics Co., Ltd. All Rights Reserved. 2 | # License: Apache License, Version 2.0 3 | from tasks.common_termination.base_termination_stack_rgyblock import reset_object_estimate 4 | 5 | 6 | __all__ = [ 7 | "reset_object_estimate" 8 | ] -------------------------------------------------------------------------------- /tasks/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Sub-package with utilities, data collectors and environment wrappers.""" 7 | 8 | from .importer import import_packages 9 | from .parse_cfg import get_checkpoint_path, load_cfg_from_registry, parse_env_cfg 10 | -------------------------------------------------------------------------------- /tasks/utils/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/utils/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/utils/__pycache__/__init__.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/utils/__pycache__/__init__.cpython-311.pyc -------------------------------------------------------------------------------- /tasks/utils/__pycache__/camera_utils.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/utils/__pycache__/camera_utils.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/utils/__pycache__/hydra.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/utils/__pycache__/hydra.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/utils/__pycache__/importer.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/utils/__pycache__/importer.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/utils/__pycache__/importer.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/utils/__pycache__/importer.cpython-311.pyc -------------------------------------------------------------------------------- /tasks/utils/__pycache__/parse_cfg.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/utils/__pycache__/parse_cfg.cpython-310.pyc -------------------------------------------------------------------------------- /tasks/utils/__pycache__/parse_cfg.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unitreerobotics/unitree_sim_isaaclab/5b89b377bcf576eb256aaa994ada2b01c97cdfa1/tasks/utils/__pycache__/parse_cfg.cpython-311.pyc -------------------------------------------------------------------------------- /tasks/utils/hydra.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Sub-module with utilities for the hydra configuration system.""" 7 | 8 | 9 | import functools 10 | from collections.abc import Callable 11 | 12 | try: 13 | import hydra 14 | from hydra.core.config_store import ConfigStore 15 | from omegaconf import DictConfig, OmegaConf 16 | except ImportError: 17 | raise ImportError("Hydra is not installed. Please install it by running 'pip install hydra-core'.") 18 | 19 | from isaaclab.envs import DirectRLEnvCfg, ManagerBasedRLEnvCfg 20 | from isaaclab.envs.utils.spaces import replace_env_cfg_spaces_with_strings, replace_strings_with_env_cfg_spaces 21 | from isaaclab.utils import replace_slices_with_strings, replace_strings_with_slices 22 | 23 | from isaaclab_tasks.utils.parse_cfg import load_cfg_from_registry 24 | 25 | 26 | def register_task_to_hydra( 27 | task_name: str, agent_cfg_entry_point: str 28 | ) -> tuple[ManagerBasedRLEnvCfg | DirectRLEnvCfg, dict]: 29 | """Register the task configuration to the Hydra configuration store. 30 | 31 | This function resolves the configuration file for the environment and agent based on the task's name. 32 | It then registers the configurations to the Hydra configuration store. 33 | 34 | Args: 35 | task_name: The name of the task. 36 | agent_cfg_entry_point: The entry point key to resolve the agent's configuration file. 37 | 38 | Returns: 39 | A tuple containing the parsed environment and agent configuration objects. 40 | """ 41 | # load the configurations 42 | env_cfg = load_cfg_from_registry(task_name, "env_cfg_entry_point") 43 | agent_cfg = None 44 | if agent_cfg_entry_point: 45 | agent_cfg = load_cfg_from_registry(task_name, agent_cfg_entry_point) 46 | # replace gymnasium spaces with strings because OmegaConf does not support them. 47 | # this must be done before converting the env configs to dictionary to avoid internal reinterpretations 48 | env_cfg = replace_env_cfg_spaces_with_strings(env_cfg) 49 | # convert the configs to dictionary 50 | env_cfg_dict = env_cfg.to_dict() 51 | if isinstance(agent_cfg, dict) or agent_cfg is None: 52 | agent_cfg_dict = agent_cfg 53 | else: 54 | agent_cfg_dict = agent_cfg.to_dict() 55 | cfg_dict = {"env": env_cfg_dict, "agent": agent_cfg_dict} 56 | # replace slices with strings because OmegaConf does not support slices 57 | cfg_dict = replace_slices_with_strings(cfg_dict) 58 | # store the configuration to Hydra 59 | ConfigStore.instance().store(name=task_name, node=cfg_dict) 60 | return env_cfg, agent_cfg 61 | 62 | 63 | def hydra_task_config(task_name: str, agent_cfg_entry_point: str) -> Callable: 64 | """Decorator to handle the Hydra configuration for a task. 65 | 66 | This decorator registers the task to Hydra and updates the environment and agent configurations from Hydra parsed 67 | command line arguments. 68 | 69 | Args: 70 | task_name: The name of the task. 71 | agent_cfg_entry_point: The entry point key to resolve the agent's configuration file. 72 | 73 | Returns: 74 | The decorated function with the envrionment's and agent's configurations updated from command line arguments. 75 | """ 76 | 77 | def decorator(func): 78 | @functools.wraps(func) 79 | def wrapper(*args, **kwargs): 80 | # register the task to Hydra 81 | env_cfg, agent_cfg = register_task_to_hydra(task_name, agent_cfg_entry_point) 82 | 83 | # define the new Hydra main function 84 | @hydra.main(config_path=None, config_name=task_name, version_base="1.3") 85 | def hydra_main(hydra_env_cfg: DictConfig, env_cfg=env_cfg, agent_cfg=agent_cfg): 86 | # convert to a native dictionary 87 | hydra_env_cfg = OmegaConf.to_container(hydra_env_cfg, resolve=True) 88 | # replace string with slices because OmegaConf does not support slices 89 | hydra_env_cfg = replace_strings_with_slices(hydra_env_cfg) 90 | # update the configs with the Hydra command line arguments 91 | env_cfg.from_dict(hydra_env_cfg["env"]) 92 | # replace strings that represent gymnasium spaces because OmegaConf does not support them. 93 | # this must be done after converting the env configs from dictionary to avoid internal reinterpretations 94 | env_cfg = replace_strings_with_env_cfg_spaces(env_cfg) 95 | # get agent configs 96 | if isinstance(agent_cfg, dict) or agent_cfg is None: 97 | agent_cfg = hydra_env_cfg["agent"] 98 | else: 99 | agent_cfg.from_dict(hydra_env_cfg["agent"]) 100 | # call the original function 101 | func(env_cfg, agent_cfg, *args, **kwargs) 102 | 103 | # call the new Hydra main function 104 | hydra_main() 105 | 106 | return wrapper 107 | 108 | return decorator 109 | -------------------------------------------------------------------------------- /tasks/utils/importer.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """Sub-module with utility for importing all modules in a package recursively.""" 7 | 8 | from __future__ import annotations 9 | 10 | import importlib 11 | import pkgutil 12 | import sys 13 | 14 | 15 | def import_packages(package_name: str, blacklist_pkgs: list[str] | None = None): 16 | """Import all sub-packages in a package recursively. 17 | 18 | It is easier to use this function to import all sub-packages in a package recursively 19 | than to manually import each sub-package. 20 | 21 | It replaces the need of the following code snippet on the top of each package's ``__init__.py`` file: 22 | 23 | .. code-block:: python 24 | 25 | import .locomotion.velocity 26 | import .manipulation.reach 27 | import .manipulation.lift 28 | 29 | Args: 30 | package_name: The package name. 31 | blacklist_pkgs: The list of blacklisted packages to skip. Defaults to None, 32 | which means no packages are blacklisted. 33 | """ 34 | # Default blacklist 35 | if blacklist_pkgs is None: 36 | blacklist_pkgs = [] 37 | # Import the package itself 38 | package = importlib.import_module(package_name) 39 | # Import all Python files 40 | for _ in _walk_packages(package.__path__, package.__name__ + ".", blacklist_pkgs=blacklist_pkgs): 41 | pass 42 | 43 | 44 | def _walk_packages( 45 | path: str | None = None, 46 | prefix: str = "", 47 | onerror: callable | None = None, 48 | blacklist_pkgs: list[str] | None = None, 49 | ): 50 | """Yields ModuleInfo for all modules recursively on path, or, if path is None, all accessible modules. 51 | 52 | Note: 53 | This function is a modified version of the original ``pkgutil.walk_packages`` function. It adds 54 | the `blacklist_pkgs` argument to skip blacklisted packages. Please refer to the original 55 | ``pkgutil.walk_packages`` function for more details. 56 | """ 57 | if blacklist_pkgs is None: 58 | blacklist_pkgs = [] 59 | 60 | def seen(p, m={}): 61 | if p in m: 62 | return True 63 | m[p] = True # noqa: R503 64 | 65 | for info in pkgutil.iter_modules(path, prefix): 66 | # check blacklisted 67 | if any([black_pkg_name in info.name for black_pkg_name in blacklist_pkgs]): 68 | continue 69 | 70 | # yield the module info 71 | yield info 72 | 73 | if info.ispkg: 74 | try: 75 | __import__(info.name) 76 | except Exception: 77 | if onerror is not None: 78 | onerror(info.name) 79 | else: 80 | raise 81 | else: 82 | path = getattr(sys.modules[info.name], "__path__", None) or [] 83 | 84 | # don't traverse path items we've seen before 85 | path = [p for p in path if not seen(p)] 86 | 87 | yield from _walk_packages(path, info.name + ".", onerror, blacklist_pkgs) 88 | -------------------------------------------------------------------------------- /tools/convert_urdf.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025, The Isaac Lab Project Developers. 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | """ 7 | URDF转USD格式的工具脚本。 8 | 9 | URDF (Unified Robot Description Format) 是ROS中用于描述机器人所有元素的XML文件格式。 10 | 更多信息请参考: http://wiki.ros.org/urdf 11 | 12 | 本脚本使用Isaac Sim的URDF导入器扩展(``isaacsim.asset.importer.urdf``)将URDF资源转换为USD格式。 13 | 这是一个命令行使用的便捷脚本。关于URDF导入器的更多信息,请参考扩展文档: 14 | https://docs.isaacsim.omniverse.nvidia.com/latest/robot_setup/ext_isaacsim_asset_importer_urdf.html 15 | 16 | 参数说明: 17 | input 输入URDF文件的路径 18 | output 输出USD文件的存储路径 19 | 20 | 可选参数: 21 | -h, --help 显示帮助信息 22 | --merge-joints 合并由固定关节连接的链接 (默认: False) 23 | --fix-base 将基座固定在导入位置 (默认: False) 24 | --joint-stiffness 关节驱动的刚度 (默认: 100.0) 25 | --joint-damping 关节驱动的阻尼 (默认: 1.0) 26 | --joint-target-type 关节驱动的控制类型 (默认: "position") 27 | """ 28 | 29 | """首先启动Isaac Sim模拟器""" 30 | 31 | import argparse 32 | 33 | from isaaclab.app import AppLauncher 34 | 35 | # 添加命令行参数解析 36 | parser = argparse.ArgumentParser(description="URDF转USD格式的工具") 37 | # parser.add_argument("input", type=str, default="/home/unitree/newDisk/URDF/urdf-to-usd/g1withdex1/g1_29dof_with_dex1_rev_1_0.urdf", help="输入URDF文件的路径") 38 | # parser.add_argument("output", type=str, default="/home/unitree/Code/isaaclab_demo/usd/g1_body29_hand14.usd", help="输出USD文件的路径") 39 | parser.add_argument( 40 | "--merge-joints", 41 | action="store_true", 42 | default=False, 43 | help="合并由固定关节连接的链接", 44 | ) 45 | parser.add_argument("--fix-base", action="store_true", default=True, help="将基座固定在导入位置") 46 | parser.add_argument( 47 | "--joint-stiffness", 48 | type=float, 49 | default=100.0, 50 | help="关节驱动的刚度", 51 | ) 52 | parser.add_argument( 53 | "--joint-damping", 54 | type=float, 55 | default=1.0, 56 | help="关节驱动的阻尼", 57 | ) 58 | parser.add_argument( 59 | "--joint-target-type", 60 | type=str, 61 | default="position", 62 | choices=["position", "velocity", "none"], 63 | help="关节驱动的控制类型", 64 | ) 65 | 66 | # 添加AppLauncher的命令行参数 67 | AppLauncher.add_app_launcher_args(parser) 68 | # 解析命令行参数 69 | args_cli = parser.parse_args() 70 | 71 | # 启动omniverse应用 72 | app_launcher = AppLauncher(args_cli) 73 | simulation_app = app_launcher.app 74 | 75 | """以下是主要功能实现""" 76 | 77 | import contextlib 78 | import os 79 | 80 | import carb 81 | import isaacsim.core.utils.stage as stage_utils 82 | import omni.kit.app 83 | 84 | from isaaclab.sim.converters import UrdfConverter, UrdfConverterCfg 85 | from isaaclab.utils.assets import check_file_path 86 | from isaaclab.utils.dict import print_dict 87 | 88 | 89 | def main(): 90 | # 检查输入文件路径是否有效 91 | urdf_path = "/home/unitree/newDisk/URDF/urdf-to-usd/h1_2_inspire/h1_2.urdf" #args_cli.input 92 | print(urdf_path) 93 | if not os.path.isabs(urdf_path): 94 | urdf_path = os.path.abspath(urdf_path) 95 | if not check_file_path(urdf_path): 96 | raise ValueError(f"无效的文件路径: {urdf_path}") 97 | 98 | # 创建输出文件路径 99 | dest_path = "/home/unitree/newDisk/URDF/urdf-to-usd/h1_2_inspire/h1_2.urdf.usd" 100 | if not os.path.isabs(dest_path): 101 | dest_path = os.path.abspath(dest_path) 102 | 103 | # 创建URDF转换器配置 104 | urdf_converter_cfg = UrdfConverterCfg( 105 | asset_path=urdf_path, 106 | usd_dir=os.path.dirname(dest_path), 107 | usd_file_name=os.path.basename(dest_path), 108 | fix_base=args_cli.fix_base, 109 | merge_fixed_joints=args_cli.merge_joints, 110 | force_usd_conversion=True, 111 | joint_drive=UrdfConverterCfg.JointDriveCfg( 112 | gains=UrdfConverterCfg.JointDriveCfg.PDGainsCfg( 113 | stiffness=args_cli.joint_stiffness, 114 | damping=args_cli.joint_damping, 115 | ), 116 | target_type=args_cli.joint_target_type, 117 | ), 118 | ) 119 | 120 | # 打印配置信息 121 | print("-" * 80) 122 | print("-" * 80) 123 | print(f"输入URDF文件: {urdf_path}") 124 | print("URDF导入器配置:") 125 | print_dict(urdf_converter_cfg.to_dict(), nesting=0) 126 | print("-" * 80) 127 | print("-" * 80) 128 | 129 | # 创建URDF转换器并导入文件 130 | urdf_converter = UrdfConverter(urdf_converter_cfg) 131 | # 打印输出信息 132 | print("URDF导入器输出:") 133 | print(f"生成的USD文件: {urdf_converter.usd_path}") 134 | print("-" * 80) 135 | print("-" * 80) 136 | 137 | # 检查是否有GUI需要更新: 138 | # 获取设置接口 139 | carb_settings_iface = carb.settings.get_settings() 140 | # 读取本地GUI是否启用的标志 141 | local_gui = carb_settings_iface.get("/app/window/enabled") 142 | # 读取直播GUI是否启用的标志 143 | livestream_gui = carb_settings_iface.get("/app/livestream/enabled") 144 | 145 | # 如果启用了GUI,则运行模拟场景 146 | if local_gui or livestream_gui: 147 | # 打开USD场景 148 | stage_utils.open_stage(urdf_converter.usd_path) 149 | # 重新初始化模拟 150 | app = omni.kit.app.get_app_interface() 151 | # 运行模拟 152 | with contextlib.suppress(KeyboardInterrupt): 153 | while app.is_running(): 154 | # 执行模拟步骤 155 | app.update() 156 | 157 | 158 | if __name__ == "__main__": 159 | # 运行主函数 160 | main() 161 | # 关闭模拟应用 162 | simulation_app.close() 163 | -------------------------------------------------------------------------------- /tools/data_convert.py: -------------------------------------------------------------------------------- 1 | def convert_to_joint_range(value): 2 | """Convert the command value to the Isaac Lab joint angle [5.6, 0] -> [-0.02, 0.024] 3 | 4 | Args: 5 | value: the input value, range in [5.6, 0] 6 | 5.6: fully open 7 | 0.0: fully closed 8 | 9 | Returns: 10 | float: the converted value, range in [-0.02, 0.03] 11 | -0.02: fully open 12 | 0.03: fully closed 13 | """ 14 | # input range (gripper control value) 15 | input_min = 0.0 # fully closed 16 | input_max = 5.4 # fully open 17 | 18 | # output range (joint angle) 19 | output_min = 0.024 # fully closed 20 | output_max = -0.02 # fully open 21 | 22 | # ensure the input value is in the valid range 23 | value = max(input_min, min(input_max, value)) 24 | 25 | # linear mapping conversion 26 | converted_value = output_min + (output_max - output_min) * (value - input_min) / (input_max - input_min) 27 | 28 | return converted_value 29 | 30 | def convert_to_gripper_range(value): 31 | """Convert the Isaac Lab joint angle to the gripper control value [-0.02, 0.03] -> [5.6, 0] 32 | 33 | Args: 34 | value: the input value, range in [-0.02, 0.024] 35 | -0.02: fully open 36 | 0.03: fully closed 37 | 38 | Returns: 39 | float: the converted value, range in [5.6, 0] 40 | 5.6: fully open 41 | 0.0: fully closed 42 | """ 43 | # input range (joint angle) 44 | input_min = 0.024 # fully closed 45 | input_max = -0.02 # fully open 46 | 47 | # output range (gripper control value) 48 | output_min = 0.0 # fully closed 49 | output_max = 5.4 # fully open 50 | try: 51 | value = round(float(value), 3) 52 | except Exception: 53 | pass 54 | # ensure the input value is in the valid range 55 | value = max(input_max, min(input_min, value)) 56 | 57 | # linear mapping conversion 58 | converted_value = output_min + (output_max - output_min) * (input_min - value) / (input_min - input_max) 59 | 60 | converted_value = round(converted_value, 3) 61 | return converted_value -------------------------------------------------------------------------------- /tools/edit_usda.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | def modify_instanceable_flag(file_path): 4 | with open(file_path, 'r', encoding='utf-8') as f: 5 | lines = f.readlines() 6 | 7 | modified_lines = [] 8 | inside_visuals_block = False 9 | visuals_start_re = re.compile(r'^\s*def\s+Xform\s+"visuals"\s*\(') 10 | instanceable_re = re.compile(r'^\s*instanceable\s*=\s*true\s*$') 11 | # instanceable_re = re.compile(r'^\s*instanceable\s*=\s*false\s*$') 12 | 13 | for line in lines: 14 | if visuals_start_re.match(line): 15 | inside_visuals_block = True 16 | modified_lines.append(line) 17 | continue 18 | 19 | if inside_visuals_block: 20 | if instanceable_re.match(line): 21 | # Replace 'true' with 'false' 22 | modified_lines.append(' instanceable = false\n') 23 | # modified_lines.append(' instanceable = true\n') 24 | else: 25 | modified_lines.append(line) 26 | 27 | if line.strip().endswith(')'): 28 | inside_visuals_block = False 29 | else: 30 | modified_lines.append(line) 31 | 32 | # 保存修改后的内容 33 | with open('/home/unitree/newDisk/URDF/urdf-to-usd/h1_2_inspire/h1_2_demo2.usda', 'w', encoding='utf-8') as f: 34 | f.writelines(modified_lines) 35 | 36 | # 使用方法 37 | modify_instanceable_flag('/home/unitree/newDisk/URDF/urdf-to-usd/h1_2_inspire/demo.usda') # 替换为你的实际文件路径 38 | -------------------------------------------------------------------------------- /tools/edit_usda_tem.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | import os 5 | import sys 6 | import logging 7 | from typing import List, Set, Optional 8 | from pathlib import Path 9 | import re 10 | 11 | # 配置日志 12 | logging.basicConfig( 13 | level=logging.INFO, 14 | format='%(asctime)s - %(levelname)s - %(message)s' 15 | ) 16 | logger = logging.getLogger(__name__) 17 | 18 | def modify_usda_file(input_file, output_file, target_links): 19 | """ 20 | 修改usda文件 21 | - 所有visuals下的instanceable改为false 22 | - 指定link下的collisions的instanceable改为false 23 | """ 24 | with open(input_file, 'r', encoding='utf-8') as f: 25 | lines = f.readlines() 26 | 27 | modified_lines = [] 28 | current_link = None 29 | inside_visuals_block = False 30 | inside_collisions_block = False 31 | find_target_link = False 32 | 33 | # 编译正则表达式 34 | visuals_start_re = re.compile(r'^\s*def\s+Xform\s+"visuals"\s*\(') 35 | collisions_start_re = re.compile(r'\s*def\s+Xform\s+"collisions"\s*\(') 36 | instanceable_re = re.compile(r'^\s*instanceable\s*=\s*true\s*$') 37 | collisions_instanceable_re = re.compile(r'^\s*instanceable\s*=\s*true\s*$') 38 | 39 | for line in lines: 40 | # 检查是否是Xform定义行 41 | if 'def Xform "' in line: 42 | if visuals_start_re.match(line): 43 | inside_visuals_block = True 44 | modified_lines.append(line) 45 | continue 46 | elif collisions_start_re.match(line): 47 | inside_collisions_block = True 48 | modified_lines.append(line) 49 | continue 50 | else: 51 | # 提取link名称 52 | current_link = line.split('"')[1] 53 | 54 | if current_link in target_links: 55 | find_target_link = True 56 | inside_collisions_block = False 57 | inside_visuals_block = False 58 | modified_lines.append(line) 59 | continue 60 | # 处理visuals部分 61 | if inside_visuals_block: 62 | if instanceable_re.match(line): 63 | modified_lines.append(' instanceable = false\n') 64 | else: 65 | modified_lines.append(line) 66 | if line.strip().endswith(')'): 67 | inside_visuals_block = False 68 | continue 69 | # 处理collisions部分 70 | if inside_collisions_block and find_target_link: 71 | if instanceable_re.match(line): 72 | modified_lines.append(' instanceable = false\n') 73 | else: 74 | modified_lines.append(line) 75 | if line.strip().endswith(')'): 76 | inside_collisions_block = False 77 | find_target_link = False 78 | continue 79 | # 其他行直接添加 80 | else: 81 | modified_lines.append(line) 82 | continue 83 | 84 | # 保存修改后的内容 85 | with open(output_file, 'w', encoding='utf-8') as f: 86 | f.writelines(modified_lines) 87 | 88 | def main(): 89 | """主函数""" 90 | # 使用方法 91 | target_links = [ 92 | "right_hand_index_0_link", 93 | "right_hand_index_1_link", 94 | "right_hand_middle_0_link", 95 | "right_hand_middle_1_link", 96 | "right_hand_thumb_0_link", 97 | "right_hand_thumb_1_link", 98 | "right_hand_thumb_2_link", 99 | "left_hand_index_0_link", 100 | "left_hand_index_1_link", 101 | "left_hand_middle_0_link", 102 | "left_hand_middle_1_link", 103 | "left_hand_thumb_0_link", 104 | "left_hand_thumb_1_link", 105 | "left_hand_thumb_2_link", 106 | 107 | 108 | ] 109 | 110 | input_file = "/home/unitree/newDisk/URDF/urdf-to-usd/g1withdex3/g1_29dof_with_hand_rev_1_0.usda" 111 | output_file = "/home/unitree/newDisk/URDF/urdf-to-usd/g1withdex3/g1_29dof_with_hand_rev_1_0_edit.usda" 112 | 113 | try: 114 | modify_usda_file(input_file, output_file, target_links) 115 | logger.info(f"文件处理完成,已保存到: {output_file}") 116 | except Exception as e: 117 | logger.error(f"程序执行失败: {str(e)}") 118 | sys.exit(1) 119 | 120 | if __name__ == "__main__": 121 | main() 122 | -------------------------------------------------------------------------------- /tools/get_reward.py: -------------------------------------------------------------------------------- 1 | # 2 | # 实用函数:如何获取奖励值 3 | ## 4 | import torch 5 | 6 | def get_step_reward_value(env) -> torch.Tensor: 7 | """ 8 | 快速获取当前环境的总奖励值 9 | 10 | Args: 11 | env: ManagerBasedRLEnv 环境实例 12 | 13 | Returns: 14 | torch.Tensor: 当前的总奖励值,如果失败返回零张量 15 | """ 16 | try: 17 | if hasattr(env, 'reward_manager'): 18 | return env.reward_manager.get_active_iterable_terms(0)[0][1][0]#.compute(dt=dt) 19 | else: 20 | return torch.zeros(env.num_envs, device=env.device) 21 | except Exception as e: 22 | print(f"获取奖励值时出错: {e}") 23 | return torch.zeros(env.num_envs, device=env.device) 24 | 25 | 26 | def get_current_rewards(env) -> dict: 27 | """ 28 | 获取当前环境的奖励值 29 | 30 | Args: 31 | env: ManagerBasedRLEnv 环境实例 32 | 33 | Returns: 34 | dict: 包含奖励信息的字典 35 | """ 36 | 37 | try: 38 | # 方法1: 通过奖励管理器计算当前奖励 39 | if hasattr(env, 'reward_manager'): 40 | # Isaac Lab 的奖励管理器需要 dt 参数 41 | dt = env.physics_dt if hasattr(env, 'physics_dt') else 0.02 # 默认使用 0.02 秒 42 | current_rewards = env.reward_manager.compute(dt=dt) 43 | return current_rewards 44 | 45 | # print(f"current_rewards: {current_rewards}") 46 | 47 | except Exception as e: 48 | print(f"获取奖励值时出错: {e}") 49 | return torch.zeros(env.num_envs, device=env.device) 50 | 51 | 52 | --------------------------------------------------------------------------------