Skip to content

Feature that enable modify hydra configuration group through command line #2737

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion source/isaaclab_tasks/config/extension.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

# Note: Semantic Versioning is used: https://semver.org/
version = "0.10.34"
version = "0.11.0"

# Description
title = "Isaac Lab Environments"
Expand Down
9 changes: 9 additions & 0 deletions source/isaaclab_tasks/docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Changelog
---------

0.11.0 (2025-06-18)
~~~~~~~~~~~~~~~~~~~~

Changed
^^^^^^^

* Add new feature that support hydra group config override, and provide example at Isaac-Reach-Franka-v0 env


0.10.34 (2025-06-16)
~~~~~~~~~~~~~~~~~~~~

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml",
"rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:FrankaReachPPORunnerCfg",
"skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml",
"configurable_entry_point": f"{agents.__name__}.configurables:AgentConfigurables",
},
)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Copyright (c) 2022-2025, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

# Copyright (c) 2022-2025, The Isaac Lab Project Developers.
Copy link
Contributor

Choose a reason for hiding this comment

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

we can remove this blob

# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause


from isaaclab.utils import configclass

from isaaclab_rl.rsl_rl import RslRlPpoActorCriticCfg, RslRlPpoAlgorithmCfg

from ..configurables import EnvConfigurables


@configclass
class AgentConfigurables(EnvConfigurables):
agent: dict[str, any] = {
"policy": {
Copy link
Contributor

Choose a reason for hiding this comment

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

how would this work for other RL libraries that don't use yaml?

"large_network": RslRlPpoActorCriticCfg(
init_noise_std=1.0,
actor_hidden_dims=[512, 256, 128, 64],
critic_hidden_dims=[512, 256, 128, 64],
activation="elu",
),
"medium_network": RslRlPpoActorCriticCfg(
init_noise_std=1.0,
actor_hidden_dims=[256, 128, 64],
critic_hidden_dims=[256, 128, 64],
activation="elu",
),
"small_network": RslRlPpoActorCriticCfg(
init_noise_std=1.0,
actor_hidden_dims=[128, 64],
critic_hidden_dims=[128, 64],
activation="elu",
),
},
"algorithm": {
"standard": RslRlPpoAlgorithmCfg(
value_loss_coef=1.0,
use_clipped_value_loss=True,
clip_param=0.2,
entropy_coef=0.001,
num_learning_epochs=8,
num_mini_batches=4,
learning_rate=1.0e-3,
schedule="adaptive",
gamma=0.99,
lam=0.95,
desired_kl=0.01,
max_grad_norm=1.0,
),
"small_batch": RslRlPpoAlgorithmCfg(
value_loss_coef=1.0,
use_clipped_value_loss=True,
clip_param=0.2,
entropy_coef=0.001,
num_learning_epochs=8,
num_mini_batches=16,
learning_rate=1.0e-4,
schedule="adaptive",
gamma=0.99,
lam=0.95,
desired_kl=0.01,
max_grad_norm=1.0,
),
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
# Copyright (c) 2022-2025, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

# Copyright (c) 2022-2025, The Isaac Lab Project Developers.
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

from isaaclab.managers import EventTermCfg as EventTerm
from isaaclab.managers import ObservationGroupCfg as ObsGroup
from isaaclab.managers import ObservationTermCfg as ObsTerm
from isaaclab.managers import SceneEntityCfg
from isaaclab.utils import configclass
from isaaclab.utils.noise import AdditiveUniformNoiseCfg as Unoise

import isaaclab_tasks.manager_based.manipulation.reach.mdp as mdp

from ...reach_env_cfg import EventCfg


# Observation configurations
@configclass
class StateNoNoiseObservationsCfg:
"""Observation specifications for the MDP."""

@configclass
class PolicyCfg(ObsGroup):
"""Observations for policy group."""

# observation terms (order preserved)
joint_pos = ObsTerm(func=mdp.joint_pos_rel)
joint_vel = ObsTerm(func=mdp.joint_vel_rel)
pose_command = ObsTerm(func=mdp.generated_commands, params={"command_name": "ee_pose"})
actions = ObsTerm(func=mdp.last_action)

def __post_init__(self):
self.enable_corruption = False
self.concatenate_terms = True

# observation groups
policy: PolicyCfg = PolicyCfg()


@configclass
class StateNoisyObservationsCfg:
"""Observation specifications for the MDP."""

@configclass
class PolicyCfg(ObsGroup):
"""Observations for policy group."""

# observation terms (order preserved)
joint_pos = ObsTerm(func=mdp.joint_pos_rel, noise=Unoise(n_min=-0.1, n_max=0.1))
joint_vel = ObsTerm(func=mdp.joint_vel_rel, noise=Unoise(n_min=-0.1, n_max=0.1))
pose_command = ObsTerm(func=mdp.generated_commands, params={"command_name": "ee_pose"})
actions = ObsTerm(func=mdp.last_action)

def __post_init__(self):
self.enable_corruption = True
self.concatenate_terms = True

# observation groups
policy: PolicyCfg = PolicyCfg()


@configclass
class JointRandPositionFrictionEventCfg(EventCfg):

reset_robot_joint_friction = EventTerm(
func=mdp.randomize_joint_parameters,
min_step_count_between_reset=720,
mode="reset",
params={
"asset_cfg": SceneEntityCfg("robot", joint_names=".*"),
"friction_distribution_params": (0.9, 1.1),
"operation": "scale",
"distribution": "gaussian",
},
)


@configclass
class JointRandPositionFrictionAmartureEventCfg(JointRandPositionFrictionEventCfg):
"""Configuration for events."""

reset_robot_joint_amature = EventTerm(
func=mdp.randomize_joint_parameters,
min_step_count_between_reset=720,
mode="reset",
params={
"asset_cfg": SceneEntityCfg("robot", joint_names=".*"),
"armature_distribution_params": (0.9, 1.1),
"operation": "scale",
"distribution": "gaussian",
},
)


@configclass
class EnvConfigurables:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it'll be helpful to have some documentation explaining usage and the setup for this, to highlight what can be modified and how the configs should be set up to allow those modifications through cli

env: dict[str, any] = {
"observations": {
"state_obs_no_noise": StateNoNoiseObservationsCfg(),
"state_obs_noisy": StateNoisyObservationsCfg(),
},
"actions.arm_action": {
"ik_abs_arm_action": mdp.DifferentialInverseKinematicsActionCfg(
asset_name="robot",
joint_names=["panda_joint.*"],
body_name="panda_hand",
controller=mdp.DifferentialIKControllerCfg(
command_type="pose", use_relative_mode=False, ik_method="dls"
),
body_offset=mdp.DifferentialInverseKinematicsActionCfg.OffsetCfg(pos=[0.0, 0.0, 0.107]),
),
"ik_rel_arm_action": mdp.DifferentialInverseKinematicsActionCfg(
asset_name="robot",
joint_names=["panda_joint.*"],
body_name="panda_hand",
controller=mdp.DifferentialIKControllerCfg(
command_type="pose", use_relative_mode=True, ik_method="dls"
),
scale=0.5,
body_offset=mdp.DifferentialInverseKinematicsActionCfg.OffsetCfg(pos=[0.0, 0.0, 0.107]),
),
"joint_pos_arm_action": mdp.JointPositionActionCfg(
asset_name="robot", joint_names=["panda_joint.*"], scale=0.5, use_default_offset=True
),
"osc_arm_action": mdp.OperationalSpaceControllerActionCfg(
asset_name="robot",
joint_names=["panda_joint.*"],
body_name="panda_hand",
controller_cfg=mdp.OperationalSpaceControllerCfg(
target_types=["pose_abs"],
impedance_mode="variable_kp",
inertial_dynamics_decoupling=True,
partial_inertial_dynamics_decoupling=False,
gravity_compensation=False,
motion_stiffness_task=100.0,
motion_damping_ratio_task=1.0,
motion_stiffness_limits_task=(50.0, 200.0),
nullspace_control="position",
),
nullspace_joint_pos_target="center",
position_scale=1.0,
orientation_scale=1.0,
stiffness_scale=100.0,
),
},
"events": {
"rand_joint_pos_friction": JointRandPositionFrictionEventCfg(),
"rand_joint_pos_friction_amarture": JointRandPositionFrictionAmartureEventCfg(),
},
"events.reset_robot_joints": {
"aggressive": EventTerm(
func=mdp.reset_joints_by_scale,
mode="reset",
params={
"position_range": (0.0, 2.0),
"velocity_range": (0.0, 1.0),
},
),
"easy": EventTerm(
func=mdp.reset_joints_by_scale,
mode="reset",
params={
"position_range": (0.0, 0.5),
"velocity_range": (0.0, 0.0),
},
),
},
}
Loading