Skip to content
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

[Bug Report] randomize_joint_parameters shape mismatch #1011

Closed
MoreTore opened this issue Sep 21, 2024 · 0 comments · Fixed by #1005
Closed

[Bug Report] randomize_joint_parameters shape mismatch #1011

MoreTore opened this issue Sep 21, 2024 · 0 comments · Fixed by #1005
Assignees

Comments

@MoreTore
Copy link
Contributor

Describe the bug

when using randomize_joint_parameters like this:

    random_params = EventTerm(
        func=mdp.randomize_joint_parameters,
        mode="reset",
        params={
            "asset_cfg": SceneEntityCfg("robot", joint_ids=slice(None)),
            "friction_distribution_params": (0.0, 5.0),
            "armature_distribution_params": (0.0, 5.0),
            "operation": "abs",
        },
    )

the call to _randomize_prop_by_op fails because the slice assignment adds an extra dimension.

Exception has occurred: RuntimeError
shape mismatch: value tensor of shape [2, 12] cannot be broadcast to indexing result of shape [2, 1, 12]
  File "/home/ryley/Projects/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/envs/mdp/events.py", line 937, in _randomize_prop_by_op
    data[dim_0_ids, dim_1_ids] = dist_fn(*distribution_parameters, (n_dim_0, n_dim_1), device=data.device)
  File "/home/ryley/Projects/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/envs/mdp/events.py", line 383, in randomize_joint_parameters

Steps to reproduce:

Add this to

    random_params = EventTerm(
        func=mdp.randomize_joint_parameters,
        mode="reset",
        params={
            "asset_cfg": SceneEntityCfg("robot", joint_ids=slice(None)),
            "friction_distribution_params": (0.0, 5.0),
            "armature_distribution_params": (0.0, 5.0),
            "operation": "abs",
        },
    )

And run the ---task Isaac-Velocity-Flat-Unitree-Go2-v0

MoreTore added a commit to MoreTore/IsaacLab that referenced this issue Sep 21, 2024
@Dhoeller19 Dhoeller19 self-assigned this Oct 14, 2024
MoreTore added a commit to MoreTore/IsaacLab that referenced this issue Oct 29, 2024
…ator models. isaac-sim#1000

Set default stiffness, damping for explicit actuators isaac-sim#1006

fixes randomize_joint_parameters shape mismatch isaac-sim#1011
iamdrfly pushed a commit to iamdrfly/IsaacLab that referenced this issue Nov 21, 2024
)

# Description
resolves: isaac-sim#1000
resolves: isaac-sim#1011
depends: isaac-sim#1006

## Type of change
- New feature (non-breaking change which adds functionality)
- This change may require a documentation update

## Checklist

- [x] have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] My changes generate no new warnings
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
- [x] I have made corresponding changes to the documentation
- [ ] 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
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 a pull request may close this issue.

2 participants