diff --git a/Isaac_sim/extension.toml b/Isaac_sim/extension.toml deleted file mode 100644 index 7d1ebe6..0000000 --- a/Isaac_sim/extension.toml +++ /dev/null @@ -1,97 +0,0 @@ -[core] -reloadable = true -order = 0 - -[package] -version = "11.3.0" -category = "Simulation" -title = "Isaac Sim Isaac Sensor Simulation" -description = "Support physics based sensors, such as contact sensors and imu sensors" -authors = ["NVIDIA"] -repository = "" -keywords = ["isaac", "physics", "robotics"] -changelog = "docs/CHANGELOG.md" -readme = "docs/README.md" -preview_image = "data/preview.png" -icon = "data/icon.png" -writeTarget.kit = true - -[dependencies] -"omni.kit.uiapp" = {} -"omni.physx" = {} -"omni.timeline" = {} # Needed for simulation to occur -"omni.kit.numpy.common" = {} -"omni.kit.pip_archive" = {} # pulls in numpy -"omni.isaac.ui" = {} -"omni.isaac.core" = {} -"omni.isaac.range_sensor" = {} -"omni.isaac.core_nodes" = {} -"omni.usd.schema.isaac" = {} -"omni.graph" = {} -"omni.graph.action" = {} -"omni.syntheticdata" = {} -"omni.replicator.core" = {} -"omni.usd" = {} # needed for call to add aov -"usdrt.scenegraph" = {} -"omni.sensors.nv.common" = {} -"omni.sensors.nv.lidar" = {} -"omni.sensors.nv.radar" = {} -"omni.isaac.nucleus" = {} - -[[python.module]] -name = "omni.isaac.sensor" - -[[python.module]] -name = "omni.isaac.sensor.tests" -public = false - -[[python.module]] -name = "omni.isaac.sensor.scripts.samples.contact_sensor" - -[[python.module]] -name = "omni.isaac.sensor.scripts.samples.imu_sensor" - -[[native.plugin]] -path = "bin/*.plugin" -recursive = false - -[settings] -app.sensors.nv.lidar.profileBaseFolder=[ - "${app}/../extsbuild/omni.sensors.nv.common/data/lidar/", - "${app}/../exts/omni.isaac.sensor/data/lidar_configs/HESAI/", - "${app}/../exts/omni.isaac.sensor/data/lidar_configs/NVIDIA/", - "${app}/../exts/omni.isaac.sensor/data/lidar_configs/Ouster/OS0/", - "${app}/../exts/omni.isaac.sensor/data/lidar_configs/Ouster/OS1/", - "${app}/../exts/omni.isaac.sensor/data/lidar_configs/Ouster/OS2/", - "${app}/../exts/omni.isaac.sensor/data/lidar_configs/SICK/", - "${app}/../exts/omni.isaac.sensor/data/lidar_configs/SLAMTEC/", - "${app}/../exts/omni.isaac.sensor/data/lidar_configs/Velodyne/", - "${app}/../exts/omni.isaac.sensor/data/lidar_configs/ZVISION/", - "${app}/../exts/omni.isaac.sensor/data/lidar_configs/Unitree/", - "${app}/../exts/omni.isaac.sensor/data/lidar_configs/"] -# app.sensors.nv.lidar.outputBufferOnGPU = true -app.sensors.nv.radar.runWithoutMBVH = false -app.sensors.nv.lidar.enableVelocity=true -rtx.rtxsensor.coordinateFrameQuaternion = "0.0,0.0,0.0,1.0" -# sensor material mapping is hard coded for now, and this is needed to enable sensor materials. -rtx.materialDb.rtSensorNameToIdMap="DefaultMaterial:0;AsphaltStandardMaterial:1;AsphaltWeatheredMaterial:2;VegetationGrassMaterial:3;WaterStandardMaterial:4;GlassStandardMaterial:5;FiberGlassMaterial:6;MetalAlloyMaterial:7;MetalAluminumMaterial:8;MetalAluminumOxidizedMaterial:9;PlasticStandardMaterial:10;RetroMarkingsMaterial:11;RetroSignMaterial:12;RubberStandardMaterial:13;SoilClayMaterial:14;ConcreteRoughMaterial:15;ConcreteSmoothMaterial:16;OakTreeBarkMaterial:17;FabricStandardMaterial:18;PlexiGlassStandardMaterial:19;MetalSilverMaterial:20" -renderer.raytracingMotion.enabled=true - -[[test]] -timeout=1200 -dependencies = [ - "omni.hydra.rtx", # "omni.hydra.pxr", Can we run and pass with Storm ? - "omni.kit.viewport.utility", - "omni.kit.viewport.window", - "omni.kit.primitive.mesh", - "omni.kit.material.library", -] - -stdoutFailPatterns.exclude = [ - # This is excluded in at least 3 kit tests. - "*Missing call to destroyResourceBindingSignature()*", - '*[Error] [omni.graph.core.plugin] /TestGraph/Template_omni_isaac_sensor_IsaacReadContactSensor: [/TestGraph] Invalid contact sensor prim*', - '*[Error] [omni.graph.core.plugin] /TestGraph/Template_omni_isaac_sensor_IsaacReadEffortSensor: [/TestGraph] OmniGraph Error: Failed to create effort sensor, unable to find prim path*', - '*[Error] [omni.graph.core.plugin] /TestGraph/Template_omni_isaac_sensor_IsaacReadIMU: [/TestGraph] Invalid Imu sensor prim*', - '*[Error] [carb] [Plugin: omni.sensors.nv.lidar.ext.plugin] Dependency: [omni::sensors::lidar::IGenericModelOutputIOFactory v0.1] failed to be resolved.*' -] diff --git a/README.md b/README.md index 4767de0..ad6dc40 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,12 @@ # Welcome to the Unitree Go2/G1 Digital Twins Project! -[![IsaacSim](https://img.shields.io/badge/IsaacSim-4.0-silver.svg)](https://docs.omniverse.nvidia.com/isaacsim/latest/overview.html) +[![IsaacSim](https://img.shields.io/badge/IsaacSim-orbit-gold.svg)](https://docs.omniverse.nvidia.com/isaacsim/latest/overview.html) [![Python](https://img.shields.io/badge/python-3.10-blue.svg)](https://docs.python.org/3/whatsnew/3.10.html) [![Linux platform](https://img.shields.io/badge/platform-linux--64-orange.svg)](https://releases.ubuntu.com/22.04/) [![License](https://img.shields.io/badge/license-BSD--2-yellow.svg)](https://opensource.org/licenses/BSD-2-Clause) -We are thrilled to announce that the Unitree Go2/G1 robot has now been integrated with the Nvidia Isaac Sim 4.0 (Isaac Lab), marking a major step forward in robotics research and development. The combination of these two cutting-edge technologies opens up a world of possibilities for creating and testing algorithms in a variety of simulated environments. +We are thrilled to announce that the Unitree Go2/G1 robot has now been integrated with the Nvidia Isaac Sim (Orbit), marking a major step forward in robotics research and development. The combination of these two cutting-edge technologies opens up a world of possibilities for creating and testing algorithms in a variety of simulated environments. Get ready to take your research to the next level with this powerful new resource at your fingertips! @@ -101,22 +101,35 @@ Together, let's push the boundaries of what's possible with the Unitree Go2/G1 a ## System requirements You need to install: 1. Ubuntu 22.04 -2. Nvidia Isaac Sim 4.0 -3. Nvidia Isaac Lab +2. Nvidia Isaac Sim 2023.1.1 +3. Nvidia Orbit 0.3.0 4. Ros2 Humble Full instruction: ``` -https://isaac-sim.github.io/IsaacLab/source/setup/installation/binaries_installation.html +1. Use this specific IsaacLab repo version: https://github.com/isaac-sim/IsaacLab/releases/tag/v0.3.1 +2. execute in ubuntu terminal: +export ISAACSIM_PATH="${HOME}/.local/share/ov/pkg/isaac-sim-2023.1.1" +export ISAACSIM_PYTHON_EXE="${ISAACSIM_PATH}/python.sh" +and also put it inside .bashrc file +3. Inside the root folder of Orbit repo (https://github.com/isaac-sim/IsaacLab/releases/tag/v0.3.1) execute ln -s ${ISAACSIM_PATH} _isaac_sim +4. ./orbit.sh --conda +5. conda activate orbit +6. sudo apt install cmake build-essential +7. ./orbit.sh --install +8. ./orbit.sh --extra rsl_rl +9. verify the installation using "python source/standalone/tutorials/00_sim/create_empty.py" You should be inside conda env. +10. You need to check that you have "Isaac Sim Python 2023.1.1 - New Stage*" on the top of the window. +11. go to the current repo project (this repo) +12. execute ./run_sim.sh ``` Some suggestions: -1. You need to check nvidia-smi, it should work, before installing Isaac Sim 4.0 +1. You need to check nvidia-smi, it should work, before installing Isaac Sim (Orbit) 2. You need to install Miniconda and execute: conda config --set auto_activate_base false -3. Install Omniverse launcher and then install Isaac Sim 4.0. -4. Create conda env then activate it, also execute ./isaaclab.sh --install -Also, you need to install ROS2 on your system and configure it: +3. Install Omniverse launcher and then install Isaac Sim (Orbit). +4. You need to install ROS2 on your system and configure it: ``` https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_ros.html#isaac-sim-app-install-ros @@ -136,13 +149,11 @@ git clone https://github.com/abizovnuralem/go2_omniverse/ --recurse-submodules - First, you need to copy files from Isaac Sim folder to your local Isaac Sim installation in order to use Unitree L1 lidar inside Orbit. ``` -1. You need to replace original file that located in ~/.local/share/ov/pkg/isaac-sim-4.0.0/exts/omni.isaac.sensor/config/extrensiom.toml -with Isaac_sim/extension.toml in this repo. -2. You need to add Unitree_L1.json to IsaacLab repo folder, where IsaacLab/source/exts/omni.isaac.sensor/data/lidar_configs/Unitree/Unitree_L1.json will be the final path (If it doesnt exists, create it) +1. You need to add Unitree_L1.json to IsaacLab (Orbit) repo folder, where IsaacLab-0.3.1/source/data/sensors/lidar/Unitree/Unitree_L1.json will be the final path (If it doesnt exists, create it) ``` ## Usage -The current project was tested on Ubuntu 22.04, IsaacSim 4.0 with Isaac Lab and Nvidia Driver Version: 545. +The current project was tested on Ubuntu 22.04, IsaacSim 2023.1.1 with Orbit 0.3.0 and Nvidia Driver Version: 545. To start the project with Unitree GO2, execute: ``` @@ -165,7 +176,7 @@ You can use https://github.com/abizovnuralem/go2_ros2_sdk as a basement for your ## Select custom env To use predifined custom envs, you need to download files from https://drive.google.com/drive/folders/1vVGuO1KIX1K6mD6mBHDZGm9nk2vaRyj3?usp=sharing and place them to /envs folder. -Then you can execute it via python main.py --custom_env=office or python main.py --custom_env=warehouse commands (The whole cmd you can read from run_sim script). If you are doing it first time, it will take 2-3 minutes to configure the env. Please, wait. +Then you can execute it modifying run_sim.sh script with --custom_env=office and --terrain flat commands. If you are doing it first time, it will take 2-3 minutes to configure the env. Please, wait. ## Development @@ -183,8 +194,12 @@ I have tested it on: 5. Execute IsaacSim, Go to Window -> Extensions, find STEAMVR INPUT/OUTPUT then enable it and enable AutoLoad. Reopen IsaacSim. Use OpenXR mode. 6. Enjoy Omniverse in VR mode! + ## Thanks -Special thanks to Leul Tesfaye for his expertise in Orbit lidars and Tamas @tfoldi for contributing to this project. +Special thanks to +1. Leul Tesfaye for his expertise in Orbit lidars; +2. Tamas @tfoldi for contributing to this project; +3. @ShaoshuSu for his hardwork in investigating the speed issues with new version of Orbit (IsaacLab 4.0 and 4.1); ## License diff --git a/cli_args.py b/cli_args.py index 8fe2758..2a51774 100644 --- a/cli_args.py +++ b/cli_args.py @@ -9,7 +9,7 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from omni.isaac.lab_tasks.utils.wrappers.rsl_rl import RslRlOnPolicyRunnerCfg + from omni.isaac.orbit_tasks.utils.wrappers.rsl_rl import RslRlOnPolicyRunnerCfg def add_rsl_rl_args(parser: argparse.ArgumentParser): @@ -48,7 +48,7 @@ def parse_rsl_rl_cfg(task_name: str, args_cli: argparse.Namespace) -> RslRlOnPol Returns: The parsed configuration for RSL-RL agent based on inputs. """ - from omni.isaac.lab_tasks.utils.parse_cfg import load_cfg_from_registry + from omni.isaac.orbit_tasks.utils.parse_cfg import load_cfg_from_registry # load the default configuration rslrl_cfg: RslRlOnPolicyRunnerCfg = load_cfg_from_registry(task_name, "rsl_rl_cfg_entry_point") diff --git a/custom_rl_env.py b/custom_rl_env.py index e1a8b93..d6785e8 100644 --- a/custom_rl_env.py +++ b/custom_rl_env.py @@ -26,36 +26,39 @@ import torch from dataclasses import MISSING from typing import Literal - - -from omni.isaac.lab.envs import ManagerBasedRLEnvCfg -from omni.isaac.lab.utils import configclass - -import omni.isaac.lab.sim as sim_utils -from omni.isaac.lab.assets import ArticulationCfg, AssetBaseCfg -from omni.isaac.lab.scene import InteractiveSceneCfg -from omni.isaac.lab.sensors import ContactSensorCfg, RayCasterCfg, patterns -from omni.isaac.lab.terrains import TerrainImporterCfg -from omni.isaac.lab.utils import configclass -from omni.isaac.lab_assets.unitree import UNITREE_GO2_CFG -from omni.isaac.lab.managers import EventTermCfg as EventTerm -from omni.isaac.lab.managers import ObservationGroupCfg as ObsGroup -from omni.isaac.lab.managers import ObservationTermCfg as ObsTerm -from omni.isaac.lab.managers import RewardTermCfg as RewTerm -from omni.isaac.lab.managers import SceneEntityCfg -from omni.isaac.lab.managers import TerminationTermCfg as DoneTerm -from omni.isaac.lab.utils import configclass -from omni.isaac.lab.utils.noise import AdditiveUniformNoiseCfg as Unoise -import omni.isaac.lab_tasks.manager_based.locomotion.velocity.mdp as mdp - - +import argparse + + +from omni.isaac.orbit.envs import RLTaskEnvCfg +from omni.isaac.orbit.utils import configclass + +import omni.isaac.orbit.sim as sim_utils +from omni.isaac.orbit.assets import ArticulationCfg, AssetBaseCfg +from omni.isaac.orbit.scene import InteractiveSceneCfg +from omni.isaac.orbit.sensors import ContactSensorCfg, RayCasterCfg, patterns +from omni.isaac.orbit.terrains import TerrainImporterCfg +from omni.isaac.orbit.utils import configclass +from omni.isaac.orbit_assets.unitree import UNITREE_GO2_CFG +from omni.isaac.orbit.managers import EventTermCfg as EventTerm +from omni.isaac.orbit.managers import ObservationGroupCfg as ObsGroup +from omni.isaac.orbit.managers import ObservationTermCfg as ObsTerm +from omni.isaac.orbit.managers import RewardTermCfg as RewTerm +from omni.isaac.orbit.managers import SceneEntityCfg +from omni.isaac.orbit.managers import TerminationTermCfg as DoneTerm +from omni.isaac.orbit.utils import configclass +from omni.isaac.orbit.utils.noise import AdditiveUniformNoiseCfg as Unoise +import omni.isaac.orbit_tasks.locomotion.velocity.mdp as mdp + +from terrain_cfg import ROUGH_TERRAINS_CFG from robots.g1.config import G1_CFG +from omniverse_sim import args_cli + base_command = {} -def constant_commands(env: ManagerBasedRLEnvCfg) -> torch.Tensor: +def constant_commands(env: RLTaskEnvCfg) -> torch.Tensor: global base_command """The generated command from the command generator.""" tensor_lst = torch.tensor([0, 0, 0], device=env.device).repeat(env.num_envs, 1) @@ -68,12 +71,27 @@ def constant_commands(env: ManagerBasedRLEnvCfg) -> torch.Tensor: class MySceneCfg(InteractiveSceneCfg): """Configuration for the terrain scene with a legged robot.""" - # ground terrain - terrain = TerrainImporterCfg( + if args_cli.terrain == "flat": + + # flat terrain + terrain = TerrainImporterCfg( + prim_path="/World/ground", + terrain_type="plane", + debug_vis=False, + ) + else: + terrain = TerrainImporterCfg( prim_path="/World/ground", - terrain_type="plane", + terrain_type="generator", + terrain_generator=ROUGH_TERRAINS_CFG, + physics_material=sim_utils.RigidBodyMaterialCfg( + friction_combine_mode="multiply", + restitution_combine_mode="multiply", + static_friction=1.0, + dynamic_friction=1.0, + ), debug_vis=False, - ) + ) # robots robot: ArticulationCfg = MISSING @@ -238,7 +256,7 @@ class EventCfg: @configclass -class LocomotionVelocityRoughEnvCfg(ManagerBasedRLEnvCfg): +class LocomotionVelocityRoughEnvCfg(RLTaskEnvCfg): """Configuration for the locomotion velocity-tracking environment.""" # Scene settings scene: MySceneCfg = MySceneCfg(num_envs=4096, env_spacing=2.5) diff --git a/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/events.out.tfevents.1717430996.brimo-Z690-UD-DDR4.984904.0 b/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/events.out.tfevents.1717430996.brimo-Z690-UD-DDR4.984904.0 deleted file mode 100644 index 68e6eda..0000000 Binary files a/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/events.out.tfevents.1717430996.brimo-Z690-UD-DDR4.984904.0 and /dev/null differ diff --git a/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/exported/policy.onnx b/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/exported/policy.onnx deleted file mode 100644 index f66b3c3..0000000 Binary files a/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/exported/policy.onnx and /dev/null differ diff --git a/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/exported/policy.pt b/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/exported/policy.pt deleted file mode 100644 index 5016764..0000000 Binary files a/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/exported/policy.pt and /dev/null differ diff --git a/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/git/IsaacLab.diff b/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/git/IsaacLab.diff deleted file mode 100644 index 951901b..0000000 --- a/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/git/IsaacLab.diff +++ /dev/null @@ -1,241 +0,0 @@ ---- git status --- -On branch main -Your branch is up to date with 'origin/main'. - -Changes not staged for commit: - (use "git add ..." to update what will be committed) - (use "git restore ..." to discard changes in working directory) - modified: source/extensions/omni.isaac.lab_assets/omni/isaac/lab_assets/unitree.py - modified: source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/locomotion/velocity/mdp/rewards.py - modified: source/standalone/workflows/rsl_rl/train.py - -Untracked files: - (use "git add ..." to include in what will be committed) - source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/locomotion/velocity/config/g1/ - source/exts/ - -no changes added to commit (use "git add" and/or "git commit -a") - - ---- git diff --- -diff --git a/source/extensions/omni.isaac.lab_assets/omni/isaac/lab_assets/unitree.py b/source/extensions/omni.isaac.lab_assets/omni/isaac/lab_assets/unitree.py -index 8533010..43f55b2 100644 ---- a/source/extensions/omni.isaac.lab_assets/omni/isaac/lab_assets/unitree.py -+++ b/source/extensions/omni.isaac.lab_assets/omni/isaac/lab_assets/unitree.py -@@ -265,3 +265,160 @@ H1_MINIMAL_CFG.spawn.usd_path = f"{ISAACLAB_NUCLEUS_DIR}/Robots/Unitree/H1/h1_mi - - This configuration removes most collision meshes to speed up simulation. - """ -+ -+ -+ -+G1_CFG = ArticulationCfg( -+ spawn=sim_utils.UsdFileCfg( -+ usd_path="/home/brimo/Desktop/g1/g1_t.usd", -+ activate_contact_sensors=True, -+ rigid_props=sim_utils.RigidBodyPropertiesCfg( -+ disable_gravity=False, -+ retain_accelerations=False, -+ linear_damping=0.0, -+ angular_damping=0.0, -+ max_linear_velocity=1000.0, -+ max_angular_velocity=1000.0, -+ max_depenetration_velocity=1.0, -+ ), -+ articulation_props=sim_utils.ArticulationRootPropertiesCfg( -+ enabled_self_collisions=False, solver_position_iteration_count=4, solver_velocity_iteration_count=4 -+ ), -+ ), -+ init_state=ArticulationCfg.InitialStateCfg( -+ pos=(0.0, 0.0, 0.70), -+ joint_pos={ -+ -+ ".*_hip_pitch_joint": -0.28, -+ ".*_knee_joint": 0.63, -+ ".*_ankle_pitch_joint": -0.35, -+ -+ ".*_elbow_pitch_joint": 0.87, -+ "left_shoulder_roll_joint": 0.16, -+ "left_shoulder_pitch_joint": 0.35, -+ -+ "right_shoulder_roll_joint": -0.16, -+ "right_shoulder_pitch_joint": 0.35, -+ -+ "left_one_joint": 1.0, -+ "right_one_joint": -1.0, -+ -+ -+ }, -+ joint_vel={".*": 0.0}, -+ ), -+ soft_joint_pos_limit_factor=0.9, -+ actuators={ -+ "legs": ImplicitActuatorCfg( -+ joint_names_expr=[ -+ ".*_hip_yaw_joint", -+ ".*_hip_roll_joint", -+ ".*_hip_pitch_joint", -+ ".*_knee_joint", -+ "torso_joint" -+ ], -+ effort_limit=300, -+ velocity_limit=100.0, -+ stiffness={ -+ ".*_hip_yaw_joint": 150.0, -+ ".*_hip_roll_joint": 150.0, -+ ".*_hip_pitch_joint": 200.0, -+ ".*_knee_joint": 200.0, -+ "torso_joint": 200.0, -+ }, -+ damping={ -+ ".*_hip_yaw_joint": 5.0, -+ ".*_hip_roll_joint": 5.0, -+ ".*_hip_pitch_joint": 5.0, -+ ".*_knee_joint": 5.0, -+ "torso_joint": 5.0, -+ }, -+ armature={ -+ ".*_hip_yaw_joint": 0.1, -+ ".*_hip_roll_joint": 0.1, -+ ".*_hip_pitch_joint": 0.1, -+ ".*_knee_joint": 0.1, -+ "torso_joint": 0.1, -+ }, -+ ), -+ "feet": ImplicitActuatorCfg( -+ joint_names_expr=[ -+ ".*_ankle_pitch_joint", -+ ".*_ankle_roll_joint" -+ ], -+ stiffness={ -+ ".*_ankle_pitch_joint": 20.0, -+ ".*_ankle_roll_joint": 20.0 -+ }, -+ damping={ -+ ".*_ankle_pitch_joint": 4.0, -+ ".*_ankle_roll_joint": 4.0 -+ }, -+ armature={ -+ ".*_ankle_pitch_joint": 0.1, -+ ".*_ankle_roll_joint": 0.1 -+ }, -+ ), -+ "arms": ImplicitActuatorCfg( -+ joint_names_expr=[ -+ ".*_shoulder_pitch_joint", -+ ".*_shoulder_roll_joint", -+ ".*_shoulder_yaw_joint", -+ ".*_elbow_pitch_joint", -+ ".*_elbow_roll_joint", -+ ".*_five_joint", -+ ".*_three_joint", -+ ".*_six_joint", -+ ".*_four_joint", -+ ".*_zero_joint", -+ ".*_one_joint", -+ ".*_two_joint" -+ ], -+ effort_limit=300, -+ velocity_limit=100.0, -+ stiffness={ -+ ".*_shoulder_pitch_joint": 40.0, -+ ".*_shoulder_roll_joint": 40.0, -+ ".*_shoulder_yaw_joint": 40.0, -+ ".*_elbow_pitch_joint": 40.0, -+ ".*_elbow_roll_joint": 40.0, -+ ".*_five_joint": 40.0, -+ ".*_three_joint": 40.0, -+ ".*_six_joint": 40.0, -+ ".*_four_joint": 40.0, -+ ".*_zero_joint": 40.0, -+ ".*_one_joint": 40.0, -+ ".*_two_joint": 40.0, -+ }, -+ damping={ -+ ".*_shoulder_pitch_joint": 10.0, -+ ".*_shoulder_roll_joint": 10.0, -+ ".*_shoulder_yaw_joint": 10.0, -+ ".*_elbow_pitch_joint": 10.0, -+ ".*_elbow_roll_joint": 10.0, -+ ".*_five_joint": 10.0, -+ ".*_three_joint": 10.0, -+ ".*_six_joint": 10.0, -+ ".*_four_joint": 10.0, -+ ".*_zero_joint": 10.0, -+ ".*_one_joint": 10.0, -+ ".*_two_joint": 10.0, -+ }, -+ armature={ -+ ".*_shoulder_pitch_joint": 0.1, -+ ".*_shoulder_roll_joint": 0.1, -+ ".*_shoulder_yaw_joint": 0.1, -+ ".*_elbow_pitch_joint": 0.1, -+ ".*_elbow_roll_joint": 0.1, -+ ".*_five_joint": 0.1, -+ ".*_three_joint": 0.1, -+ ".*_six_joint": 0.1, -+ ".*_four_joint": 0.1, -+ ".*_zero_joint": 0.1, -+ ".*_one_joint": 0.1, -+ ".*_two_joint": 0.1, -+ }, -+ ), -+ }, -+) -+"""Configuration for the Unitree G1 Humanoid robot.""" -diff --git a/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/locomotion/velocity/mdp/rewards.py b/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/locomotion/velocity/mdp/rewards.py -index b3a1756..96d2612 100644 ---- a/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/locomotion/velocity/mdp/rewards.py -+++ b/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/locomotion/velocity/mdp/rewards.py -@@ -47,6 +47,7 @@ def feet_air_time_positive_biped(env, command_name: str, threshold: float, senso - If the commands are small (i.e. the agent is not supposed to take a step), then the reward is zero. - """ - contact_sensor: ContactSensor = env.scene.sensors[sensor_cfg.name] -+ - # compute the reward - air_time = contact_sensor.data.current_air_time[:, sensor_cfg.body_ids] - contact_time = contact_sensor.data.current_contact_time[:, sensor_cfg.body_ids] -@@ -60,6 +61,28 @@ def feet_air_time_positive_biped(env, command_name: str, threshold: float, senso - return reward - - -+def feet_leave_ground(env, sensor_cfg: SceneEntityCfg, threshold: float) -> torch.Tensor: -+ """ -+ Terminate if the robot's feet have left the ground. -+ -+ Args: -+ env: The environment containing the sensors. -+ threshold (float): The threshold below which a contact force is considered as the feet having left the ground. -+ sensor_cfg (SceneEntityCfg): Configuration for the contact sensor. -+ -+ Returns: -+ torch.Tensor: A tensor indicating whether the feet have left the ground for each instance. -+ """ -+ contact_sensor = env.scene.sensors[sensor_cfg.name] -+ contact_forces = contact_sensor.data.net_forces_w[:, sensor_cfg.body_ids].norm(dim=-1) -+ -+ # Check if contact forces are below the threshold -+ feet_off_ground = torch.all(contact_forces < threshold, dim=1) -+ -+ return feet_off_ground -+ -+ -+ - def feet_slide(env, sensor_cfg: SceneEntityCfg, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor: - # Penalize feet sliding - contact_sensor: ContactSensor = env.scene.sensors[sensor_cfg.name] -diff --git a/source/standalone/workflows/rsl_rl/train.py b/source/standalone/workflows/rsl_rl/train.py -index 748d9bd..d351b2a 100644 ---- a/source/standalone/workflows/rsl_rl/train.py -+++ b/source/standalone/workflows/rsl_rl/train.py -@@ -24,8 +24,8 @@ parser.add_argument("--cpu", action="store_true", default=False, help="Use CPU p - parser.add_argument( - "--disable_fabric", action="store_true", default=False, help="Disable fabric and use USD I/O operations." - ) --parser.add_argument("--num_envs", type=int, default=None, help="Number of environments to simulate.") --parser.add_argument("--task", type=str, default=None, help="Name of the task.") -+parser.add_argument("--num_envs", type=int, default=1, help="Number of environments to simulate.") -+parser.add_argument("--task", type=str, default="Isaac-Velocity-Rough-G1-v0", help="Name of the task.") - parser.add_argument("--seed", type=int, default=None, help="Seed used for the environment") - parser.add_argument("--max_iterations", type=int, default=None, help="RL Policy training iterations.") - # append RSL-RL cli arguments \ No newline at end of file diff --git a/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/params/agent.pkl b/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/params/agent.pkl deleted file mode 100644 index 9db5224..0000000 Binary files a/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/params/agent.pkl and /dev/null differ diff --git a/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/params/agent.yaml b/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/params/agent.yaml deleted file mode 100644 index 4539c7d..0000000 --- a/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/params/agent.yaml +++ /dev/null @@ -1,40 +0,0 @@ -seed: 42 -device: cuda:0 -num_steps_per_env: 24 -max_iterations: 3000 -empirical_normalization: false -policy: - class_name: ActorCritic - init_noise_std: 1.0 - actor_hidden_dims: - - 512 - - 256 - - 128 - critic_hidden_dims: - - 512 - - 256 - - 128 - activation: elu -algorithm: - class_name: PPO - value_loss_coef: 1.0 - use_clipped_value_loss: true - clip_param: 0.2 - entropy_coef: 0.01 - num_learning_epochs: 5 - num_mini_batches: 4 - learning_rate: 0.001 - schedule: adaptive - gamma: 0.99 - lam: 0.95 - desired_kl: 0.01 - max_grad_norm: 1.0 -save_interval: 50 -experiment_name: h1_rough -run_name: '' -logger: tensorboard -neptune_project: isaaclab -wandb_project: isaaclab -resume: false -load_run: .* -load_checkpoint: model_.*.pt diff --git a/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/params/env.pkl b/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/params/env.pkl deleted file mode 100644 index ce7598e..0000000 Binary files a/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/params/env.pkl and /dev/null differ diff --git a/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/params/env.yaml b/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/params/env.yaml deleted file mode 100644 index 6079b2a..0000000 --- a/logs/rsl_rl/g1_rough/2024-06-03_21-09-07/params/env.yaml +++ /dev/null @@ -1,1000 +0,0 @@ -viewer: - eye: !!python/tuple - - 7.5 - - 7.5 - - 7.5 - lookat: !!python/tuple - - 0.0 - - 0.0 - - 0.0 - cam_prim_path: /OmniverseKit_Persp - resolution: !!python/tuple - - 1280 - - 720 - origin_type: world - env_index: 0 - asset_name: null -sim: - physics_prim_path: /physicsScene - dt: 0.005 - substeps: 1 - gravity: !!python/tuple - - 0.0 - - 0.0 - - -9.81 - enable_scene_query_support: false - use_fabric: true - disable_contact_processing: true - use_gpu_pipeline: true - device: cuda:0 - physx: - use_gpu: true - solver_type: 1 - min_position_iteration_count: 1 - max_position_iteration_count: 255 - min_velocity_iteration_count: 0 - max_velocity_iteration_count: 255 - enable_ccd: false - enable_stabilization: true - enable_enhanced_determinism: false - bounce_threshold_velocity: 0.5 - friction_offset_threshold: 0.04 - friction_correlation_distance: 0.025 - gpu_max_rigid_contact_count: 8388608 - gpu_max_rigid_patch_count: 163840 - gpu_found_lost_pairs_capacity: 2097152 - gpu_found_lost_aggregate_pairs_capacity: 33554432 - gpu_total_aggregate_pairs_capacity: 2097152 - gpu_collision_stack_size: 67108864 - gpu_heap_capacity: 67108864 - gpu_temp_buffer_capacity: 16777216 - gpu_max_num_partitions: 8 - gpu_max_soft_body_contacts: 1048576 - gpu_max_particle_contacts: 1048576 - physics_material: - func: omni.isaac.lab.sim.spawners.materials.physics_materials:spawn_rigid_body_material - static_friction: 1.0 - dynamic_friction: 1.0 - restitution: 0.0 - improve_patch_friction: true - friction_combine_mode: multiply - restitution_combine_mode: multiply - compliant_contact_stiffness: 0.0 - compliant_contact_damping: 0.0 -ui_window_class_type: omni.isaac.lab.envs.ui.manager_based_rl_env_window:ManagerBasedRLEnvWindow -decimation: 4 -scene: - num_envs: 4000 - env_spacing: 2.5 - lazy_sensor_update: true - replicate_physics: true - robot: - class_type: omni.isaac.lab.assets.articulation.articulation:Articulation - prim_path: /World/envs/env_.*/Robot - spawn: - func: omni.isaac.lab.sim.spawners.from_files.from_files:spawn_from_usd - visible: true - semantic_tags: null - copy_from_source: true - mass_props: null - rigid_props: - rigid_body_enabled: null - kinematic_enabled: null - disable_gravity: false - linear_damping: 0.0 - angular_damping: 0.0 - max_linear_velocity: 1000.0 - max_angular_velocity: 1000.0 - max_depenetration_velocity: 1.0 - max_contact_impulse: null - enable_gyroscopic_forces: null - retain_accelerations: false - solver_position_iteration_count: null - solver_velocity_iteration_count: null - sleep_threshold: null - stabilization_threshold: null - collision_props: null - activate_contact_sensors: true - scale: null - articulation_props: - articulation_enabled: null - enabled_self_collisions: false - solver_position_iteration_count: 4 - solver_velocity_iteration_count: 4 - sleep_threshold: null - stabilization_threshold: null - fix_root_link: null - fixed_tendons_props: null - joint_drive_props: null - visual_material_path: material - visual_material: null - usd_path: /home/brimo/Desktop/g1/g1_t.usd - variants: null - init_state: - pos: !!python/tuple - - 0.0 - - 0.0 - - 0.7 - rot: &id007 !!python/tuple - - 1.0 - - 0.0 - - 0.0 - - 0.0 - lin_vel: &id001 !!python/tuple - - 0.0 - - 0.0 - - 0.0 - ang_vel: *id001 - joint_pos: - .*_hip_pitch_joint: -0.28 - .*_knee_joint: 0.63 - .*_ankle_pitch_joint: -0.35 - .*_elbow_pitch_joint: 0.87 - left_shoulder_roll_joint: 0.16 - left_shoulder_pitch_joint: 0.35 - right_shoulder_roll_joint: -0.16 - right_shoulder_pitch_joint: 0.35 - left_one_joint: 1.0 - right_one_joint: -1.0 - joint_vel: - .*: 0.0 - collision_group: 0 - debug_vis: false - soft_joint_pos_limit_factor: 0.9 - actuators: - legs: - class_type: omni.isaac.lab.actuators.actuator_pd:ImplicitActuator - joint_names_expr: - - .*_hip_yaw_joint - - .*_hip_roll_joint - - .*_hip_pitch_joint - - .*_knee_joint - - torso_joint - effort_limit: 300 - velocity_limit: 100.0 - stiffness: - .*_hip_yaw_joint: 150.0 - .*_hip_roll_joint: 150.0 - .*_hip_pitch_joint: 200.0 - .*_knee_joint: 200.0 - torso_joint: 200.0 - damping: - .*_hip_yaw_joint: 5.0 - .*_hip_roll_joint: 5.0 - .*_hip_pitch_joint: 5.0 - .*_knee_joint: 5.0 - torso_joint: 5.0 - armature: - .*_hip_yaw_joint: 0.1 - .*_hip_roll_joint: 0.1 - .*_hip_pitch_joint: 0.1 - .*_knee_joint: 0.1 - torso_joint: 0.1 - friction: null - feet: - class_type: omni.isaac.lab.actuators.actuator_pd:ImplicitActuator - joint_names_expr: - - .*_ankle_pitch_joint - - .*_ankle_roll_joint - effort_limit: null - velocity_limit: null - stiffness: - .*_ankle_pitch_joint: 20.0 - .*_ankle_roll_joint: 20.0 - damping: - .*_ankle_pitch_joint: 4.0 - .*_ankle_roll_joint: 4.0 - armature: - .*_ankle_pitch_joint: 0.1 - .*_ankle_roll_joint: 0.1 - friction: null - arms: - class_type: omni.isaac.lab.actuators.actuator_pd:ImplicitActuator - joint_names_expr: - - .*_shoulder_pitch_joint - - .*_shoulder_roll_joint - - .*_shoulder_yaw_joint - - .*_elbow_pitch_joint - - .*_elbow_roll_joint - - .*_five_joint - - .*_three_joint - - .*_six_joint - - .*_four_joint - - .*_zero_joint - - .*_one_joint - - .*_two_joint - effort_limit: 300 - velocity_limit: 100.0 - stiffness: - .*_shoulder_pitch_joint: 40.0 - .*_shoulder_roll_joint: 40.0 - .*_shoulder_yaw_joint: 40.0 - .*_elbow_pitch_joint: 40.0 - .*_elbow_roll_joint: 40.0 - .*_five_joint: 40.0 - .*_three_joint: 40.0 - .*_six_joint: 40.0 - .*_four_joint: 40.0 - .*_zero_joint: 40.0 - .*_one_joint: 40.0 - .*_two_joint: 40.0 - damping: - .*_shoulder_pitch_joint: 10.0 - .*_shoulder_roll_joint: 10.0 - .*_shoulder_yaw_joint: 10.0 - .*_elbow_pitch_joint: 10.0 - .*_elbow_roll_joint: 10.0 - .*_five_joint: 10.0 - .*_three_joint: 10.0 - .*_six_joint: 10.0 - .*_four_joint: 10.0 - .*_zero_joint: 10.0 - .*_one_joint: 10.0 - .*_two_joint: 10.0 - armature: - .*_shoulder_pitch_joint: 0.1 - .*_shoulder_roll_joint: 0.1 - .*_shoulder_yaw_joint: 0.1 - .*_elbow_pitch_joint: 0.1 - .*_elbow_roll_joint: 0.1 - .*_five_joint: 0.1 - .*_three_joint: 0.1 - .*_six_joint: 0.1 - .*_four_joint: 0.1 - .*_zero_joint: 0.1 - .*_one_joint: 0.1 - .*_two_joint: 0.1 - friction: null - terrain: - class_type: omni.isaac.lab.terrains.terrain_importer:TerrainImporter - collision_group: -1 - prim_path: /World/ground - num_envs: 4000 - terrain_type: generator - terrain_generator: - seed: null - curriculum: true - size: &id002 !!python/tuple - - 8.0 - - 8.0 - border_width: 20.0 - num_rows: 10 - num_cols: 20 - color_scheme: none - horizontal_scale: 0.1 - vertical_scale: 0.005 - slope_threshold: 0.75 - sub_terrains: - pyramid_stairs: - function: omni.isaac.lab.terrains.trimesh.mesh_terrains:pyramid_stairs_terrain - proportion: 0.2 - size: *id002 - flat_patch_sampling: null - border_width: 1.0 - step_height_range: &id003 !!python/tuple - - 0.05 - - 0.23 - step_width: 0.3 - platform_width: 3.0 - holes: false - difficulty: 0.9101332163955329 - seed: null - pyramid_stairs_inv: - function: omni.isaac.lab.terrains.trimesh.mesh_terrains:inverted_pyramid_stairs_terrain - proportion: 0.2 - size: *id002 - flat_patch_sampling: null - border_width: 1.0 - step_height_range: *id003 - step_width: 0.3 - platform_width: 3.0 - holes: false - difficulty: 0.9622590091384875 - seed: null - boxes: - function: omni.isaac.lab.terrains.trimesh.mesh_terrains:random_grid_terrain - proportion: 0.2 - size: *id002 - flat_patch_sampling: null - grid_width: 0.45 - grid_height_range: !!python/tuple - - 0.05 - - 0.2 - platform_width: 2.0 - holes: false - difficulty: 0.960900481960645 - seed: null - random_rough: - function: omni.isaac.lab.terrains.height_field.hf_terrains:random_uniform_terrain - proportion: 0.2 - size: *id002 - flat_patch_sampling: null - border_width: 0.25 - horizontal_scale: 0.1 - vertical_scale: 0.005 - slope_threshold: 0.75 - noise_range: !!python/tuple - - 0.02 - - 0.1 - noise_step: 0.02 - downsampled_scale: 0.1 - difficulty: 0.9047819893099118 - seed: null - hf_pyramid_slope: - function: omni.isaac.lab.terrains.height_field.hf_terrains:pyramid_sloped_terrain - proportion: 0.1 - size: *id002 - flat_patch_sampling: null - border_width: 0.25 - horizontal_scale: 0.1 - vertical_scale: 0.005 - slope_threshold: 0.75 - slope_range: &id004 !!python/tuple - - 0.0 - - 0.4 - platform_width: 2.0 - inverted: false - difficulty: 0.9953595843373787 - seed: null - hf_pyramid_slope_inv: - function: omni.isaac.lab.terrains.height_field.hf_terrains:pyramid_sloped_terrain - proportion: 0.1 - size: *id002 - flat_patch_sampling: null - border_width: 0.25 - horizontal_scale: 0.1 - vertical_scale: 0.005 - slope_threshold: 0.75 - slope_range: *id004 - platform_width: 2.0 - inverted: true - difficulty: 0.9935496413387149 - seed: null - difficulty_range: !!python/tuple - - 0.0 - - 1.0 - use_cache: false - cache_dir: /tmp/isaaclab/terrains - usd_path: null - env_spacing: 2.5 - visual_material: - func: omni.isaac.lab.sim.spawners.materials.visual_materials:spawn_from_mdl_file - mdl_path: http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/4.0/Isaac/IsaacLab/Materials/TilesMarbleSpiderWhiteBrickBondHoned/TilesMarbleSpiderWhiteBrickBondHoned.mdl - project_uvw: true - albedo_brightness: null - texture_scale: !!python/tuple - - 0.25 - - 0.25 - physics_material: - func: omni.isaac.lab.sim.spawners.materials.physics_materials:spawn_rigid_body_material - static_friction: 1.0 - dynamic_friction: 1.0 - restitution: 0.0 - improve_patch_friction: true - friction_combine_mode: multiply - restitution_combine_mode: multiply - compliant_contact_stiffness: 0.0 - compliant_contact_damping: 0.0 - max_init_terrain_level: 5 - debug_vis: false - height_scanner: - class_type: omni.isaac.lab.sensors.ray_caster.ray_caster:RayCaster - prim_path: /World/envs/env_.*/Robot/torso_link - update_period: 0.02 - history_length: 0 - debug_vis: false - mesh_prim_paths: - - /World/ground - offset: - pos: !!python/tuple - - 0.0 - - 0.0 - - 20.0 - rot: !!python/tuple - - 1.0 - - 0.0 - - 0.0 - - 0.0 - attach_yaw_only: true - pattern_cfg: - func: omni.isaac.lab.sensors.ray_caster.patterns.patterns:grid_pattern - resolution: 0.1 - size: - - 1.6 - - 1.0 - direction: !!python/tuple - - 0.0 - - 0.0 - - -1.0 - ordering: xy - max_distance: 1000000.0 - drift_range: !!python/tuple - - 0.0 - - 0.0 - visualizer_cfg: - prim_path: /Visuals/RayCaster - markers: - hit: - func: omni.isaac.lab.sim.spawners.shapes.shapes:spawn_sphere - visible: true - semantic_tags: null - copy_from_source: true - mass_props: null - rigid_props: null - collision_props: null - activate_contact_sensors: false - visual_material_path: material - visual_material: - func: omni.isaac.lab.sim.spawners.materials.visual_materials:spawn_preview_surface - diffuse_color: &id005 !!python/tuple - - 1.0 - - 0.0 - - 0.0 - emissive_color: &id006 !!python/tuple - - 0.0 - - 0.0 - - 0.0 - roughness: 0.5 - metallic: 0.0 - opacity: 1.0 - physics_material_path: material - physics_material: null - radius: 0.02 - contact_forces: - class_type: omni.isaac.lab.sensors.contact_sensor.contact_sensor:ContactSensor - prim_path: /World/envs/env_.*/Robot/.* - update_period: 0.005 - history_length: 3 - debug_vis: false - track_pose: false - track_air_time: true - force_threshold: 1.0 - filter_prim_paths_expr: [] - visualizer_cfg: - prim_path: /Visuals/ContactSensor - markers: - contact: - func: omni.isaac.lab.sim.spawners.shapes.shapes:spawn_sphere - visible: true - semantic_tags: null - copy_from_source: true - mass_props: null - rigid_props: null - collision_props: null - activate_contact_sensors: false - visual_material_path: material - visual_material: - func: omni.isaac.lab.sim.spawners.materials.visual_materials:spawn_preview_surface - diffuse_color: *id005 - emissive_color: *id006 - roughness: 0.5 - metallic: 0.0 - opacity: 1.0 - physics_material_path: material - physics_material: null - radius: 0.02 - no_contact: - func: omni.isaac.lab.sim.spawners.shapes.shapes:spawn_sphere - visible: false - semantic_tags: null - copy_from_source: true - mass_props: null - rigid_props: null - collision_props: null - activate_contact_sensors: false - visual_material_path: material - visual_material: - func: omni.isaac.lab.sim.spawners.materials.visual_materials:spawn_preview_surface - diffuse_color: !!python/tuple - - 0.0 - - 1.0 - - 0.0 - emissive_color: *id006 - roughness: 0.5 - metallic: 0.0 - opacity: 1.0 - physics_material_path: material - physics_material: null - radius: 0.02 - sky_light: - class_type: {} - prim_path: /World/skyLight - spawn: - func: omni.isaac.lab.sim.spawners.lights.lights:spawn_light - visible: true - semantic_tags: null - copy_from_source: true - prim_type: DomeLight - color: !!python/tuple - - 1.0 - - 1.0 - - 1.0 - enable_color_temperature: false - color_temperature: 6500.0 - normalize: false - exposure: 0.0 - intensity: 900.0 - texture_file: http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/4.0/Isaac/Materials/Textures/Skies/PolyHaven/kloofendal_43d_clear_puresky_4k.hdr - texture_format: automatic - visible_in_primary_ray: true - init_state: - pos: !!python/tuple - - 0.0 - - 0.0 - - 0.0 - rot: *id007 - collision_group: 0 - debug_vis: false -observations: - policy: - concatenate_terms: true - enable_corruption: true - base_lin_vel: - func: omni.isaac.lab.envs.mdp.observations:base_lin_vel - params: {} - noise: - func: omni.isaac.lab.utils.noise.noise_model:uniform_noise - operation: add - n_min: -0.1 - n_max: 0.1 - clip: null - scale: null - base_ang_vel: - func: omni.isaac.lab.envs.mdp.observations:base_ang_vel - params: {} - noise: - func: omni.isaac.lab.utils.noise.noise_model:uniform_noise - operation: add - n_min: -0.2 - n_max: 0.2 - clip: null - scale: null - projected_gravity: - func: omni.isaac.lab.envs.mdp.observations:projected_gravity - params: {} - noise: - func: omni.isaac.lab.utils.noise.noise_model:uniform_noise - operation: add - n_min: -0.05 - n_max: 0.05 - clip: null - scale: null - velocity_commands: - func: omni.isaac.lab.envs.mdp.observations:generated_commands - params: - command_name: base_velocity - noise: null - clip: null - scale: null - joint_pos: - func: omni.isaac.lab.envs.mdp.observations:joint_pos_rel - params: {} - noise: - func: omni.isaac.lab.utils.noise.noise_model:uniform_noise - operation: add - n_min: -0.01 - n_max: 0.01 - clip: null - scale: null - joint_vel: - func: omni.isaac.lab.envs.mdp.observations:joint_vel_rel - params: {} - noise: - func: omni.isaac.lab.utils.noise.noise_model:uniform_noise - operation: add - n_min: -1.5 - n_max: 1.5 - clip: null - scale: null - actions: - func: omni.isaac.lab.envs.mdp.observations:last_action - params: {} - noise: null - clip: null - scale: null - height_scan: - func: omni.isaac.lab.envs.mdp.observations:height_scan - params: - sensor_cfg: - name: height_scanner - joint_names: null - joint_ids: !!python/object/apply:builtins.slice - - null - - null - - null - fixed_tendon_names: null - fixed_tendon_ids: !!python/object/apply:builtins.slice - - null - - null - - null - body_names: null - body_ids: !!python/object/apply:builtins.slice - - null - - null - - null - preserve_order: false - noise: - func: omni.isaac.lab.utils.noise.noise_model:uniform_noise - operation: add - n_min: -0.1 - n_max: 0.1 - clip: !!python/tuple - - -1.0 - - 1.0 - scale: null -actions: - joint_pos: - class_type: omni.isaac.lab.envs.mdp.actions.joint_actions:JointPositionAction - asset_name: robot - debug_vis: false - joint_names: - - .* - scale: 0.5 - offset: 0.0 - use_default_offset: true -events: - physics_material: - func: omni.isaac.lab.envs.mdp.events:randomize_rigid_body_material - params: - asset_cfg: - name: robot - joint_names: null - joint_ids: !!python/object/apply:builtins.slice - - null - - null - - null - fixed_tendon_names: null - fixed_tendon_ids: !!python/object/apply:builtins.slice - - null - - null - - null - body_names: .* - body_ids: !!python/object/apply:builtins.slice - - null - - null - - null - preserve_order: false - static_friction_range: !!python/tuple - - 0.8 - - 0.8 - dynamic_friction_range: !!python/tuple - - 0.6 - - 0.6 - restitution_range: &id008 !!python/tuple - - 0.0 - - 0.0 - num_buckets: 64 - mode: startup - interval_range_s: null - is_global_time: false - add_base_mass: null - base_external_force_torque: - func: omni.isaac.lab.envs.mdp.events:apply_external_force_torque - params: - asset_cfg: - name: robot - joint_names: null - joint_ids: !!python/object/apply:builtins.slice - - null - - null - - null - fixed_tendon_names: null - fixed_tendon_ids: !!python/object/apply:builtins.slice - - null - - null - - null - body_names: - - torso_link - body_ids: !!python/object/apply:builtins.slice - - null - - null - - null - preserve_order: false - force_range: *id008 - torque_range: !!python/tuple - - -0.0 - - 0.0 - mode: reset - interval_range_s: null - is_global_time: false - reset_base: - func: omni.isaac.lab.envs.mdp.events:reset_root_state_uniform - params: - pose_range: - x: &id009 !!python/tuple - - -0.5 - - 0.5 - y: *id009 - yaw: !!python/tuple - - -3.14 - - 3.14 - velocity_range: - x: &id010 !!python/tuple - - 0.0 - - 0.0 - y: *id010 - z: *id010 - roll: *id010 - pitch: *id010 - yaw: *id010 - mode: reset - interval_range_s: null - is_global_time: false - reset_robot_joints: - func: omni.isaac.lab.envs.mdp.events:reset_joints_by_scale - params: - position_range: !!python/tuple - - 1.0 - - 1.0 - velocity_range: *id008 - mode: reset - interval_range_s: null - is_global_time: false - push_robot: null -randomization: null -is_finite_horizon: false -episode_length_s: 20.0 -rewards: - track_lin_vel_xy_exp: - func: omni.isaac.lab_tasks.manager_based.locomotion.velocity.mdp.rewards:track_lin_vel_xy_yaw_frame_exp - params: - command_name: base_velocity - std: 0.5 - weight: 1.0 - track_ang_vel_z_exp: - func: omni.isaac.lab_tasks.manager_based.locomotion.velocity.mdp.rewards:track_ang_vel_z_world_exp - params: - command_name: base_velocity - std: 0.5 - weight: 1.0 - lin_vel_z_l2: null - ang_vel_xy_l2: - func: omni.isaac.lab.envs.mdp.rewards:ang_vel_xy_l2 - params: {} - weight: -0.05 - dof_torques_l2: - func: omni.isaac.lab.envs.mdp.rewards:joint_torques_l2 - params: {} - weight: 0.0 - dof_acc_l2: - func: omni.isaac.lab.envs.mdp.rewards:joint_acc_l2 - params: {} - weight: -1.25e-07 - action_rate_l2: - func: omni.isaac.lab.envs.mdp.rewards:action_rate_l2 - params: {} - weight: -0.005 - feet_air_time: - func: omni.isaac.lab_tasks.manager_based.locomotion.velocity.mdp.rewards:feet_air_time_positive_biped - params: - command_name: base_velocity - sensor_cfg: - name: contact_forces - joint_names: null - joint_ids: !!python/object/apply:builtins.slice - - null - - null - - null - fixed_tendon_names: null - fixed_tendon_ids: !!python/object/apply:builtins.slice - - null - - null - - null - body_names: .*_ankle_roll_link - body_ids: !!python/object/apply:builtins.slice - - null - - null - - null - preserve_order: false - threshold: 0.4 - weight: 0.25 - undesired_contacts: null - flat_orientation_l2: - func: omni.isaac.lab.envs.mdp.rewards:flat_orientation_l2 - params: {} - weight: -1.0 - dof_pos_limits: - func: omni.isaac.lab.envs.mdp.rewards:joint_pos_limits - params: - asset_cfg: - name: robot - joint_names: - - .*_ankle_pitch_joint - - .*_ankle_roll_joint - joint_ids: !!python/object/apply:builtins.slice - - null - - null - - null - fixed_tendon_names: null - fixed_tendon_ids: !!python/object/apply:builtins.slice - - null - - null - - null - body_names: null - body_ids: !!python/object/apply:builtins.slice - - null - - null - - null - preserve_order: false - weight: -1.0 - termination_penalty: - func: omni.isaac.lab.envs.mdp.rewards:is_terminated - params: {} - weight: -200.0 - feet_slide: - func: omni.isaac.lab_tasks.manager_based.locomotion.velocity.mdp.rewards:feet_slide - params: - sensor_cfg: - name: contact_forces - joint_names: null - joint_ids: !!python/object/apply:builtins.slice - - null - - null - - null - fixed_tendon_names: null - fixed_tendon_ids: !!python/object/apply:builtins.slice - - null - - null - - null - body_names: .*_ankle_roll_link - body_ids: !!python/object/apply:builtins.slice - - null - - null - - null - preserve_order: false - asset_cfg: - name: robot - joint_names: null - joint_ids: !!python/object/apply:builtins.slice - - null - - null - - null - fixed_tendon_names: null - fixed_tendon_ids: !!python/object/apply:builtins.slice - - null - - null - - null - body_names: .*_ankle_roll_link - body_ids: !!python/object/apply:builtins.slice - - null - - null - - null - preserve_order: false - weight: -0.25 - joint_deviation_hip: - func: omni.isaac.lab.envs.mdp.rewards:joint_deviation_l1 - params: - asset_cfg: - name: robot - joint_names: - - .*_hip_yaw_joint - - .*_hip_roll_joint - - .*_ankle_pitch_joint - joint_ids: !!python/object/apply:builtins.slice - - null - - null - - null - fixed_tendon_names: null - fixed_tendon_ids: !!python/object/apply:builtins.slice - - null - - null - - null - body_names: null - body_ids: !!python/object/apply:builtins.slice - - null - - null - - null - preserve_order: false - weight: -0.2 - joint_deviation_arms: - func: omni.isaac.lab.envs.mdp.rewards:joint_deviation_l1 - params: - asset_cfg: - name: robot - joint_names: - - .*_shoulder_pitch_joint - - .*_shoulder_roll_joint - - .*_shoulder_yaw_joint - - .*_elbow_pitch_joint - - .*_elbow_roll_joint - - .*_five_joint - - .*_three_joint - - .*_six_joint - - .*_four_joint - - .*_zero_joint - - .*_one_joint - - .*_two_joint - joint_ids: !!python/object/apply:builtins.slice - - null - - null - - null - fixed_tendon_names: null - fixed_tendon_ids: !!python/object/apply:builtins.slice - - null - - null - - null - body_names: null - body_ids: !!python/object/apply:builtins.slice - - null - - null - - null - preserve_order: false - weight: -0.2 - joint_deviation_torso: - func: omni.isaac.lab.envs.mdp.rewards:joint_deviation_l1 - params: - asset_cfg: - name: robot - joint_names: torso_joint - joint_ids: !!python/object/apply:builtins.slice - - null - - null - - null - fixed_tendon_names: null - fixed_tendon_ids: !!python/object/apply:builtins.slice - - null - - null - - null - body_names: null - body_ids: !!python/object/apply:builtins.slice - - null - - null - - null - preserve_order: false - weight: -0.1 -terminations: - time_out: - func: omni.isaac.lab.envs.mdp.terminations:time_out - params: {} - time_out: true - base_contact: - func: omni.isaac.lab.envs.mdp.terminations:illegal_contact - params: - sensor_cfg: - name: contact_forces - joint_names: null - joint_ids: !!python/object/apply:builtins.slice - - null - - null - - null - fixed_tendon_names: null - fixed_tendon_ids: !!python/object/apply:builtins.slice - - null - - null - - null - body_names: - - torso_link - body_ids: !!python/object/apply:builtins.slice - - null - - null - - null - preserve_order: false - threshold: 1.0 - time_out: false -curriculum: - terrain_levels: - func: omni.isaac.lab_tasks.manager_based.locomotion.velocity.mdp.curriculums:terrain_levels_vel - params: {} -commands: - base_velocity: - class_type: omni.isaac.lab.envs.mdp.commands.velocity_command:UniformVelocityCommand - resampling_time_range: !!python/tuple - - 10.0 - - 10.0 - debug_vis: true - asset_name: robot - heading_command: true - heading_control_stiffness: 0.5 - rel_standing_envs: 0.02 - rel_heading_envs: 1.0 - ranges: - lin_vel_x: !!python/tuple - - 0.0 - - 1.0 - lin_vel_y: *id010 - ang_vel_z: !!python/tuple - - -1.0 - - 1.0 - heading: !!python/tuple - - -3.141592653589793 - - 3.141592653589793 diff --git a/logs/rsl_rl/unitree_go2_rough/2024-04-06_02-37-07/events.out.tfevents.1712353055.brimo-Z690-UD-DDR4.365273.0 b/logs/rsl_rl/unitree_go2_rough/2024-04-06_02-37-07/events.out.tfevents.1712353055.brimo-Z690-UD-DDR4.365273.0 deleted file mode 100644 index 3f7f1d8..0000000 --- a/logs/rsl_rl/unitree_go2_rough/2024-04-06_02-37-07/events.out.tfevents.1712353055.brimo-Z690-UD-DDR4.365273.0 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:40894c8c6ff15d31bcb48e3f9e802ad21978c70174720c5e608bf821416b9403 -size 13286938 diff --git a/logs/rsl_rl/unitree_go2_rough/2024-04-06_02-37-07/exported/policy.onnx b/logs/rsl_rl/unitree_go2_rough/2024-04-06_02-37-07/exported/policy.onnx deleted file mode 100644 index 709f386..0000000 Binary files a/logs/rsl_rl/unitree_go2_rough/2024-04-06_02-37-07/exported/policy.onnx and /dev/null differ diff --git a/logs/rsl_rl/unitree_go2_rough/2024-04-06_02-37-07/git/orbit.diff b/logs/rsl_rl/unitree_go2_rough/2024-04-06_02-37-07/git/orbit.diff deleted file mode 100644 index f75f0b3..0000000 --- a/logs/rsl_rl/unitree_go2_rough/2024-04-06_02-37-07/git/orbit.diff +++ /dev/null @@ -1,39 +0,0 @@ ---- git status --- -On branch main -Your branch is up to date with 'origin/main'. - -Changes not staged for commit: - (use "git add ..." to update what will be committed) - (use "git restore ..." to discard changes in working directory) - modified: source/extensions/omni.isaac.lab_tasks/omni/isaac/orbit_tasks/locomotion/velocity/config/unitree_go2/agents/rsl_rl_cfg.py - modified: source/standalone/workflows/rsl_rl/play.py - -no changes added to commit (use "git add" and/or "git commit -a") - - ---- git diff --- -diff --git a/source/extensions/omni.isaac.lab_tasks/omni/isaac/orbit_tasks/locomotion/velocity/config/unitree_go2/agents/rsl_rl_cfg.py b/source/extensions/omni.isaac.lab_tasks/omni/isaac/orbit_tasks/locomotion/velocity/config/unitree_go2/agents/rsl_rl_cfg.py -index 7de557b..f027b3d 100644 ---- a/source/extensions/omni.isaac.lab_tasks/omni/isaac/orbit_tasks/locomotion/velocity/config/unitree_go2/agents/rsl_rl_cfg.py -+++ b/source/extensions/omni.isaac.lab_tasks/omni/isaac/orbit_tasks/locomotion/velocity/config/unitree_go2/agents/rsl_rl_cfg.py -@@ -15,7 +15,7 @@ from omni.isaac.lab_tasks.utils.wrappers.rsl_rl import ( - @configclass - class UnitreeGo2RoughPPORunnerCfg(RslRlOnPolicyRunnerCfg): - num_steps_per_env = 24 -- max_iterations = 1500 -+ max_iterations = 15000 - save_interval = 50 - experiment_name = "unitree_go2_rough" - empirical_normalization = False -diff --git a/source/standalone/workflows/rsl_rl/play.py b/source/standalone/workflows/rsl_rl/play.py -index e73a071..f778e8c 100644 ---- a/source/standalone/workflows/rsl_rl/play.py -+++ b/source/standalone/workflows/rsl_rl/play.py -@@ -94,6 +94,7 @@ def main(): - with torch.inference_mode(): - # agent stepping - actions = policy(obs) -+ print(actions) - # env stepping - obs, _, _, _ = env.step(actions) - \ No newline at end of file diff --git a/logs/rsl_rl/unitree_go2_rough/2024-04-06_02-37-07/params/agent.pkl b/logs/rsl_rl/unitree_go2_rough/2024-04-06_02-37-07/params/agent.pkl deleted file mode 100644 index a489c99..0000000 Binary files a/logs/rsl_rl/unitree_go2_rough/2024-04-06_02-37-07/params/agent.pkl and /dev/null differ diff --git a/logs/rsl_rl/unitree_go2_rough/2024-04-06_02-37-07/params/agent.yaml b/logs/rsl_rl/unitree_go2_rough/2024-04-06_02-37-07/params/agent.yaml deleted file mode 100644 index 88a5ab1..0000000 --- a/logs/rsl_rl/unitree_go2_rough/2024-04-06_02-37-07/params/agent.yaml +++ /dev/null @@ -1,40 +0,0 @@ -seed: 42 -device: cuda -num_steps_per_env: 24 -max_iterations: 15000 -empirical_normalization: false -policy: - class_name: ActorCritic - init_noise_std: 1.0 - actor_hidden_dims: - - 512 - - 256 - - 128 - critic_hidden_dims: - - 512 - - 256 - - 128 - activation: elu -algorithm: - class_name: PPO - value_loss_coef: 1.0 - use_clipped_value_loss: true - clip_param: 0.2 - entropy_coef: 0.01 - num_learning_epochs: 5 - num_mini_batches: 4 - learning_rate: 0.001 - schedule: adaptive - gamma: 0.99 - lam: 0.95 - desired_kl: 0.01 - max_grad_norm: 1.0 -save_interval: 50 -experiment_name: unitree_go2_rough -run_name: '' -logger: tensorboard -neptune_project: orbit -wandb_project: orbit -resume: false -load_run: .* -load_checkpoint: model_.*.pt diff --git a/logs/rsl_rl/unitree_go2_rough/2024-04-06_02-37-07/params/env.pkl b/logs/rsl_rl/unitree_go2_rough/2024-04-06_02-37-07/params/env.pkl deleted file mode 100644 index e51ec44..0000000 Binary files a/logs/rsl_rl/unitree_go2_rough/2024-04-06_02-37-07/params/env.pkl and /dev/null differ diff --git a/logs/rsl_rl/unitree_go2_rough/2024-04-06_02-37-07/params/env.yaml b/logs/rsl_rl/unitree_go2_rough/2024-04-06_02-37-07/params/env.yaml deleted file mode 100644 index 909d106..0000000 --- a/logs/rsl_rl/unitree_go2_rough/2024-04-06_02-37-07/params/env.yaml +++ /dev/null @@ -1,753 +0,0 @@ -viewer: - eye: !!python/tuple - - 7.5 - - 7.5 - - 7.5 - lookat: !!python/tuple - - 0.0 - - 0.0 - - 0.0 - cam_prim_path: /OmniverseKit_Persp - resolution: !!python/tuple - - 1280 - - 720 - origin_type: world - env_index: 0 - asset_name: null -sim: - physics_prim_path: /physicsScene - dt: 0.005 - substeps: 1 - gravity: !!python/tuple - - 0.0 - - 0.0 - - -9.81 - enable_scene_query_support: false - use_fabric: true - disable_contact_processing: true - use_gpu_pipeline: true - device: cuda:0 - physx: - use_gpu: true - solver_type: 1 - min_position_iteration_count: 1 - max_position_iteration_count: 255 - min_velocity_iteration_count: 0 - max_velocity_iteration_count: 255 - enable_ccd: false - enable_stabilization: true - enable_enhanced_determinism: false - bounce_threshold_velocity: 0.5 - friction_offset_threshold: 0.04 - friction_correlation_distance: 0.025 - gpu_max_rigid_contact_count: 8388608 - gpu_max_rigid_patch_count: 163840 - gpu_found_lost_pairs_capacity: 2097152 - gpu_found_lost_aggregate_pairs_capacity: 33554432 - gpu_total_aggregate_pairs_capacity: 2097152 - gpu_collision_stack_size: 67108864 - gpu_heap_capacity: 67108864 - gpu_temp_buffer_capacity: 16777216 - gpu_max_num_partitions: 8 - gpu_max_soft_body_contacts: 1048576 - gpu_max_particle_contacts: 1048576 - physics_material: - func: omni.isaac.lab.sim.spawners.materials.physics_materials:spawn_rigid_body_material - static_friction: 1.0 - dynamic_friction: 1.0 - restitution: 0.0 - improve_patch_friction: true - friction_combine_mode: multiply - restitution_combine_mode: multiply - compliant_contact_stiffness: 0.0 - compliant_contact_damping: 0.0 -ui_window_class_type: omni.isaac.lab.envs.ui.rl_task_env_window:RLTaskEnvWindow -decimation: 4 -scene: - num_envs: 4096 - env_spacing: 2.5 - lazy_sensor_update: true - replicate_physics: true - robot: - class_type: omni.isaac.lab.assets.articulation.articulation:Articulation - prim_path: /World/envs/env_.*/Robot - spawn: - func: omni.isaac.lab.sim.spawners.from_files.from_files:spawn_from_usd - visible: true - semantic_tags: null - copy_from_source: true - mass_props: null - rigid_props: - rigid_body_enabled: null - kinematic_enabled: null - disable_gravity: false - linear_damping: 0.0 - angular_damping: 0.0 - max_linear_velocity: 1000.0 - max_angular_velocity: 1000.0 - max_depenetration_velocity: 1.0 - max_contact_impulse: null - enable_gyroscopic_forces: null - retain_accelerations: false - solver_position_iteration_count: null - solver_velocity_iteration_count: null - sleep_threshold: null - stabilization_threshold: null - collision_props: null - activate_contact_sensors: true - scale: null - articulation_props: - articulation_enabled: null - enabled_self_collisions: false - solver_position_iteration_count: 4 - solver_velocity_iteration_count: 0 - sleep_threshold: null - stabilization_threshold: null - fixed_tendons_props: null - joint_drive_props: null - visual_material_path: material - visual_material: null - usd_path: http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Samples/Orbit/Robots/Unitree/Go2/go2.usd - init_state: - pos: !!python/tuple - - 0.0 - - 0.0 - - 0.4 - rot: &id007 !!python/tuple - - 1.0 - - 0.0 - - 0.0 - - 0.0 - lin_vel: &id001 !!python/tuple - - 0.0 - - 0.0 - - 0.0 - ang_vel: *id001 - joint_pos: - .*L_hip_joint: 0.1 - .*R_hip_joint: -0.1 - F[L,R]_thigh_joint: 0.8 - R[L,R]_thigh_joint: 1.0 - .*_calf_joint: -1.5 - joint_vel: - .*: 0.0 - collision_group: 0 - debug_vis: false - soft_joint_pos_limit_factor: 0.9 - actuators: - base_legs: - class_type: omni.isaac.lab.actuators.actuator_pd:DCMotor - joint_names_expr: - - .*_hip_joint - - .*_thigh_joint - - .*_calf_joint - effort_limit: 23.5 - velocity_limit: 30.0 - stiffness: 25.0 - damping: 0.5 - armature: null - friction: 0.0 - saturation_effort: 23.5 - terrain: - class_type: omni.isaac.lab.terrains.terrain_importer:TerrainImporter - collision_group: -1 - prim_path: /World/ground - num_envs: 4096 - terrain_type: generator - terrain_generator: - seed: null - curriculum: true - size: &id002 !!python/tuple - - 8.0 - - 8.0 - border_width: 20.0 - num_rows: 10 - num_cols: 20 - color_scheme: none - horizontal_scale: 0.1 - vertical_scale: 0.005 - slope_threshold: 0.75 - sub_terrains: - pyramid_stairs: - function: omni.isaac.lab.terrains.trimesh.mesh_terrains:pyramid_stairs_terrain - proportion: 0.2 - size: *id002 - flat_patch_sampling: null - border_width: 1.0 - step_height_range: &id003 !!python/tuple - - 0.05 - - 0.23 - step_width: 0.3 - platform_width: 3.0 - holes: false - difficulty: 0.968515003601978 - seed: null - pyramid_stairs_inv: - function: omni.isaac.lab.terrains.trimesh.mesh_terrains:inverted_pyramid_stairs_terrain - proportion: 0.2 - size: *id002 - flat_patch_sampling: null - border_width: 1.0 - step_height_range: *id003 - step_width: 0.3 - platform_width: 3.0 - holes: false - difficulty: 0.994603458291093 - seed: null - boxes: - function: omni.isaac.lab.terrains.trimesh.mesh_terrains:random_grid_terrain - proportion: 0.2 - size: *id002 - flat_patch_sampling: null - grid_width: 0.45 - grid_height_range: !!python/tuple - - 0.025 - - 0.1 - platform_width: 2.0 - holes: false - difficulty: 0.944897318205577 - seed: null - random_rough: - function: omni.isaac.lab.terrains.height_field.hf_terrains:random_uniform_terrain - proportion: 0.2 - size: *id002 - flat_patch_sampling: null - border_width: 0.25 - horizontal_scale: 0.1 - vertical_scale: 0.005 - slope_threshold: 0.75 - noise_range: !!python/tuple - - 0.01 - - 0.06 - noise_step: 0.01 - downsampled_scale: 0.1 - difficulty: 0.9722392846049497 - seed: null - hf_pyramid_slope: - function: omni.isaac.lab.terrains.height_field.hf_terrains:pyramid_sloped_terrain - proportion: 0.1 - size: *id002 - flat_patch_sampling: null - border_width: 0.25 - horizontal_scale: 0.1 - vertical_scale: 0.005 - slope_threshold: 0.75 - slope_range: &id004 !!python/tuple - - 0.0 - - 0.4 - platform_width: 2.0 - inverted: false - difficulty: 0.9325158713374326 - seed: null - hf_pyramid_slope_inv: - function: omni.isaac.lab.terrains.height_field.hf_terrains:pyramid_sloped_terrain - proportion: 0.1 - size: *id002 - flat_patch_sampling: null - border_width: 0.25 - horizontal_scale: 0.1 - vertical_scale: 0.005 - slope_threshold: 0.75 - slope_range: *id004 - platform_width: 2.0 - inverted: true - difficulty: 0.9193030378580339 - seed: null - difficulty_range: !!python/tuple - - 0.0 - - 1.0 - use_cache: false - cache_dir: /tmp/orbit/terrains - usd_path: null - env_spacing: 2.5 - visual_material: - func: omni.isaac.lab.sim.spawners.materials.visual_materials:spawn_from_mdl_file - mdl_path: '{NVIDIA_NUCLEUS_DIR}/Materials/Base/Architecture/Shingles_01.mdl' - project_uvw: true - albedo_brightness: null - texture_scale: null - physics_material: - func: omni.isaac.lab.sim.spawners.materials.physics_materials:spawn_rigid_body_material - static_friction: 1.0 - dynamic_friction: 1.0 - restitution: 0.0 - improve_patch_friction: true - friction_combine_mode: multiply - restitution_combine_mode: multiply - compliant_contact_stiffness: 0.0 - compliant_contact_damping: 0.0 - max_init_terrain_level: 5 - debug_vis: false - height_scanner: - class_type: omni.isaac.lab.sensors.ray_caster.ray_caster:RayCaster - prim_path: /World/envs/env_.*/Robot/base - update_period: 0.02 - history_length: 0 - debug_vis: false - mesh_prim_paths: - - /World/ground - offset: - pos: !!python/tuple - - 0.0 - - 0.0 - - 20.0 - rot: !!python/tuple - - 1.0 - - 0.0 - - 0.0 - - 0.0 - attach_yaw_only: true - pattern_cfg: - func: omni.isaac.lab.sensors.ray_caster.patterns.patterns:grid_pattern - resolution: 0.1 - size: - - 1.6 - - 1.0 - direction: !!python/tuple - - 0.0 - - 0.0 - - -1.0 - max_distance: 1000000.0 - drift_range: !!python/tuple - - 0.0 - - 0.0 - visualizer_cfg: - prim_path: /Visuals/RayCaster - markers: - hit: - func: omni.isaac.lab.sim.spawners.shapes.shapes:spawn_sphere - visible: true - semantic_tags: null - copy_from_source: true - mass_props: null - rigid_props: null - collision_props: null - activate_contact_sensors: false - visual_material_path: material - visual_material: - func: omni.isaac.lab.sim.spawners.materials.visual_materials:spawn_preview_surface - diffuse_color: &id005 !!python/tuple - - 1.0 - - 0.0 - - 0.0 - emissive_color: &id006 !!python/tuple - - 0.0 - - 0.0 - - 0.0 - roughness: 0.5 - metallic: 0.0 - opacity: 1.0 - physics_material_path: material - physics_material: null - radius: 0.02 - contact_forces: - class_type: omni.isaac.lab.sensors.contact_sensor.contact_sensor:ContactSensor - prim_path: /World/envs/env_.*/Robot/.* - update_period: 0.005 - history_length: 3 - debug_vis: false - track_pose: false - track_air_time: true - force_threshold: 1.0 - filter_prim_paths_expr: [] - visualizer_cfg: - prim_path: /Visuals/ContactSensor - markers: - contact: - func: omni.isaac.lab.sim.spawners.shapes.shapes:spawn_sphere - visible: true - semantic_tags: null - copy_from_source: true - mass_props: null - rigid_props: null - collision_props: null - activate_contact_sensors: false - visual_material_path: material - visual_material: - func: omni.isaac.lab.sim.spawners.materials.visual_materials:spawn_preview_surface - diffuse_color: *id005 - emissive_color: *id006 - roughness: 0.5 - metallic: 0.0 - opacity: 1.0 - physics_material_path: material - physics_material: null - radius: 0.02 - no_contact: - func: omni.isaac.lab.sim.spawners.shapes.shapes:spawn_sphere - visible: false - semantic_tags: null - copy_from_source: true - mass_props: null - rigid_props: null - collision_props: null - activate_contact_sensors: false - visual_material_path: material - visual_material: - func: omni.isaac.lab.sim.spawners.materials.visual_materials:spawn_preview_surface - diffuse_color: !!python/tuple - - 0.0 - - 1.0 - - 0.0 - emissive_color: *id006 - roughness: 0.5 - metallic: 0.0 - opacity: 1.0 - physics_material_path: material - physics_material: null - radius: 0.02 - light: - class_type: {} - prim_path: /World/light - spawn: - func: omni.isaac.lab.sim.spawners.lights.lights:spawn_light - visible: true - semantic_tags: null - copy_from_source: true - prim_type: DistantLight - color: !!python/tuple - - 0.75 - - 0.75 - - 0.75 - enable_color_temperature: false - color_temperature: 6500.0 - normalize: false - exposure: 0.0 - intensity: 3000.0 - angle: 0.53 - init_state: - pos: &id008 !!python/tuple - - 0.0 - - 0.0 - - 0.0 - rot: *id007 - collision_group: 0 - debug_vis: false - sky_light: - class_type: {} - prim_path: /World/skyLight - spawn: - func: omni.isaac.lab.sim.spawners.lights.lights:spawn_light - visible: true - semantic_tags: null - copy_from_source: true - prim_type: DomeLight - color: !!python/tuple - - 0.13 - - 0.13 - - 0.13 - enable_color_temperature: false - color_temperature: 6500.0 - normalize: false - exposure: 0.0 - intensity: 1000.0 - texture_file: null - texture_format: automatic - init_state: - pos: *id008 - rot: *id007 - collision_group: 0 - debug_vis: false -observations: - policy: - concatenate_terms: true - enable_corruption: true - base_lin_vel: - func: omni.isaac.lab.envs.mdp.observations:base_lin_vel - params: {} - noise: - func: omni.isaac.lab.utils.noise.noise_model:additive_uniform_noise - n_min: -0.1 - n_max: 0.1 - clip: null - scale: null - base_ang_vel: - func: omni.isaac.lab.envs.mdp.observations:base_ang_vel - params: {} - noise: - func: omni.isaac.lab.utils.noise.noise_model:additive_uniform_noise - n_min: -0.2 - n_max: 0.2 - clip: null - scale: null - projected_gravity: - func: omni.isaac.lab.envs.mdp.observations:projected_gravity - params: {} - noise: - func: omni.isaac.lab.utils.noise.noise_model:additive_uniform_noise - n_min: -0.05 - n_max: 0.05 - clip: null - scale: null - velocity_commands: - func: omni.isaac.lab.envs.mdp.observations:generated_commands - params: - command_name: base_velocity - noise: null - clip: null - scale: null - joint_pos: - func: omni.isaac.lab.envs.mdp.observations:joint_pos_rel - params: {} - noise: - func: omni.isaac.lab.utils.noise.noise_model:additive_uniform_noise - n_min: -0.01 - n_max: 0.01 - clip: null - scale: null - joint_vel: - func: omni.isaac.lab.envs.mdp.observations:joint_vel_rel - params: {} - noise: - func: omni.isaac.lab.utils.noise.noise_model:additive_uniform_noise - n_min: -1.5 - n_max: 1.5 - clip: null - scale: null - actions: - func: omni.isaac.lab.envs.mdp.observations:last_action - params: {} - noise: null - clip: null - scale: null - height_scan: - func: omni.isaac.lab.envs.mdp.observations:height_scan - params: - sensor_cfg: - name: height_scanner - joint_names: null - joint_ids: !!python/object/apply:builtins.slice - - null - - null - - null - body_names: null - body_ids: !!python/object/apply:builtins.slice - - null - - null - - null - noise: - func: omni.isaac.lab.utils.noise.noise_model:additive_uniform_noise - n_min: -0.1 - n_max: 0.1 - clip: &id012 !!python/tuple - - -1.0 - - 1.0 - scale: null -actions: - joint_pos: - class_type: omni.isaac.lab.envs.mdp.actions.joint_actions:JointPositionAction - asset_name: robot - joint_names: - - .* - scale: 0.25 - offset: 0.0 - use_default_offset: true -events: - physics_material: - func: omni.isaac.lab.envs.mdp.events:randomize_rigid_body_material - params: - asset_cfg: - name: robot - joint_names: null - joint_ids: !!python/object/apply:builtins.slice - - null - - null - - null - body_names: .* - body_ids: !!python/object/apply:builtins.slice - - null - - null - - null - static_friction_range: !!python/tuple - - 0.8 - - 0.8 - dynamic_friction_range: !!python/tuple - - 0.6 - - 0.6 - restitution_range: &id009 !!python/tuple - - 0.0 - - 0.0 - num_buckets: 64 - mode: startup - interval_range_s: null - add_base_mass: - func: omni.isaac.lab.envs.mdp.events:add_body_mass - params: - asset_cfg: - name: robot - joint_names: null - joint_ids: !!python/object/apply:builtins.slice - - null - - null - - null - body_names: base - body_ids: !!python/object/apply:builtins.slice - - null - - null - - null - mass_range: !!python/tuple - - -1.0 - - 3.0 - mode: startup - interval_range_s: null - base_external_force_torque: - func: omni.isaac.lab.envs.mdp.events:apply_external_force_torque - params: - asset_cfg: - name: robot - joint_names: null - joint_ids: !!python/object/apply:builtins.slice - - null - - null - - null - body_names: base - body_ids: !!python/object/apply:builtins.slice - - null - - null - - null - force_range: *id009 - torque_range: !!python/tuple - - -0.0 - - 0.0 - mode: reset - interval_range_s: null - reset_base: - func: omni.isaac.lab.envs.mdp.events:reset_root_state_uniform - params: - pose_range: - x: &id010 !!python/tuple - - -0.5 - - 0.5 - y: *id010 - yaw: !!python/tuple - - -3.14 - - 3.14 - velocity_range: - x: &id011 !!python/tuple - - 0.0 - - 0.0 - y: *id011 - z: *id011 - roll: *id011 - pitch: *id011 - yaw: *id011 - mode: reset - interval_range_s: null - reset_robot_joints: - func: omni.isaac.lab.envs.mdp.events:reset_joints_by_scale - params: - position_range: !!python/tuple - - 1.0 - - 1.0 - velocity_range: *id009 - mode: reset - interval_range_s: null - push_robot: null -randomization: null -is_finite_horizon: false -episode_length_s: 20.0 -rewards: - track_lin_vel_xy_exp: - func: omni.isaac.lab.envs.mdp.rewards:track_lin_vel_xy_exp - params: - command_name: base_velocity - std: 0.5 - weight: 1.5 - track_ang_vel_z_exp: - func: omni.isaac.lab.envs.mdp.rewards:track_ang_vel_z_exp - params: - command_name: base_velocity - std: 0.5 - weight: 0.75 - lin_vel_z_l2: - func: omni.isaac.lab.envs.mdp.rewards:lin_vel_z_l2 - params: {} - weight: -2.0 - ang_vel_xy_l2: - func: omni.isaac.lab.envs.mdp.rewards:ang_vel_xy_l2 - params: {} - weight: -0.05 - dof_torques_l2: - func: omni.isaac.lab.envs.mdp.rewards:joint_torques_l2 - params: {} - weight: -0.0002 - dof_acc_l2: - func: omni.isaac.lab.envs.mdp.rewards:joint_acc_l2 - params: {} - weight: -2.5e-07 - action_rate_l2: - func: omni.isaac.lab.envs.mdp.rewards:action_rate_l2 - params: {} - weight: -0.01 - feet_air_time: - func: omni.isaac.lab_tasks.locomotion.velocity.mdp.rewards:feet_air_time - params: - sensor_cfg: - name: contact_forces - joint_names: null - joint_ids: !!python/object/apply:builtins.slice - - null - - null - - null - body_names: .*_foot - body_ids: !!python/object/apply:builtins.slice - - null - - null - - null - command_name: base_velocity - threshold: 0.5 - weight: 0.01 - undesired_contacts: null - flat_orientation_l2: - func: omni.isaac.lab.envs.mdp.rewards:flat_orientation_l2 - params: {} - weight: 0.0 - dof_pos_limits: - func: omni.isaac.lab.envs.mdp.rewards:joint_pos_limits - params: {} - weight: 0.0 -terminations: - time_out: - func: omni.isaac.lab.envs.mdp.terminations:time_out - params: {} - time_out: true - base_contact: - func: omni.isaac.lab.envs.mdp.terminations:illegal_contact - params: - sensor_cfg: - name: contact_forces - joint_names: null - joint_ids: !!python/object/apply:builtins.slice - - null - - null - - null - body_names: base - body_ids: !!python/object/apply:builtins.slice - - null - - null - - null - threshold: 1.0 - time_out: false -curriculum: - terrain_levels: - func: omni.isaac.lab_tasks.locomotion.velocity.mdp.curriculums:terrain_levels_vel - params: {} -commands: - base_velocity: - class_type: omni.isaac.lab.envs.mdp.commands.velocity_command:UniformVelocityCommand - resampling_time_range: !!python/tuple - - 10.0 - - 10.0 - debug_vis: true - asset_name: robot - heading_command: true - heading_control_stiffness: 0.5 - rel_standing_envs: 0.02 - rel_heading_envs: 1.0 - ranges: - lin_vel_x: *id012 - lin_vel_y: *id012 - ang_vel_z: *id012 - heading: !!python/tuple - - -3.141592653589793 - - 3.141592653589793 diff --git a/omniverse_sim.py b/omniverse_sim.py index c97fe52..765a92a 100644 --- a/omniverse_sim.py +++ b/omniverse_sim.py @@ -4,7 +4,7 @@ """Launch Isaac Sim Simulator first.""" import argparse -from omni.isaac.lab.app import AppLauncher +from omni.isaac.orbit.app import AppLauncher import cli_args @@ -24,6 +24,7 @@ parser.add_argument("--seed", type=int, default=None, help="Seed used for the environment") parser.add_argument("--custom_env", type=str, default="office", help="Setup the environment") parser.add_argument("--robot", type=str, default="go2", help="Setup the robot") +parser.add_argument("--terrain", type=str, default="rough", help="Setup the robot") parser.add_argument("--robot_amount", type=int, default=1, help="Setup the robot amount") @@ -62,12 +63,12 @@ import carb -from omni.isaac.lab_tasks.utils import get_checkpoint_path -from omni.isaac.lab_tasks.utils.wrappers.rsl_rl import ( +from omni.isaac.orbit_tasks.utils import get_checkpoint_path +from omni.isaac.orbit_tasks.utils.wrappers.rsl_rl import ( RslRlOnPolicyRunnerCfg, RslRlVecEnvWrapper ) -import omni.isaac.lab.sim as sim_utils +import omni.isaac.orbit.sim as sim_utils import omni.appwindow from rsl_rl.runners import OnPolicyRunner @@ -123,11 +124,11 @@ def sub_keyboard_event(event, *args, **kwargs) -> bool: def setup_custom_env(): try: - if (args_cli.custom_env == "warehouse"): + if (args_cli.custom_env == "warehouse" and args_cli.terrain == 'flat'): cfg_scene = sim_utils.UsdFileCfg(usd_path="./envs/warehouse.usd") cfg_scene.func("/World/warehouse", cfg_scene, translation=(0.0, 0.0, 0.0)) - if (args_cli.custom_env == "office"): + if (args_cli.custom_env == "office" and args_cli.terrain == 'flat'): cfg_scene = sim_utils.UsdFileCfg(usd_path="./envs/office.usd") cfg_scene.func("/World/office", cfg_scene, translation=(0.0, 0.0, 0.0)) except: diff --git a/robots/g1/config.py b/robots/g1/config.py index f6e2288..9e44ad0 100644 --- a/robots/g1/config.py +++ b/robots/g1/config.py @@ -1,7 +1,7 @@ -import omni.isaac.lab.sim as sim_utils -from omni.isaac.lab.actuators import ImplicitActuatorCfg -from omni.isaac.lab.assets.articulation import ArticulationCfg +import omni.isaac.orbit.sim as sim_utils +from omni.isaac.orbit.actuators import ImplicitActuatorCfg +from omni.isaac.orbit.assets.articulation import ArticulationCfg G1_CFG = ArticulationCfg( @@ -22,7 +22,7 @@ ), ), init_state=ArticulationCfg.InitialStateCfg( - pos=(0.0, 0.0, 0.70), + pos=(0.0, 0.0, 0.80), joint_pos={ ".*_hip_pitch_joint": -0.28, diff --git a/ros2.py b/ros2.py index 5f4cbe1..08bcb20 100644 --- a/ros2.py +++ b/ros2.py @@ -41,11 +41,11 @@ -from omni.isaac.lab.sensors import CameraCfg, Camera +from omni.isaac.orbit.sensors import CameraCfg, Camera from omni.isaac.sensor import LidarRtx import omni.replicator.core as rep from scipy.spatial.transform import Rotation -import omni.isaac.lab.sim as sim_utils +import omni.isaac.orbit.sim as sim_utils diff --git a/run_sim.sh b/run_sim.sh index f8ec2d5..7fef2a2 100755 --- a/run_sim.sh +++ b/run_sim.sh @@ -35,8 +35,8 @@ source install/setup.bash cd .. eval "$(conda shell.bash hook)" -conda activate isaaclab +conda activate orbit export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 # Run the Python script -python main.py --robot_amount 1 --robot go2 \ No newline at end of file +python main.py --robot_amount 1 --robot g1 --terrain flat \ No newline at end of file diff --git a/run_sim_g1.sh b/run_sim_g1.sh index 3aae130..888764b 100755 --- a/run_sim_g1.sh +++ b/run_sim_g1.sh @@ -35,7 +35,7 @@ source install/setup.bash cd .. eval "$(conda shell.bash hook)" -conda activate isaaclab +conda activate orbit export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 # Run the Python script diff --git a/terrain_cfg.py b/terrain_cfg.py index 5f33994..0192a18 100644 --- a/terrain_cfg.py +++ b/terrain_cfg.py @@ -23,7 +23,7 @@ from terrain_generator_cfg import TerrainGeneratorCfg -import omni.isaac.lab.terrains as terrain_gen +import omni.isaac.orbit.terrains as terrain_gen ROUGH_TERRAINS_CFG = TerrainGeneratorCfg( diff --git a/terrain_generator_cfg.py b/terrain_generator_cfg.py index ba5e5f7..428932f 100644 --- a/terrain_generator_cfg.py +++ b/terrain_generator_cfg.py @@ -5,7 +5,7 @@ """ Configuration classes defining the different terrains available. Each configuration class must -inherit from ``omni.isaac.lab.terrains.terrains_cfg.TerrainConfig`` and define the following attributes: +inherit from ``omni.isaac.orbit.terrains.terrains_cfg.TerrainConfig`` and define the following attributes: - ``name``: Name of the terrain. This is used for the prim name in the USD stage. - ``function``: Function to generate the terrain. This function must take as input the terrain difficulty @@ -20,7 +20,7 @@ from dataclasses import MISSING from typing import Literal -from omni.isaac.lab.utils import configclass +from omni.isaac.orbit.utils import configclass @configclass @@ -30,7 +30,7 @@ class FlatPatchSamplingCfg: For a given sub-terrain, this configuration specifies how to sample flat patches on the terrain. The sampled flat patches can be used for spawning robots, targets, etc. - Please check the function :meth:`~omni.isaac.lab.terrains.utils.find_flat_patches` for more details. + Please check the function :meth:`~omni.isaac.orbit.terrains.utils.find_flat_patches` for more details. """ num_patches: int = MISSING