isaac-sim / IsaacLab

Unified framework for robot learning built on NVIDIA Isaac Sim
https://isaac-sim.github.io/IsaacLab
Other
2.34k stars 969 forks source link

[Bug Report] Randomization: startup #664

Closed ori-gadot closed 4 months ago

ori-gadot commented 4 months ago

Bug Description: Randomizing any physical attribute using mode="startup" is not executed.

Steps to Reproduce: Run the script: python source/standalone/tutorials/03_envs/create_cartpole_base_env.py. The add_pole_mass startup event is not triggered. The code does not reach mdp.randomize_rigid_body_mass function during debugging.

Further Investigation: Changing other events to "startup" also results in them not being executed. Additionally, querying the observations confirms that the randomization did not occur.

Mayankm96 commented 4 months ago

Good catch!

It seems the startup randomization only happens properly inside the RLEnv implementation: https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab/omni/isaac/lab/envs/manager_based_rl_env.py#L124-L126

I have made an MR with a potential fix.