Skip to content

randomize_rigid_body_material failing #3159

@jiwonyou0420

Description

@jiwonyou0420

I'm trying to add some domain randomization event terms to lift_env_cfg.py.

@configclass
class EventCfg:
    """Configuration for events."""

    reset_all = EventTerm(func=mdp.reset_scene_to_default, mode="reset")

    reset_object_position = EventTerm(
        func=mdp.reset_root_state_uniform,
        mode="reset",
        params={
            "pose_range": {"x": (-0.1, 0.1), "y": (-0.25, 0.25), "z": (0.0, 0.0)},
            "velocity_range": {},
            "asset_cfg": SceneEntityCfg("object", body_names="Object"),
        },
    )

   #newly added term
    robot_physics_material = EventTerm(
        func=mdp.randomize_rigid_body_material,
        mode="reset",
        params={
            "asset_cfg": SceneEntityCfg("robot", body_names=".*"),
            "static_friction_range": (0.7, 1.3),
            "dynamic_friction_range": (1.0, 1.0),
            "restitution_range": (1.0, 1.0),
            "num_buckets": 250,
        },
    )

which gives

Exception has occurred: TypeError
randomize_rigid_body_material.__init__() got an unexpected keyword argument 'asset_cfg' 

It appears that all randomization functions in isaaclab.env.mdp.event work(such as reset_root_state_uniform), but some are defined as classes with init() and call(), which seems to be causing problem.

what is the proper way to add randomization classes(randomize_rigid_body_material, randomize_visual_texture_material, etc) to EventCfg?

setup: Isaac Sim 5.0 latest release, IsaacLab/feat/isaac_sim_5_0, ubuntu 22.04, driver 570, rtx 5080

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions