Skip to content

Conversation

@asuzukii
Copy link

@asuzukii asuzukii commented May 7, 2025

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

  • Bug fix (non-breaking change which fixes an issue)

Screenshots

Please attach before and after screenshots of the change if applicable.

Checklist

  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@asuzukii asuzukii marked this pull request as ready for review May 7, 2025 18:28
)
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
Copy link
Contributor

@Mayankm96 Mayankm96 May 7, 2025

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=".*"),
Copy link
Contributor

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.

Copy link
Author

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

Copy link
Contributor

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.

@kellyguo11
Copy link
Contributor

Closing this one for now as I don't believe this is the correct fix / use case of the API. Please feel free to open a new issue/PR if needed.

@kellyguo11 kellyguo11 closed this Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report] Joint Friction/Armature Randomization Fails with Error

3 participants