Question
While studying the source code for the direct/factory and direct/forge environments, I noticed a significant discrepancy in how pos_action_bounds and pos_action_threshold (and their rotational counterparts) are applied to the policy actions. It seems these two variables might have been accidentally swapped in forge_env.py.
- The Discrepancy in Action Scaling vs. Clipping
in FactoryEnv _apply_action():
-
pos_thresholdis used as the action scale:pos_actions = self.actions[:, 0:3] * self.pos_threshold
-
pos_action_bounds is used to clip the maximum workspace range:torch.clip(delta_pos, -self.cfg.ctrl.pos_action_bounds[0], ...)
in ForgeEnv _apply_action():
pos_action_boundsis used as the action scale:`pos_actions = pos_actions @ torch.diag(torch.tensor(self.cfg.ctrl.pos_action_bounds, ...))
pos_threshold is used to clip the delta step:torch.clip(self.delta_pos, -self.pos_threshold, self.pos_threshold)
2. The Contradiction with Config Values:in [FactoryEnvCfg](https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab_tasks/isaaclab_tasks/direct/factory/factory_env_cfg.py) `CtrlCfg`,the default definitions are:
pos_action_bounds = [0.05, 0.05, 0.05]
pos_action_threshold = [0.02, 0.02, 0.02]
Since bounds is much larger than threshold, the naming implies bounds should be the absolute safety limit, while threshold is the maximum single-step increment. The way they are used in ForgeEnv contradicts this intuition.
- The Domain Randomization Paradox in
ForgeEnv:
in ForgeEnv._reset_idx(), domain randomization (noise) is added to self.pos_threshold
self.pos_threshold = forge_utils.get_random_prop_gains(
self.pos_threshold, self.cfg.ctrl.pos_threshold_noise_level, ...
)
If pos_threshold is simply a hard clipping limit (as currently used in Forge_Env's clipping), applying noise to it seems physically meaningless. However, if pos_threshold was originally intended to be the action scale (as it is in FactoryEnv), then adding noise makes perfect sense.
Questions:
- Was the swapping of these two variables in
ForgeEnv intentional, or is it a bug?
- If intentional, could you clarify the physical meaning of randomizing the clipping limit *
pos_threshold in Forge)?
Thank you for your time and for maintaining this great repository!
Build Info
- Isaac Lab Version: 2.2.1
- Isaac Sim Version: [4.5]
Question
While studying the source code for the
direct/factoryanddirect/forgeenvironments, I noticed a significant discrepancy in how pos_action_boundsandpos_action_threshold(and their rotational counterparts) are applied to the policy actions. It seems these two variables might have been accidentally swapped inforge_env.py.in FactoryEnv
_apply_action():pos_thresholdis used as the action scale:pos_actions = self.actions[:, 0:3] * self.pos_thresholdpos_action_boundsis used to clip the maximum workspace range:torch.clip(delta_pos, -self.cfg.ctrl.pos_action_bounds[0], ...)in ForgeEnv
_apply_action():pos_action_boundsis used as the action scale:`pos_actions = pos_actions @ torch.diag(torch.tensor(self.cfg.ctrl.pos_action_bounds, ...))pos_thresholdis used to clip the delta step:torch.clip(self.delta_pos, -self.pos_threshold, self.pos_threshold)2. The Contradiction with Config Values:in [FactoryEnvCfg](https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab_tasks/isaaclab_tasks/direct/factory/factory_env_cfg.py) `CtrlCfg`,the default definitions are:
pos_action_bounds = [0.05, 0.05, 0.05]pos_action_threshold = [0.02, 0.02, 0.02]Since
boundsis much larger thanthreshold, the naming impliesboundsshould be the absolute safety limit, whilethresholdis the maximum single-step increment. The way they are used inForgeEnvcontradicts this intuition.ForgeEnv:in
ForgeEnv._reset_idx(), domain randomization (noise) is added toself.pos_thresholdIf
pos_thresholdis simply a hard clipping limit (as currently used inForge_Env's clipping), applying noise to it seems physically meaningless. However, ifpos_thresholdwas originally intended to be the action scale (as it is inFactoryEnv), then adding noise makes perfect sense.Questions:
ForgeEnvintentional, or is it a bug?pos_thresholdin Forge)?Thank you for your time and for maintaining this great repository!
Build Info