Question: About Action Clipping vs Joint Limits in locomotion Example #1285
-
Hi all, In the genesis/examples/locomotion environment, I noticed a potentially confusing discrepancy between action clipping and joint limits. In the step() function, actions are clipped like this: self.actions = torch.clip(actions, -self.env_cfg["clip_actions"], self.env_cfg["clip_actions"]) And in the config, clip_actions is set to 100.0 in the train file: "clip_actions": 100.0 Then the target positions are applied as: target_dof_pos = exec_actions * self.env_cfg["action_scale"] + self.default_dof_pos
self.robot.control_dofs_position(target_dof_pos, self.motors_dof_idx) However, according to the XML file, the joint limits (in radians) are significantly tighter, e.g.:
This raises two questions: Why is clip_actions set to such a large and seemingly arbitrary value (±100), which is clearly outside the feasible joint angle ranges? Is there an internal mechanism (e.g., action_scale) that keeps target_dof_pos within joint limits despite this large clipping range? Would appreciate any clarification on how these design choices are intended to work. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
@Kashu7100 Any idea about this? |
Beta Was this translation helpful? Give feedback.
-
You can use tighter bounds if you like. This bound parameter is originally from legged gym (if I remember correctly). |
Beta Was this translation helpful? Give feedback.
You can use tighter bounds if you like. This bound parameter is originally from legged gym (if I remember correctly).
The policy used here is PPO, whose outputs follow the Gaussian distribution (mean and std learned). So it will never likely to sample from the joint limits (in this case +/-100); that's why it doesn't really affect the policy learning.