Skip to content

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

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

Open
2 of 3 tasks
asuzukii opened this issue May 7, 2025 · 1 comment · May be fixed by #2439
Open
2 of 3 tasks

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

asuzukii opened this issue May 7, 2025 · 1 comment · May be fixed by #2439
Labels
bug Something isn't working

Comments

@asuzukii
Copy link

asuzukii commented May 7, 2025

Describe the bug

When adding a joint friction/armature randomization event in a DirectRLEnv, the assignment fails due to a shape error.

Steps to reproduce

  1. Add joint randomization, e.g. in anymalc_env_cfg:
@configclass
class EventCfg:
    """Configuration for randomization."""

    # existing events...
    add_joint_randomization = EventTerm(
        func=mdp.randomize_joint_parameters,
        mode="startup",
        params={
            "asset_cfg": SceneEntityCfg("robot", body_names=".*"),
            "friction_distribution_params": (0.0, 0.0),
            "armature_distribution_params": (0.0, 0.0),
        },
    )

  1. Run the task that has the event to get this error:
Error executing job with overrides: []
Traceback (most recent call last):
  File "/home/aksuzuki/code/IsaacLab/source/isaaclab_tasks/isaaclab_tasks/utils/hydra.py", line 101, in hydra_main
    func(env_cfg, agent_cfg, *args, **kwargs)
  File "/home/aksuzuki/code/IsaacLab/scripts/reinforcement_learning/rsl_rl/train.py", line 141, in main
    env = gym.make(args_cli.task, cfg=env_cfg, render_mode="rgb_array" if args_cli.video else None)
  File "/home/aksuzuki/code/IsaacLab/env_isaaclab/lib/python3.10/site-packages/gymnasium/envs/registration.py", line 742, in make
    env = env_creator(**env_spec_kwargs)
  File "/home/aksuzuki/code/IsaacLab/source/isaaclab_tasks/isaaclab_tasks/direct/anymal_c/anymal_c_env.py", line 23, in __init__
    super().__init__(cfg, render_mode, **kwargs)
  File "/home/aksuzuki/code/IsaacLab/source/isaaclab/isaaclab/envs/direct_rl_env.py", line 208, in __init__
    self.event_manager.apply(mode="startup")
  File "/home/aksuzuki/code/IsaacLab/source/isaaclab/isaaclab/managers/event_manager.py", line 273, in apply
    term_cfg.func(self._env, env_ids, **term_cfg.params)
  File "/home/aksuzuki/code/IsaacLab/source/isaaclab/isaaclab/envs/mdp/events.py", line 576, in randomize_joint_parameters
    asset.write_joint_friction_coefficient_to_sim(
  File "/home/aksuzuki/code/IsaacLab/source/isaaclab/isaaclab/assets/articulation/articulation.py", line 810, in write_joint_friction_coefficient_to_sim
    self._data.joint_friction_coeff[env_ids, joint_ids] = joint_friction_coeff
RuntimeError: shape mismatch: value tensor of shape [4096, 1, 12] cannot be broadcast to indexing result of shape [4096, 12]

System Info

Describe the characteristic of your environment:

  • Commit: 82cb320
  • Isaac Sim Version: 4.5
  • OS: Ubuntu 22.04
  • GPU: Quadro RTX 4000
  • CUDA: 12.4
  • GPU Driver: 550.120

Additional context

Add any other context about the problem here.

Checklist

  • I have checked that there is no similar issue in the repo (required)
  • I have checked that the issue is not in running Isaac Sim itself and is related to the repo

Acceptance Criteria

Add the criteria for which this task is considered done. If not known at issue creation time, you can add this once the issue is assigned.

  • Getting the assignment to properly work again
@asuzukii asuzukii linked a pull request May 7, 2025 that will close this issue
6 tasks
@RandomOakForest
Copy link
Collaborator

Thank you for posting this and adding the PR. The team will review it. Thanks.

@RandomOakForest RandomOakForest added the bug Something isn't working label May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants