@@ -127,3 +127,137 @@ the post init update is as follows:
127127
128128Here, when modifying ``env.decimation `` or ``env.sim.dt ``, the user needs to give the updated ``env.sim.render_interval ``,
129129``env.scene.height_scanner.update_period ``, and ``env.scene.contact_forces.update_period `` as input as well.
130+
131+
132+ Group Override
133+ --------------
134+ Group override lets you swap out entire groups of environment- or agent-level settings in one go.
135+ Instead of overriding individual fields, you select a named preset defined in your code.
136+
137+
138+ Group Presets
139+ ^^^^^^^^^^^^^
140+ First define the available group override options
141+
142+
143+ .. code-block :: python
144+
145+ @configclass
146+ class StateNoNoiseObservationsCfg :
147+ """ Observation specifications for the MDP."""
148+
149+ @configclass
150+ class PolicyCfg (ObsGroup ):
151+ """ Observations for policy group."""
152+
153+ # observation terms (order preserved)
154+ joint_pos = ObsTerm(func = mdp.joint_pos_rel)
155+ # other terms .......
156+
157+ def __post_init__ (self ):
158+ self .enable_corruption = False
159+ self .concatenate_terms = True
160+
161+ # observation groups
162+ policy: PolicyCfg = PolicyCfg()
163+
164+
165+ @configclass
166+ class EnvConfigurables :
167+ env: dict[str , any ] = {
168+ " observations" : {
169+ " state_obs_no_noise" : StateNoNoiseObservationsCfg(),
170+ " state_obs_noisy" : # other option,
171+ },
172+ " actions.arm_action" : {
173+ " joint_pos_arm_action" : mdp.JointPositionActionCfg(
174+ asset_name = " robot" , joint_names = [" panda_joint.*" ], scale = 0.5 , use_default_offset = True
175+ ),
176+ " osc_arm_action" : mdp.OperationalSpaceControllerActionCfg(
177+ asset_name = " robot" ,
178+ # rest of fields
179+ ),
180+ },
181+ " events" : {
182+ " rand_joint_pos_friction" : JointRandPositionFrictionEventCfg(),
183+ " rand_joint_pos_friction_amarture" : JointRandPositionFrictionAmartureEventCfg(),
184+ },
185+ " events.reset_robot_joints" : {
186+ " aggressive" : EventTerm(
187+ func = mdp.reset_joints_by_scale,
188+ mode = " reset" ,
189+ params = {
190+ " position_range" : (0.0 , 2.0 ),
191+ " velocity_range" : (0.0 , 1.0 ),
192+ },
193+ ),
194+ " easy" : # easy EventTerm with narrower ranges
195+ },
196+ }
197+
198+
199+
200+ @configclass
201+ class AgentConfigurables (EnvConfigurables ):
202+ agent: dict[str , any ] = {
203+ " policy" : {
204+ " large_network" : RslRlPpoActorCriticCfg(
205+ init_noise_std = 1.0 ,
206+ actor_hidden_dims = [512 , 256 , 128 , 64 ],
207+ critic_hidden_dims = [512 , 256 , 128 , 64 ],
208+ activation = " elu" ,
209+ ),
210+ " medium_network" : RslRlPpoActorCriticCfg(
211+ init_noise_std = 1.0 ,
212+ actor_hidden_dims = [256 , 128 , 64 ],
213+ critic_hidden_dims = [256 , 128 , 64 ],
214+ activation = " elu" ,
215+ ),
216+ " small_network" : RslRlPpoActorCriticCfg(
217+ init_noise_std = 1.0 ,
218+ actor_hidden_dims = [128 , 64 ],
219+ critic_hidden_dims = [128 , 64 ],
220+ activation = " elu" ,
221+ ),
222+ },
223+ # algorithm cfg.....
224+ }
225+
226+
227+ Group Registration
228+ ^^^^^^^^^^^^^^^^^^
229+ When you register your Gym environment, provide the ``configurable_entry_point `` pointing to your ``@configclass ``:
230+
231+ .. code-block :: python
232+
233+ gym.register(
234+ id = " Isaac-Reach-Franka-v0" ,
235+ entry_point = " isaaclab.envs:ManagerBasedRLEnv" ,
236+ disable_env_checker = True ,
237+ kwargs = {
238+ # … other cfg entry points …
239+ " configurable_entry_point" : f " { agents.__name__ } .configurables:AgentConfigurables "
240+ },
241+ )
242+
243+
244+ Override Syntax
245+ ^^^^^^^^^^^^^^^
246+ Select one preset per group via Hydra-style CLI flags. For example::
247+
248+ python scripts/reinforcement_learning/rsl_rl/train.py \
249+ --task=Isaac-Reach-Franka-v0 \
250+ --headless \
251+ env.events=rand_joint_pos_friction_amarture \
252+ env.observations=state_obs_no_noise \
253+ env.actions.arm_action=osc_arm_action \
254+ agent.policy=large_network
255+
256+ Under the hood, Hydra will replace:
257+
258+ - ``env.events `` with ``EnvConfigurables.env["rand_joint_pos_friction_amarture"] ``
259+ - ``env.observations `` with ``EnvConfigurables.env["state_obs_no_noise"] ``
260+ - ``env.actions.arm_action `` with ``EnvConfigurables.env["actions.arm_action"]["osc_arm_action"] ``
261+ - ``agent.policy `` with ``AgentConfigurables.agent["large_network"] ``
262+
263+ allowing you to switch qualitative modes of your experiments with a single flag.
0 commit comments