Writing additional semantic data

Hi,
I am trying to figure out how to write additional semantic information for a prim when I render my scene. Right now I have the bounding boxes (as expected) and class, but I would also store a rotation value somehow. This is how rotation is for my prim:

def uniform_random_rotation(prim, min_x = 0, min_y = 0, min_z = 0, max_x = 0, max_y = 0, max_z = 0):
with prim:
rotation = rep.distribution.uniform((min_x, min_y, min_z), (max_x, max_y, max_z))
rep.modify.pose(rotation = rotation)
rep.modify.semantics([(“rotation”, rotation)])

Later on I write with this writer:

writer = rep.WriterRegistry.get(“BasicWriter”)
now=now.strftime(“%Y-%m-%d_%H:%M:%S”)
output_dir = “/home/ifodor/Downloads/data/gauge_data_”+now
writer.initialize( output_dir=output_dir, rgb=True, bounding_box_2d_tight=True, semantic_types=[“class”, “rotation”])
writer.attach([render_product])

Is there a way to store the rotation data somehow or I need to write a custom writer?

Thank you

What I am trying to do here is to store additional ground truth besides the bounding boxes. Every step I randomize the rotation of a prim and I would like to keep track of the rotation values.

OK, I figured this out by myself, but posting the solution in case somebody runs into the same issue as I did.

I coulnd’t find a way to track generated random values inside Replicator so the key for me was to drop rep.orchestrator.run() and rely on manual steps - await rep.orchestrator.step_async(rt_subframes=20). This way between each step I could go to the USD directly and query it’s rotation.
I wrote up my findings in more detail on Medium.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.