-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When adding an event using randomize_joint_parameters to randomize actuator parameters at startup, the environment initialization fails with a shape mismatch RuntimeError when writing joint friction coefficients to simulation buffers.
Steps to reproduce
Minimal configuration:
@configclass
class CustomEventsCfg(EventCfg):
randomize_actuator_parameters = EventTerm(
func=mdp.randomize_joint_parameters,
mode="startup",
params={
"asset_cfg": SceneEntityCfg("robot"),
"friction_distribution_params": (0.9, 1.1),
"armature_distribution_params": (0.9, 1.1),
"operation": "scale",
"distribution": "uniform",
},
)The error occurs during environment creation:
RuntimeError: shape mismatch: value tensor of shape [4, 1, 12]
cannot be broadcast to indexing result of shape [4, 12]
This happens inside:
self.asset.write_joint_friction_coefficient_to_sim(
...
self._data.joint_friction_coeff[env_ids, joint_ids] = joint_friction_coeff
indicating a mismatch between the expected and produced joint parameter tensor shapes.
System Info
- Repo commit: https://github.com/isaac-sim/IsaacLab/releases/tag/v2.3.0
- Isaac Sim Version: 5.1.0
- OS: Ubuntu 24.04
- GPU: NVIDIA GeForce RTX 4060
- CUDA: 13.0
- Driver: 580.95.05
Additional context
The failure appears during event_manager.apply(mode="startup").
It seems the randomizer produces a tensor of shape [num_envs, 1, num_joints], but the writer expects shape [num_envs, num_joints]. Possibly missing a squeeze or incorrect broadcast inside randomize_joint_parameters.
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
- The
randomize_joint_parametersevent runs without errors at startup
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working