Skip to content

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

Closed
@asuzukii

Description

@asuzukii

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions