I am completely new to Isaac, Omniverse, and in general 3D things, so my questions may have been answered before but I could not find the right answers. For context, I’m a gazebo user and I am curious as to how Isaac performs in large scene with many objects, and fast moving robots.
To do that in gazebo it’s fairly straight forward, you define a big text file in which you say where is what and its scale. My issue is how do I do that in Isaac. I understand Isaac is using USD files to define what the scene will look like, and that all the assets should be defined as USD files. But how do I make that scene ?
I mean in my case the scene is procedurally generated by some python code. Hence, I’d rather avoid building the scene manually and I was looking for ways to make it using code. So far I have found the code snippets provided in the doc but there is something that I can’t find. From the doc I know how to add a cube, a sphere, how to apply randomization, but I don’t know how to import an asset. And I guess I would if I could find the list of commands. By that I mean that all the time the tutorial call something like:
I’ll answer part of my question:
Here is how you can add an asset using python:
def create_object(prefix, stage, path, location=Gf.Vec3d(0, 0, 0), rotation=Gf.Quaternion(1, Gf.Vec3d(0,0,0)), group=[]):
"""
Creates a 3D object from a USD file and adds it into the scene with a given rotation and location
Inputs:
prefix: The name of the object in the world (does not have to be unique).
stage: The name of the world the objects belong to.
path: The path of to the USD file on the docker/drive.
location: The position of the object relatively to the stage.
rotation: The rotation of the object relatively to the stage.
group: The group of primitives this object belongs to.
Outputs:
group: The group of primitives this object belongs to.
"""
prim_path = omni.usd.get_stage_next_free_path(stage, prefix, False)
group.append(prim_path)
tile_prim = stage.DefinePrim(prim_path, "Xform")
tile_prim.GetReferences().AddReference(path)
xform = UsdGeom.Xformable(tile_prim)
xform_op = xform.AddXformOp(UsdGeom.XformOp.TypeTransform, UsdGeom.XformOp.PrecisionDouble, "")
mat = Gf.Matrix4d().SetTranslate(location)
mat.SetRotateOnly(Gf.Rotation(rotation))
xform_op.Set(mat)
return group