-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Adds clip range for JointAction #1476
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
Conversation
|
Currently limits are handled by the actuators. Primarily this is done on the effort. |
|
So how can I clip actions in isaaclab like in legged_gym? |
|
Hmm I guess if you are using joint position commands the actuator limits won't really handle that. Actuator limits really only do effort. I will take another look at the current api and get back to you. |
|
Thanks for reply! |
|
The discussion in this PR may be relevant - #984. This seems like something that would make more sense for the wrappers. |
|
Which method is better? I don't know if this should be an env feature or an action feature |
|
Yeah #984 makes the clip for all actions where this PR will makes the clip configurable for each action separately. To me it makes sense to have the action handle the clipping rather than the environment. |
|
I guess this one only handles the joint_actions. |
|
For me, this allows more flexibility in configuring each joint individually. So is this PR necessary? |
|
That's a good point, this could be useful for configuring the joints separately, but only applicable for joint actions. Perhaps there's value in adopting both approaches. |
|
I could see both and also adding the clip configuration at the base ActionTerm/Cfg. It would just require that the actual processing be added to all provided actions. |
|
Hey @fan-ziqi would you be willing to add the clipping cfg to the top level ActionTermCfg, the clip checking in the top level ActionTerm.init , and then add the clipping execution to all the provided actions in the envs/mdp/actions directory? |
|
I have added But I have a question, is @configclass
class ActionsCfg:
"""Action specifications for the MDP."""
joint_pos = mdp.JointPositionActionCfg(
asset_name="robot", joint_names=[".*"], scale=0.5, use_default_offset=True, clip={".*": (-100.0, 100.0)}
)or @configclass
class ActionsCfg:
"""Action specifications for the MDP."""
joint_pos = mdp.JointPositionActionCfg(
asset_name="robot", joint_names=[".*"], scale=0.5, use_default_offset=True, clip=(-100.0, 100.0)
) |
|
I think being able to do clip=dict[str,tuple] is necessary to be able to set clips on a per joint basis. |
|
Thanks a lot for the feature! would it be possible to add some unit tests for it as well? |
source/extensions/omni.isaac.lab/omni/isaac/lab/envs/mdp/actions/binary_joint_actions.py
Outdated
Show resolved
Hide resolved
|
The preprocessing of clip has been moved to init @kellyguo11 |
Thanks! Please also run the formatter and would be great if you can add some tests. |
Code formatter has run. I am not familiar with the unit testing of this project. If you need me to write one, can you give me a reference? |
Great, thanks! Unit tests are generally implemented here: https://github.com/isaac-sim/IsaacLab/tree/main/source/extensions/omni.isaac.lab/test. We can maybe copy one of the manager ones and apply it to the ActionManager with ActionTerms that have a clipping parameter. |
|
I noticed that there are no unit tests for |
Signed-off-by: Kelly Guo <[email protected]>
# Description This PR adds support for action clip to all mdp/actions. Clip ranges can be specified as a dictionary of joint names and tuple for the lower and upper bounds of the clip in the ActionTermCfg. ## Type of change - New feature (non-breaking change which adds functionality) - This change requires a documentation update ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there --------- Signed-off-by: Kelly Guo <[email protected]> Co-authored-by: Kelly Guo <[email protected]>
Description
This PR adds support for action clip to all mdp/actions. Clip ranges can be specified as a dictionary of joint names and tuple for the lower and upper bounds of the clip in the ActionTermCfg.
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there