-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix joint friction/armature set events #2439
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
base: main
Are you sure you want to change the base?
Conversation
@@ -574,7 +574,7 @@ def randomize_joint_parameters( | |||
distribution=distribution, | |||
) | |||
asset.write_joint_friction_coefficient_to_sim( | |||
friction_coeff[env_ids[:, None], joint_ids], joint_ids=joint_ids, env_ids=env_ids | |||
friction_coeff[env_ids, joint_ids], joint_ids=joint_ids, env_ids=env_ids |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fix won't work if you have a subset of env ids and joint ids over which the term is operating. There is definitely a bug here if joint_ids
is a slice.
The way to fix it is to check if one of them is a slice. If yes, we keep the broadcasting. Otherwise we index directly.
func=mdp.randomize_joint_parameters, | ||
mode="startup", | ||
params={ | ||
"asset_cfg": SceneEntityCfg("robot", body_names=".*"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to make joint_names
as a subset of joints to see if the above fix still works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, this seems like an issue because I'm specifying body_names
and not joint_names
.
I can close this if that is correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
randomize_joint_parameters should work with joint_names instead of body_names, since it modifies the joints in the articulations instead of bodies.
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
List any dependencies that are required for this change.
Fixes #2440, which was a bug that passed in a wrong dim tensor into the joint friction/armature attribute
Adds a dummy joint rand event in anymalc env cfg to make sure this doesn't break again.
Type of change
Screenshots
Please attach before and after screenshots of the change if applicable.
Checklist
pre-commit
checks with./isaaclab.sh --format
config/extension.toml
fileCONTRIBUTORS.md
or my name already exists there