Applying external forces at specific times during RL training #280
-
Hi all! I have an environment where I want to apply external forces to some links of a legged robot at certain times while the simulation is running for training. For example, if a foot gets in contact with some objects, i want to apply a force towards that object (think of it as a magnetic force for instance). I managed to do this within the OmniIsaacGymEnvs framework using the 'pre_physics_step()' method and the omni.isaac.core.RigidPrimView.apply_forces() method. However, I want to migrate my environment to the ORBIT framework since it allows more customization, but I can't figure out where should I add the piece of code that handles this. One idea is to create an observation term that reads from the contact sensors in the feet, and then applies this logic, but doesn't seem the best way to manage this. Thanks in advance for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
You can make a randomization term (the name isn't ideal but should do the job). We have a basic implementation for applying external forces. Using the randomization manager you can set different "modes" that decides when this term is applied:
In your case, you can use fixed intervals and set the interval range to match your environment time-step, s.t. it applies that term in every environment step. If you want to apply the term at every "simulation" step, then you'll need to customize things a bit inside the RLTaskEnv.step method to add another mode for the randomization manager to trigger every physics step (similar to how internval mode is handled). |
Beta Was this translation helpful? Give feedback.
You can make a randomization term (the name isn't ideal but should do the job). We have a basic implementation for applying external forces. Using the randomization manager you can set different "modes" that decides when this term is applied:
In your case, you can use fixed intervals and set the interval range to match your e…