How to access objects in the added usd file for robot manipulation

I am trying to do Pick and Place task with Franka for arbitrary objects. For that, I collected some objects in different environments and made a usd file out of them. The stage looks like this:

stage

Next, I tried to do Pick and Place task for the cube that was added to the scene in the python script and it was successful. But, when I tried to do the same thing with the objects in the added usd file, I found out that they are not recognized. I used “world.scene.object_exists” and “world.scene.get_object” functions.

Do you know how can I access these objects to be able to perform pick and place task on them?

Ok, I found the answer. The function that should be used is “scene.add”. However, to call this function you need to know the type of the object. In my case, the type is “XFormPrim”. Thus, the code for accessing the rubik is:

my_rubik = my_world.scene.add(XFormPrim(prim_path=“/World/rubik”, name=“fancy_rubik”))

Then, to check the code, you can use:

print("CHECK rubik: ", my_world.scene.object_exists(name=“fancy_rubik”))

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