How can I edit the USD file for each episode or iteration at RL environment?


When learning in the Isaac Sim RL environment, I want to edit the USD file every iteration.

I want the end-effector parts of the robot agents to be replaced with random shapes at every iteration(or episode) and every cloned agent.
If I have the set of tools (stl, obj, etc), how can I implement this?

I tried to implement it through a separate primitive shape via the def set_up_scene(self, scene) -> None: part at the environment code, but it failed to apply as a link attached to the robot.

Hi there, when adding separate primitive shapes to the robot, you’ll also need to apply a RigidBodyAPI schema to it, as well as attach it to another body in the robot using a physics joint. These should be possible to achieve through the USDPhysics APIs - Universal Scene Description: UsdPhysics : USD Physics Schema.

Note that we currently have a limitation with cloned environments, where modifications made in the source environment will also carry over to its clones, so you may need to avoid the source environment when making modifications.

1 Like

so you may need to avoid the source environment when making modifications.

I am sorry but, could you explain more about the above mention? I didn’t quite understand.

(I think it’s because I don’t have a clear idea of how to get different end-effectors for different environments.)

You could try first cloning the environments, then after cloning, modify the end effectors for each of the environments (except for the first one). Any changes made to the first environment will also appear in the cloned environments, which is likely not what you would want, and is something we will address in the next release.

To link the primitive shape to the robot, you would need to add a physics joint that attaches the new shape with the parent body of the robot.

1 Like

Thanks, @kellyg

Would you mind sharing some references or example links to add a physics joint and links at the end-effector? It is ok that all the robots in each environment are attached with the same links.

I cannot get a detailed implementation idea.