haosulab / ManiSkill

SAPIEN Manipulation Skill Framework, a GPU parallelized robotics simulator and benchmark
https://maniskill.ai/
Apache License 2.0
871 stars 156 forks source link

Mass for YCB models? #33

Closed saneeeee closed 1 year ago

saneeeee commented 1 year ago

Hello, I was wondering where mass for YCB models are stored, or are they ignored in simulation? Thank you!

Jiayuan-Gu commented 1 year ago

Hi, I specify the density for each YCB model in this file. The simulator will compute the mass on the fly given its collision mesh. You can acquire the mass by env.obj.mass for PickSingleYCB-v0. I roughly refer to the official document of YCB: https://people.eecs.berkeley.edu/~pabbeel/papers/2015-RAM-YCB-object-set.pdf. We are considering using the official mass for each object in a later release. Feel free to let us know if you have any suggestions.

saneeeee commented 1 year ago

Great, thank you! As a follow up, are there any benefits to or other specific reasons why storing density was preferred over mass?

May I also ask if the collision meshes for models were constructed by the Mani Skill team or acquired from somewhere else?

Thank you!

Jiayuan-Gu commented 1 year ago

The reason is that the simulator usually needs to set mass and inertia for rigid objects (SAPIEN requires to specify both when building actors). I have not found inertia from the official YCB dataset. Besides, in order to guarantee that objects can be grasped by the Panda gripper, we need to scale some objects. Thus, a reasonable density can be more flexible than mass.

We use CoACD, an alternative to VHACD, to generate collision meshes. Collision meshes for all YCB objects are available elsewhere (e.g., AI Habitat), but they are not fully tested to be feasible for grasp.

saneeeee commented 1 year ago

Sounds great, Nvidia IsaacGym has the option to calculate inertia directly from geometry. Which seems to work fine in my experience.

However, it weirdly distorts the collision meshes that I get from Mani Skill, and so almost always needs VHACD, which sometimes results in degenerate collision meshes. I believe that's a problem on IsaacGym's side, since it does that with vanilla YCB models too.

Thanks a lot for your input, best!

Jiayuan-Gu commented 1 year ago

Our collision meshes have already been processed to be convex. The possible issue I can come up with is that I use trimesh to export those models and they do not contain the "convex_x" label in the obj, which usually are generated by V-HACD. I am not sure how Isaac Gym deals with it. We would appreciate it if you coult let us know what happens when you figure it out.

saneeeee commented 1 year ago

Hello again,

I was able to find out why gym was causing trouble with MS2 assets. According to a response I got from a staff member on the Nvidia forums, IsaacGym doesn't check for convex meshes and defaults to hull unless the asset is convex decomposed inside gym on import (asset_options_obj.vhacd_enabled = True), strangely not mentioned in the docs.