isaac-sim / IsaacGymEnvs

Isaac Gym Reinforcement Learning Environments
Other
1.94k stars 411 forks source link

Bug Fix in AMP Hybrid Init #198

Open Charrrrrlie opened 9 months ago

Charrrrrlie commented 9 months ago

In HumanoidAMP, when using Hybrid as stateInit type (this line), there is an error in the humanoid start pose.

⚠️It is caused by calling self.gym.set_actor_root_state_tensor_indexed and self.gym.set_dof_state_tensor_indexed functions both in _reset_default and _reset_ref_state_init. (It is weird when we call the two functions once after default and ref state init. e.g. in the implementation of this PR, also in the source implementation in ASE)

The difference is shown below (the first picture shows the wrong initialization and the second is the correct one, using this PR). It seems the default state will somehow "overwrite" the reference state.

error correction
Charrrrrlie commented 9 months ago

Further, I think that using the current implementation in this PR is also helpful in code reuse and reducing redundancy :).