Replicator - How to change skeleton joint rotation

Ive been battling with Replicator and skeleton joints all day. At first, I had combined trying to rotate a skeleton joint with a script that also randomized the camera position and lighting scenario. On its own, the camera and lighting script worked. When I added the joint change and tested by stepping with Replicator, Replicator would show the desired change for one step then take a while and crash.

I broke out the skeleton change to a separate script and it seemed to be fine. Then I started noticing the position of the joint was being reset back to (0,0,0) when modify.pose(rotation = (myvector)) was called. As I tried to troubleshoot that, the script completely stopped working and now wont update the joint rotation at all.

Any ideas on why this code may not be working? I have also set up a cube in the same script to check behavior. The cube in this script will rotate as requested but the joint still remains in place. Also, the cube position is not reset like the joint was when it was working. I feel like Im seeing very different results with this through the day but cant figure out what may have changed to cause these issues.

import omni.replicator.core as rep

def RandomizeArm():
	arm = rep.get.prim_at_path("/{LOCATION OF MY JOINT WAY DOWN IN THE SCENE GRAPH}")
	with arm:
		rep.modify.pose(rotation = rep.distribution.uniform((0,0,0), (180, 180, 180)))

	return arm.node

rep.randomizer.register(RandomizeArm)

def RandomizeCube():
	cube = rep.get.prim_at_path("/Cube")
	with cube:
		rep.modify.pose(rotation = rep.distribution.uniform((0,0,0), (180, 180, 180)))

	return cube.node

rep.randomizer.register(RandomizeCube)

with rep.trigger.on_frame():
    rep.randomizer.RandomizeArm()
    rep.randomizer.RandomizeCube()

Hi there,

the script seems to be fine. Can you provide us the way you are starting the randomizations?

Best,
Andrei

Hi Andrei -

In the top ribbon, Replicator > Preview or Step.

I ended up taking the content back out to Maya and animating it to do what I wanted then bringing it back in and running Replicator just on lighting and camera position while running the Sythetic Data export.

In that workflow, I found I wasnt able to export the skeleton data. It seemed to be this same issue: Can't retrieve skeleton data with synthetic data recorder
In the version data for Replicator, it lists newer versions than the ones listed as up to date when trying to get the latest version from Applications. Is that bug fixed? Will that be released soon?

In case of the skeleton data error, the bug is fixed and will be released with Isaac Sim 2023.1.0. In the meantime you can try USD Composer (formerly Create) which already has a newer version of Replicator and includes the bugfix.

hi @ahaidu, is it possible to run replicator code directly from the script editor in USD Composer? I’m currently getting an import error when trying to import omni.replicator.core in Composer’s Script Editor.

Yes, if it does not work out of the box you will probably need to enable the extension first: Window -> Extensions

1 Like