Skip to content

[Question] Inconsistent and potentially swapped usage of pos_action_bounds and pos_action_threshold between FactoryEnv and ForgeEnv #5424

@MpxThs

Description

@MpxThs

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.

  1. 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], ...)

Image

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)
Image
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.
  1. 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:

  1. Was the swapping of these two variables in ForgeEnv intentional, or is it a bug?
  2. 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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions