Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/source/_static/css/environment-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
["Isaac-Reorient-KukaAllegro", "rsl_rl", "isaacsim_physx,newton_mjwarp,ovphysx", "", "cube,shapes"],
["Isaac-Reorient-KukaAllegro-Camera", "rsl_rl", "isaacsim_physx,newton_mjwarp,ovphysx", "isaacsim_rtx,newton_renderer,ovrtx", "albedo128,albedo256,albedo64,cube,depth128,depth256,depth64,duo_camera,raycaster_depth128,raycaster_depth256,raycaster_depth64,rgb128,rgb256,rgb64,semantic_segmentation128,semantic_segmentation256,semantic_segmentation64,shapes,simple_shading_constant_diffuse128,simple_shading_constant_diffuse256,simple_shading_constant_diffuse64,simple_shading_diffuse_mdl128,simple_shading_diffuse_mdl256,simple_shading_diffuse_mdl64,simple_shading_full_mdl128,simple_shading_full_mdl256,simple_shading_full_mdl64,single_camera"],
["Isaac-Shadow-Handover-Direct", "rl_games,rsl_rl,skrl", "isaacsim_physx,newton_mjwarp,ovphysx", "", ""],
["Isaac-Shadow-Handover", "rsl_rl", "isaacsim_physx,newton_mjwarp,ovphysx", "", "randomized"],
["Isaac-Velocity-Flat-AnymalD", "rsl_rl,skrl", "isaacsim_physx,newton_kamino,newton_mjwarp,ovphysx", "", ""],
["Isaac-Velocity-Flat-Cassie", "rsl_rl,skrl", "isaacsim_physx,newton_kamino,newton_mjwarp,ovphysx", "", ""],
["Isaac-Velocity-Flat-G1", "rsl_rl,skrl", "isaacsim_physx,newton_kamino,newton_mjwarp,ovphysx", "", ""],
Expand Down
5 changes: 5 additions & 0 deletions docs/source/overview/environments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1260,6 +1260,11 @@ including disabling runtime perturbations used for training.
- Direct
- **rl_games** (PPO), **rsl_rl** (PPO), **skrl** (PPO, IPPO, MAPPO)
- **physics=** ``isaacsim_physx``, ``newton_mjwarp``, ``ovphysx``
* - Isaac-Shadow-Handover
- Manager Based
- **rsl_rl** (PPO)
- | **physics=** ``isaacsim_physx``, ``newton_mjwarp``, ``ovphysx``
| **presets=** ``randomized``
* - Isaac-Velocity-Flat-AnymalD
- Manager Based
- **rsl_rl** (PPO, DISTILLATION, DISTILLATION_RECURRENT, RECURRENT), **skrl** (PPO)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Added
^^^^^

* Added manager-based counterparts for the Shadow handover and Shadow camera
reorientation tasks, completing the manager coverage of the dexterous task
families.
* Added a Direct-versus-manager value-parity check for the handover task,
alongside the reorientation one.

Changed
^^^^^^^

* Changed the manager-based Shadow camera task to run on the Kit PhysX backend by
default, since only the Isaac RTX tiled camera renders the default modalities.
Select Newton with ``physics=newton_mjwarp`` for the state-only observation
groups.
* Changed the handover reward to a plain reward term, moving success and
goal-distance bookkeeping to
:class:`~isaaclab_tasks.core.handover.mdp.commands.HandoverCommand`.
* Changed the reorientation action configuration to name its term through a
module path, so loading a task configuration no longer imports the USD
bindings.

Removed
^^^^^^^

* Removed the ``Isaac-Reorient-Cube-Shadow-Camera-Play`` and
``Isaac-Reorient-Cube-Shadow-Camera-Direct-Play`` tasks. Use the training task
with ``--play`` instead; playback settings now live in
:meth:`~isaaclab.envs.ManagerBasedRLEnvCfg.play_mode`.

Fixed
^^^^^

* Fixed the Shadow camera feature-extractor observation term ignoring its
declared ``feature_extractor_cfg`` parameter.
10 changes: 10 additions & 0 deletions source/isaaclab_tasks/isaaclab_tasks/core/handover/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
# Register Gym environments.
##

gym.register(
id="Isaac-Shadow-Handover",
entry_point="isaaclab.envs:ManagerBasedRLEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": f"{__name__}.handover_manager_env_cfg:HandoverManagerEnvCfg",
"rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:HandoverPPORunnerCfg",
},
)

gym.register(
id="Isaac-Shadow-Handover-Direct",
entry_point=f"{__name__}.handover_env:HandoverEnv",
Expand Down
198 changes: 33 additions & 165 deletions source/isaaclab_tasks/isaaclab_tasks/core/handover/handover_env_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@
from isaaclab_ov.physics import OvPhysxCfg
from isaaclab_physx.physics import PhysxCfg

import isaaclab.envs.mdp as mdp
import isaaclab.sim as sim_utils
import isaaclab.utils.math as math_utils
from isaaclab.assets import ArticulationCfg, RigidObjectCfg
from isaaclab.envs import DirectMARLEnvCfg
from isaaclab.managers import EventTermCfg as EventTerm
from isaaclab.managers import SceneEntityCfg
from isaaclab.markers import VisualizationMarkersCfg
from isaaclab.physics import PhysxAutoCfg
from isaaclab.scene import InteractiveSceneCfg
Expand All @@ -33,120 +30,21 @@
from isaaclab_assets.robots.shadow_hand import SHADOW_HAND_CFG, SHADOW_HAND_NEWTON_CFG


@configclass
class EventCfg:
"""Configuration for randomization (PhysX path).

Note: this config is currently not wired into ``HandoverEnvCfg.events`` -
it is kept as a reference for future event-randomization work. The event
terms here use PhysX-only APIs (rigid-body materials, fixed tendons), so
they would need a Newton variant before being enabled in the env.
"""

# -- robot
robot_physics_material = EventTerm(
func=mdp.randomize_rigid_body_material,
mode="reset",
min_step_count_between_reset=720,
params={
"asset_cfg": SceneEntityCfg("right_hand"),
"static_friction_range": (0.7, 1.3),
"dynamic_friction_range": (1.0, 1.0),
"restitution_range": (1.0, 1.0),
"num_buckets": 250,
},
)
robot_joint_stiffness_and_damping = EventTerm(
func=mdp.randomize_actuator_gains,
min_step_count_between_reset=720,
mode="reset",
params={
"asset_cfg": SceneEntityCfg("right_hand", joint_names=".*"),
"stiffness_distribution_params": (0.75, 1.5),
"damping_distribution_params": (0.3, 3.0),
"operation": "scale",
"distribution": "log_uniform",
},
)
robot_joint_pos_limits = EventTerm(
func=mdp.randomize_joint_parameters,
min_step_count_between_reset=720,
mode="reset",
params={
"asset_cfg": SceneEntityCfg("right_hand", joint_names=".*"),
"lower_limit_distribution_params": (0.00, 0.01),
"upper_limit_distribution_params": (0.00, 0.01),
"operation": "add",
"distribution": "gaussian",
},
)
robot_tendon_properties = EventTerm(
func=mdp.randomize_fixed_tendon_parameters,
min_step_count_between_reset=720,
mode="reset",
params={
"asset_cfg": SceneEntityCfg("right_hand", fixed_tendon_names=".*"),
"stiffness_distribution_params": (0.75, 1.5),
"damping_distribution_params": (0.3, 3.0),
"operation": "scale",
"distribution": "log_uniform",
},
)

# -- object
object_physics_material = EventTerm(
func=mdp.randomize_rigid_body_material,
min_step_count_between_reset=720,
mode="reset",
params={
"asset_cfg": SceneEntityCfg("object"),
"static_friction_range": (0.7, 1.3),
"dynamic_friction_range": (1.0, 1.0),
"restitution_range": (1.0, 1.0),
"num_buckets": 250,
},
)
object_scale_mass = EventTerm(
func=mdp.randomize_rigid_body_mass,
min_step_count_between_reset=720,
mode="reset",
params={
"asset_cfg": SceneEntityCfg("object"),
"mass_distribution_params": (0.5, 1.5),
"operation": "scale",
"distribution": "uniform",
},
)

# -- scene
reset_gravity = EventTerm(
func=mdp.randomize_physics_scene_gravity,
mode="interval",
is_global_time=True,
interval_range_s=(36.0, 36.0), # time_s = num_steps * (decimation * dt)
params={
"gravity_distribution_params": ([0.0, 0.0, 0.0], [0.0, 0.0, 0.4]),
"operation": "add",
"distribution": "gaussian",
},
)


def _shadow_hand_cfg(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something is wrong in this cfg, we shouldn't work around the asset and behavior different like this.....

prim_path: str,
init_pos: tuple[float, float, float],
init_rot: tuple[float, float, float, float],
) -> PresetCfg:
"""Per-hand Shadow Hand preset (PhysX, Newton MJWarp, and OVPhysX variants).
"""Build the per-hand Shadow Hand preset for each supported backend.

All variants are placed at *prim_path* with the same init pose; per-hand
differences (right vs left) come from the caller's *prim_path* / *init_pos* /
*init_rot* — the gain tuning is identical on both hands.
Args:
prim_path: Scene path the hand spawns at.
init_pos: Spawn position [m].
init_rot: Spawn orientation as ``(w, x, y, z)``.

The Newton variant reuses the shared actuator defined on ``SHADOW_HAND_NEWTON_CFG``,
raising its gains to ``20.0`` / ``2.0`` -- the catch needs more joint authority than
reorientation. The scalar replaces the per-joint gain mapping, so it applies to the whole
actuator group.
Returns:
A preset carrying the PhysX, Newton MJWarp and OvPhysX variants, each at
*prim_path* with the given pose. The two hands differ only in these arguments.
"""
physx_cfg = SHADOW_HAND_CFG.replace(prim_path=prim_path).replace(
init_state=ArticulationCfg.InitialStateCfg(pos=init_pos, rot=init_rot, joint_pos={".*": 0.0})
Expand Down Expand Up @@ -196,67 +94,37 @@ def _shadow_hand_cfg(
)


@configclass
class ObjectCfg(PresetCfg):
"""Hand-over object preset.

Both backends spawn the same procedural sphere as a free rigid body:
Newton's :class:`~isaaclab_newton.assets.RigidObject` resolves the
asset via the ``UsdPhysics.RigidBodyAPI`` that
:class:`~isaaclab.sim.RigidBodyPropertiesCfg` applies. The Newton
variant drops PhysX-only knobs (per-shape solver iterations, sleep
thresholds, max depenetration velocity, custom physics material).
"""

physx = RigidObjectCfg(
prim_path="{ENV_REGEX_NS}/object",
spawn=sim_utils.SphereCfg(
radius=OBJECT_RADIUS,
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(0.8, 1.0, 0.0)),
physics_material=sim_utils.RigidBodyMaterialCfg(static_friction=0.7),
rigid_props=sim_utils.RigidBodyPropertiesCfg(
kinematic_enabled=False,
disable_gravity=False,
enable_gyroscopic_forces=True,
solver_position_iteration_count=8,
solver_velocity_iteration_count=0,
sleep_threshold=0.005,
stabilization_threshold=0.0025,
max_depenetration_velocity=1000.0,
),
collision_props=sim_utils.CollisionPropertiesCfg(),
mass_props=sim_utils.MassPropertiesCfg(density=500.0),
),
init_state=RigidObjectCfg.InitialStateCfg(pos=(0.0, -0.39, 0.54), rot=(0.0, 0.0, 0.0, 1.0)),
)
newton_mjwarp = RigidObjectCfg(
prim_path="{ENV_REGEX_NS}/object",
spawn=sim_utils.SphereCfg(
radius=OBJECT_RADIUS,
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(0.8, 1.0, 0.0)),
rigid_props=sim_utils.RigidBodyPropertiesCfg(
kinematic_enabled=False,
disable_gravity=False,
enable_gyroscopic_forces=True,
),
collision_props=sim_utils.CollisionPropertiesCfg(),
mass_props=sim_utils.MassPropertiesCfg(density=500.0),
BALL_CFG = RigidObjectCfg(
prim_path="{ENV_REGEX_NS}/object",
spawn=sim_utils.SphereCfg(
radius=OBJECT_RADIUS,
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(0.8, 1.0, 0.0)),
physics_material=sim_utils.RigidBodyMaterialCfg(static_friction=0.7),
rigid_props=sim_utils.RigidBodyPropertiesCfg(
kinematic_enabled=False,
disable_gravity=False,
enable_gyroscopic_forces=True,
solver_position_iteration_count=8,
solver_velocity_iteration_count=0,
sleep_threshold=0.005,
stabilization_threshold=0.0025,
max_depenetration_velocity=1000.0,
),
init_state=RigidObjectCfg.InitialStateCfg(pos=(0.0, -0.39, 0.54), rot=(0.0, 0.0, 0.0, 1.0)),
)
ovphysx = physx
isaacsim_physx = physx
default = newton_mjwarp
collision_props=sim_utils.CollisionPropertiesCfg(),
mass_props=sim_utils.MassPropertiesCfg(density=500.0),
),
init_state=RigidObjectCfg.InitialStateCfg(pos=(0.0, -0.39, 0.54), rot=(0.0, 0.0, 0.0, 1.0)),
)
"""Hand-over ball, thrown from one Shadow hand to the other."""


@configclass
class PhysicsCfg(PresetCfg):
"""Physics-backend preset (PhysX vs Newton/MJWarp).

Newton settings mirror the single-agent ShadowHand Newton port: elliptic
cone, ``impratio=10`` (favors normal contacts over friction), 100 solver
iterations, 2 substeps. Empirically converges on the single-agent ShadowHand
tasks; tuning may be needed for handover-specific contact dynamics.
Newton mirrors the single-agent Shadow Hand Newton port: an elliptic friction
cone with ``impratio=10``, which weights normal contacts over friction, 100
solver iterations and 2 substeps.
"""

isaacsim_physx = PhysxCfg(
Expand Down Expand Up @@ -310,7 +178,7 @@ class HandoverEnvCfg(DirectMARLEnvCfg):
fingertip_body_names = FINGERTIP_BODY_NAMES

# in-hand object
object_cfg: ObjectCfg = ObjectCfg()
object_cfg: RigidObjectCfg = BALL_CFG
# goal object
goal_object_cfg: VisualizationMarkersCfg = GOAL_MARKER_CFG
# scene
Expand Down
Loading
Loading