isaac-sim / OmniIsaacGymEnvs

Reinforcement Learning Environments for Omniverse Isaac Gym
Other
849 stars 218 forks source link

change solver_velocity_iteration_count (and position) during simulation #44

Open arminvburren opened 1 year ago

arminvburren commented 1 year ago

Hello,

Is there a way to randomize these parameters DURING SIMULATION ? I have tried to put this code in the pre_physics step but there is no effect on the simulation (even tho the prameter of the simulation is well setted, i have checked with the getter). Is this some jit magic ? is there a way around it ?

        cfg = self._sim_config.parse_actor_config("myprim")
        cfg["solver_position_iteration_count"] = 4 # my new values
        cfg["solver_velocity_iteration_count"] = 1 # my new values
        self._sim_config.apply_articulation_settings("myprim", get_prim_at_path(self.aru.prim_path), cfg)

Regards,

kellyguo11 commented 1 year ago

Hi there, setting these parameters should be possible at run time, you can also use the USDPhysics APIs directly to set these values so that you don't have to update the full set of config parameters. It may be possible that the change in simulation behaviour is not obvious since this will change the iteration counts in the physics engine under the hood.

arminvburren commented 1 year ago

Hello,

I'm pretty sure it's not working.. basically with some parameters the simulation is 100% crashing (I have a robot with a lot of DOF and solver has some problems) and with higher parameters it works. when I use the command to change it during the simualtion (such as in pre_physics_step) it just doesn't change at all the behaviour.

It's particulartly important because I have a problem where the strategy found by the RL is one that exploits a solver bug in the physics resolution, so at least randomizing solver iterations would mitigate this. Would you have an example of code where the USDPhysicsAPI is being used ? tbh i'm a little confused by the omni documentation overall :(

Regards


De : Kelly Guo @.> Envoyé : jeudi 11 mai 2023 00:46 À : NVIDIA-Omniverse/OmniIsaacGymEnvs @.> Cc : arminvburren @.>; Author @.> Objet : Re: [NVIDIA-Omniverse/OmniIsaacGymEnvs] change solver_velocity_iteration_count (and position) during simulation (Issue #44)

Hi there, setting these parameters should be possible at run time, you can also use the USDPhysics APIs directly to set these values so that you don't have to update the full set of config parameters. It may be possible that the change in simulation behaviour is not obvious since this will change the iteration counts in the physics engine under the hood.

— Reply to this email directly, view it on GitHubhttps://github.com/NVIDIA-Omniverse/OmniIsaacGymEnvs/issues/44#issuecomment-1542901736, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AY77F366L4W7AEVGW3KF4E3XFQLFPANCNFSM6AAAAAAXV6T7CA. You are receiving this because you authored the thread.Message ID: @.***>