The flex-SDF algorithm uses the same logic as mesh-SDF. Previous to this change, the flex was instead colliding with the convex hull of the mesh generated automatically with marching cubes from the SDF.
PiperOrigin-RevId: 876420302
Change-Id: I3bf6552b6b8e108ba4c4209bbcf10fe5f2b2fd90
Deleted MAXMESHPNT farthest point sampling instead of sorting by penetration distance is now used to select the best contact points, up to mjMAXCONPAIR. Deleted MAXSDFFACE, the BVH traversal now directly calls a function to process each leaf face against the SDF, instead of collecting face indices and processing them in a separate loop. This reduces memory by removing the need to store all intersecting face indices.
PiperOrigin-RevId: 876296914
Change-Id: I8068d634e2a01ffa9357d0c5381219d097e97abe
The documentation incorrectly claimed the position elements in relpose described body2 relative to body1 when it instead is meant to describe the position of the anchor relative to body1.
PiperOrigin-RevId: 875722437
Change-Id: Ib3b1fd9d14976623b08511068ea9e11746a28b02
This CL rolls back the change from changelist 794576123 since the previous version was more robust and stable. Compared to the original algorithm, this changes handles degenerate and very large triangles as well.
BEGIN_PUBLIC
Restore mesh-SDF collisions.
END_PUBIC
PiperOrigin-RevId: 875716983
Change-Id: If0de41dc7bbd60460779821d2338cf2d661f40d5
The editor panel allows you to add, remove, and modify spec elements
as well as recompiling and loading the spec.
Also includes utilities for handling vertically split panels.
PiperOrigin-RevId: 875658785
Change-Id: I18b10971d587db5eb1e65a033e1dc042faac7f1d
- Simplified constraint tree discovery with a unified iterator.
- Filling in a new `efc_tree` array to avoid calling tree discovery again in the constraint phase.
- Implemented dof skipping in the dense case for efficiency.
PiperOrigin-RevId: 875440387
Change-Id: Id44a5a6fe2a80edaaf30935506a023a307e21303
There are enough differences between how the two are structured that
having separate implementations makes things easier to implement
despite some minor code duplication.
PiperOrigin-RevId: 875287973
Change-Id: Id49e089e5e1944291ce79e79f8cb71d048a942cc
This change updates the Emscripten build to output files named `mujoco.js`, `mujoco.wasm`, and `mujoco.d.ts` instead of `mujoco_wasm.*`. The internal CMake target name remains `mujoco_wasm` to avoid conflicts. The package name in `package.json` is also updated to `mujoco`. New enum tests are added.
PiperOrigin-RevId: 875140314
Change-Id: Ie03e0d1db2d03dd8582d5bfcb260b3d33549c2c9
Rename stubs.cc to mjr_compat.cc. This library acts like a
"compatibility layer" that allows the filament renderer to
be implemented behind the mjr API.
PiperOrigin-RevId: 875114054
Change-Id: I5c47581cacbcadff4c78d2ad15728cc1c3a394ad
The `mjCOctree::ComputeSdfCoeffs` function has been replaced by `mjCOctree::ComputeSdf`. The new implementation removes the dependency on the `triangle_mesh_distance` library. Instead, it uses a provided `mjCBoundingVolumeHierarchy` to perform closest point queries on the mesh. The signed distance is computed by finding the closest triangle face via the BVH and determining the sign based on the dot product of the vector from the closest point on the triangle to the octree vertex and the triangle's normal.
Optional Laplacian smoothing has been added to the SDF coefficients. This helps smooth out potential discontinuities at octree level boundaries.
PiperOrigin-RevId: 875093374
Change-Id: I6fa53243a2dda107ccf255bc6b876ca5a4554d4f
This change introduces methods to cache and load the computed stiffness matrix and nodal masses for flex elements. The cache key is generated based on material properties (Young's modulus, Poisson's ratio), interpolation order, and the bounding box of the flex. This avoids redundant expensive computations when compiling models with identical flex definitions.
PiperOrigin-RevId: 874689771
Change-Id: I6d1e299baf294a984b507e2a2602b2c068610536
Display all other elements under "Elements" or "Assets" group.
Show properties for mjSpec, mjModel, and mjData for selected
elements.
PiperOrigin-RevId: 874614195
Change-Id: I128c2bec844983ac5d35a3a0b1e58b8a5b0109cb
The logic for computing Signed Distance Function (SDF) coefficients using TriangleMeshDistance is moved from `mjCPlugin::Make` in `user_mesh.cc` to a new method `mjCOctree::ComputeSdfCoeffs` in `user_objects.cc`. This encapsulates the SDF computation within the octree class.
PiperOrigin-RevId: 874572414
Change-Id: Ia2365c9c4527a252ff1d1bb43fe2c2593761e471
MujocoTest now loads plugins from MUJOCO_PLUGIN_DIR if set.
PluginTest is removed; all tests use MujocoTest directly.
testspeed binary loads plugins from MUJOCO_PLUGIN_DIR.
This is in preparation for moving common asset format parsing (obj, msh, stl, etc.) where we will always want to load those plugins.
PiperOrigin-RevId: 874194428
Change-Id: Id90805a9ba5de4627911b56d8b9c4ab4e1b29310