kevinzakka / obj2mjcf

A CLI for processing composite Wavefront OBJ files for use in MuJoCo.
MIT License
164 stars 18 forks source link

mismatch between visual and collision #28

Open wangcongrobot opened 7 months ago

wangcongrobot commented 7 months ago

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

kevinzakka commented 7 months ago

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!

wangcongrobot commented 7 months ago

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.

wangcongrobot commented 7 months ago

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.

kevinzakka commented 7 months ago

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

wangcongrobot commented 7 months ago

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.

kevinzakka commented 7 months ago

@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?

wangcongrobot commented 7 months ago

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