owl-project / NVISII

Apache License 2.0
319 stars 27 forks source link

support primitive shapes while loading urdfs #155

Closed zcczhang closed 1 year ago

natevm commented 1 year ago

Just glancing at the code atm, why not use the built in NVISII box mesh rather than importing a box obj? I tend to prefer we use the built in primitives that come with NVISII rather than sourcing them from an external OBJ

zcczhang commented 1 year ago

The code I used below for NVISII box mesh will somewhat create the box with incorrect dimensions. Other primitives work fine but maybe I'm missing something in loading the NVISII box mesh?

nv_objects[object_name] = nv.entity.create(
    name=object_name,
    mesh=nv.mesh.create_box(
         name=object_name,
         size=nv.vec3(dimensions[0], dimensions[1], dimensions[2])
    ),
    transform=nv.transform.create(object_name),
    material=nv.material.create(object_name),
)

Edited: nvm, just found that the size in create_box is half size. Dividing dimensions by 2 works, and I'll push accordingly

nv_objects[object_name] = nv.entity.create(
    name=object_name,
    mesh=nv.mesh.create_box(
         name=object_name,
         size=nv.vec3(dimensions[0] / 2, dimensions[1] / 2, dimensions[2] / 2)
    ),
    transform=nv.transform.create(object_name),
    material=nv.material.create(object_name),
)
natevm commented 1 year ago

Ok, looking better.

Could you explain what the pybullet_data package does? I’m unfamiliar with that.

Otherwise looks good to me

zcczhang commented 1 year ago

sure, this is just for using to get the local path of the pybullet data (local folder same as here or here). In this way, it just doesn't need to download mesh files again once the pybullet has already been installed.

natevm commented 1 year ago

Thanks for contributing! 🙂