google-deepmind / mujoco

Multi-Joint dynamics with Contact. A general purpose physics simulator.
https://mujoco.org
Apache License 2.0
8.25k stars 823 forks source link

different performance between 3.1.3 and 3.2.4 #2191

Closed lucattyy closed 3 weeks ago

lucattyy commented 3 weeks ago

Intro

Hi!

I am a student and using MJX for my research on Robotics

My setup

I used MJX3.1.3 before, recently I have noticed that MJX3.2.4 offer method to obtain contact force. So I change the version.

What's happening? What did you expect?

The same set of code runs smoothly in version 3.1.3, but when running in version 3.2.4, the following error occurs.

/home/.conda/envs/jax/lib/python3.9/site-packages/mujoco/mjx/_src/mesh.py:177: UserWarning: Mesh "base" has a coplanar face with more than 20 vertices. This may lead to performance issues and inaccuracies in collision detection. Consider decimating the mesh.
  warnings.warn(
/home/.conda/envs/jax/lib/python3.9/site-packages/mujoco/mjx/_src/mesh.py:177: UserWarning: Mesh "foot" has a coplanar face with more than 20 vertices. This may lead to performance issues and inaccuracies in collision detection. Consider decimating the mesh.
  warnings.warn(
/home/.conda/envs/jax/lib/python3.9/site-packages/mujoco/mjx/_src/mesh.py:52: RuntimeWarning: invalid value encountered in divide
  face_norm = face_norm / np.linalg.norm(face_norm, axis=1).reshape((-1, 1))

I would like to know what changes in the two versions have caused the above issue, and how to solve this problem

lucattyy commented 3 weeks ago

Is there a method in mjx/mujoco help decimating the mesh?

yuvaltassa commented 3 weeks ago

https://mujoco.readthedocs.io/en/latest/XMLreference.html#asset-mesh-maxhullvert