-
Notifications
You must be signed in to change notification settings - Fork 803
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes lift environment for Franka robot (#264)
# Description Adds the Franka lift RL environment. It also checks that the reach environment is working. ## Type of change - New feature (non-breaking change which adds functionality) ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./orbit.sh --format` - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there
- Loading branch information
David Hoeller
authored
Nov 30, 2023
1 parent
0691eef
commit 1b293e1
Showing
25 changed files
with
533 additions
and
825 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...nsions/omni.isaac.orbit_tasks/omni/isaac/orbit_tasks/manipulation/lift/config/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright (c) 2022-2023, The ORBIT Project Developers. | ||
# All rights reserved. | ||
# | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
"""Configurations for the object lift environments.""" | ||
|
||
# We leave this file empty since we don't want to expose any configs in this package directly. | ||
# We still need this file to import the "config" module in the parent package. |
32 changes: 32 additions & 0 deletions
32
...omni.isaac.orbit_tasks/omni/isaac/orbit_tasks/manipulation/lift/config/franka/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Copyright (c) 2022-2023, The ORBIT Project Developers. | ||
# All rights reserved. | ||
# | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
|
||
import gymnasium as gym | ||
|
||
from . import agents, env_cfg | ||
|
||
## | ||
# Register Gym environments. | ||
## | ||
gym.register( | ||
id="Isaac-Lift-Cube-Franka-v0", | ||
entry_point="omni.isaac.orbit.envs:RLTaskEnv", | ||
kwargs={ | ||
"env_cfg_entry_point": env_cfg.FrankaCubeLiftEnvCfg, | ||
"rsl_rl_cfg_entry_point": agents.rsl_rl_cfg.LiftCubePPORunnerCfg, | ||
}, | ||
disable_env_checker=True, | ||
) | ||
|
||
gym.register( | ||
id="Isaac-Lift-Cube-Franka-Play-v0", | ||
entry_point="omni.isaac.orbit.envs:RLTaskEnv", | ||
kwargs={ | ||
"env_cfg_entry_point": env_cfg.FrankaCubeLiftEnvCfg_PLAY, | ||
"rsl_rl_cfg_entry_point": agents.rsl_rl_cfg.LiftCubePPORunnerCfg, | ||
}, | ||
disable_env_checker=True, | ||
) |
6 changes: 6 additions & 0 deletions
6
...aac.orbit_tasks/omni/isaac/orbit_tasks/manipulation/lift/config/franka/agents/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Copyright (c) 2022-2023, The ORBIT Project Developers. | ||
# All rights reserved. | ||
# | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
from . import rsl_rl_cfg # noqa: F401, F403 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
94 changes: 94 additions & 0 deletions
94
.../omni.isaac.orbit_tasks/omni/isaac/orbit_tasks/manipulation/lift/config/franka/env_cfg.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# Copyright (c) 2022-2023, The ORBIT Project Developers. | ||
# All rights reserved. | ||
# | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
from omni.isaac.orbit.assets import RigidObjectCfg | ||
from omni.isaac.orbit.sensors import FrameTransformerCfg | ||
from omni.isaac.orbit.sensors.frame_transformer.frame_transformer_cfg import OffsetCfg | ||
from omni.isaac.orbit.sim.schemas.schemas_cfg import RigidBodyPropertiesCfg | ||
from omni.isaac.orbit.sim.spawners.from_files.from_files_cfg import UsdFileCfg | ||
from omni.isaac.orbit.utils import configclass | ||
from omni.isaac.orbit.utils.assets import ISAAC_NUCLEUS_DIR | ||
|
||
from omni.isaac.orbit_tasks.manipulation.lift import mdp | ||
from omni.isaac.orbit_tasks.manipulation.lift.lift_env_cfg import LiftEnvCfg | ||
|
||
## | ||
# Pre-defined configs | ||
## | ||
# isort: off | ||
from omni.isaac.orbit.assets.config.franka import FRANKA_PANDA_ARM_WITH_PANDA_HAND_CFG | ||
from omni.isaac.orbit.markers.config import FRAME_MARKER_CFG | ||
|
||
|
||
@configclass | ||
class FrankaCubeLiftEnvCfg(LiftEnvCfg): | ||
def __post_init__(self): | ||
# post init of parent | ||
super().__post_init__() | ||
|
||
# Set Franka as robot | ||
self.scene.robot = FRANKA_PANDA_ARM_WITH_PANDA_HAND_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") | ||
|
||
# Set actions for the specific robot type (franka) | ||
self.actions.body_joint_pos = mdp.JointPositionActionCfg( | ||
asset_name="robot", joint_names=["panda_joint.*"], scale=1.0, use_default_offset=True | ||
) | ||
self.actions.finger_joint_pos = mdp.BinaryJointPositionActionCfg( | ||
asset_name="robot", | ||
joint_names=["panda_finger.*"], | ||
open_command_expr={"panda_finger_.*": 0.3}, | ||
close_command_expr={"panda_finger_.*": 0.0}, | ||
) | ||
# Set the body name for the end effector | ||
self.commands.body_name = "panda_hand" | ||
|
||
# Set Cube as object | ||
self.scene.object = RigidObjectCfg( | ||
prim_path="{ENV_REGEX_NS}/Object", | ||
init_state=RigidObjectCfg.InitialStateCfg(pos=[0.5, 0, 0.055], rot=[1, 0, 0, 0]), | ||
spawn=UsdFileCfg( | ||
usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/Blocks/DexCube/dex_cube_instanceable.usd", | ||
scale=(0.8, 0.8, 0.8), | ||
rigid_props=RigidBodyPropertiesCfg( | ||
solver_position_iteration_count=16, | ||
solver_velocity_iteration_count=1, | ||
max_angular_velocity=1000.0, | ||
max_linear_velocity=1000.0, | ||
max_depenetration_velocity=5.0, | ||
disable_gravity=False, | ||
), | ||
), | ||
) | ||
|
||
# Listens to the required transforms | ||
marker_cfg = FRAME_MARKER_CFG.copy() | ||
marker_cfg.markers["frame"].scale = (0.1, 0.1, 0.1) | ||
marker_cfg.prim_path = "/Visuals/FrameTransformer" | ||
self.scene.ee_frame = FrameTransformerCfg( | ||
prim_path="{ENV_REGEX_NS}/Robot/panda_link0", | ||
debug_vis=False, | ||
visualizer_cfg=marker_cfg, | ||
target_frames=[ | ||
FrameTransformerCfg.FrameCfg( | ||
prim_path="{ENV_REGEX_NS}/Robot/panda_hand", | ||
name="end_effector", | ||
offset=OffsetCfg( | ||
pos=[0.0, 0.0, 0.1034], | ||
), | ||
), | ||
], | ||
) | ||
|
||
|
||
@configclass | ||
class FrankaCubeLiftEnvCfg_PLAY(FrankaCubeLiftEnvCfg): | ||
def __post_init__(self): | ||
# post init of parent | ||
super().__post_init__() | ||
# make a smaller scene for play | ||
self.scene.num_envs = 50 | ||
self.scene.env_spacing = 2.5 | ||
# disable randomization for play | ||
self.observations.policy.enable_corruption = False |
Oops, something went wrong.