obj2mjcf icon indicating copy to clipboard operation
obj2mjcf copied to clipboard

mismatch between visual and collision

Open robotlearning123 opened this issue 1 year ago • 7 comments
trafficstars

Hi, thank you for your nice tool! I tried the new version to generate a better obj model. It works well, but there is mismatch between visual obj and collision obj. The command is like this:

obj2mjcf --obj-dir . --save-mjcf --compile-model --verbose --decompose --overwrite --add-free-joint --coacd-args.pca

Is there any problems? Thank you for your help! image

robotlearning123 avatar Feb 20 '24 10:02 robotlearning123

Hi @wangcongrobot, can you attach the model so I can debug locally? I can't really tell what's going on in the picture you sent!

kevinzakka avatar Feb 20 '24 20:02 kevinzakka

t200-with-bracket_obj.zip Hi @kevinzakka, thank you for your reply. the attachments include the original obj model with mtl, commands, and generated model (with/no decompose). The decomposed model has a mismatch between the collision and visual model, but another is fine.

robotlearning123 avatar Feb 20 '24 23:02 robotlearning123

By the way, is there any way to generate separate .mtl files for each .obj file? Currently, the generated model only includes one .mtl file, which does not correspond to the .obj files. Thank you.

robotlearning123 avatar Feb 20 '24 23:02 robotlearning123

Hi @wangcongrobot, I ran the following command on my machine in the directory unzipped from the file you attached:

obj2mjcf --obj-dir . --save-mjcf --compile-model --decompose

I got what seems to be a correct looking decomposition, overlayed over the visual geoms.

ezgif com-animated-gif-maker

kevinzakka avatar Feb 21 '24 00:02 kevinzakka

Yes, I got the same results. It seems that the problem is caused by --coacd-args.pca. When adding this param, there is a mismatch as shown above.

robotlearning123 avatar Feb 21 '24 00:02 robotlearning123

@wangcongrobot Looks like a bug with PCA indeed, I'll try to push a fix soon. In the meantime, can you not use the PCA flag?

kevinzakka avatar Feb 21 '24 00:02 kevinzakka

Yes, the default config without PCA works well for me. Thank you! BTW, the save_mtl seems not available since v0.0.24?

robotlearning123 avatar Feb 21 '24 00:02 robotlearning123