Skip to content

Commit cef02fa

Browse files
quaglacopybara-github
authored andcommitted
Remove sdflib plugin and move interpolation to engine_collision_sdf.
Before: ``` Simulation time : 1.71 s Steps per second : 5854 Realtime factor : 11.71 x Time per step : 170.8 µs Newton iters / step : 2.19 Contacts / step : 3.45 Constraints / step : 13.79 Degrees of freedom : 12 Dynamic memory usage : 0.2% of 14M ``` After: ``` Simulation time : 1.41 s Steps per second : 7093 Realtime factor : 14.19 x Time per step : 141.0 µs Newton iters / step : 2.19 Contacts / step : 3.45 Constraints / step : 13.79 Degrees of freedom : 12 Dynamic memory usage : 0.2% of 14M ``` PiperOrigin-RevId: 781087896 Change-Id: Iaf69dccc5e95af5bac862344683c74f962162186
1 parent 96118da commit cef02fa

File tree

9 files changed

+189
-374
lines changed

9 files changed

+189
-374
lines changed

model/plugin/sdf/cow.xml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,12 @@
88
<config key="radius2" value="0.05"/>
99
</instance>
1010
</plugin>
11-
<plugin plugin="mujoco.sdf.sdflib">
12-
<instance name="sdf">
13-
<config key="aabb" value="0"/>
14-
</instance>
15-
</plugin>
1611
</extension>
1712

1813
<asset>
1914
<texture name="texspot" type="2d" file="spot.png"/>
2015
<material name="matspot" texture="texspot"/>
21-
<mesh name="spot" file="asset/spot.obj">
22-
<plugin instance="sdf"/>
23-
</mesh>
16+
<mesh name="spot" file="asset/spot.obj"/>
2417
<mesh name="torus">
2518
<plugin instance="torus"/>
2619
</mesh>
@@ -48,15 +41,11 @@
4841
</geom>
4942
</body>
5043
<body euler="90 0 0" pos="0 0 .7">
51-
<geom type="sdf" name="cow1" mesh="spot" material="matspot">
52-
<plugin instance="sdf"/>
53-
</geom>
44+
<geom type="sdf" name="cow1" mesh="spot" material="matspot"/>
5445
</body>
5546
<body pos="0.05 .25 2.2">
5647
<freejoint/>
57-
<geom type="sdf" name="cow2" mesh="spot" material="matspot">
58-
<plugin instance="sdf"/>
59-
</geom>
48+
<geom type="sdf" name="cow2" mesh="spot" material="matspot"/>
6049
</body>
6150
<light name="left" pos="0 0 1"/>
6251
<light name="right" pos="1 0 1"/>

plugin/sdf/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ set(MUJOCO_SDF_SRCS
2828
register.cc
2929
nut.cc
3030
nut.h
31-
sdflib.cc
32-
sdflib.h
3331
torus.cc
3432
torus.h
3533
)

plugin/sdf/README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,6 @@ Parameters:
6262
- `radius1` [m]: major radius (default `0.35`).
6363
- `radius1` [m]: minor radius (default `0.15`).
6464

65-
### SdfLib
66-
67-
Implemented in [sdflib.cc](sdflib.cc). Example usage in [cow.xml](../../model/plugin/sdf/cow.xml).
68-
69-
This plugin uses the library [TriangleMeshDistance](https://github.com/InteractiveComputerGraphics/TriangleMeshDistance)
70-
to compute a voxel-based approximation of a user-specified mesh. The mesh can be arbitrary and not necessarily convex.
71-
This offers an alternative to convex-decomposed meshes. The performance is likely to be slower than that of analytic
72-
SDFs, since a cubic approximation has to be evaluated on the convex grid. However, the SDF generation is done
73-
automatically, simplifying the task of creating an SDF, which can be difficult for complex shapes.
74-
7565
### How to make your own SDF
7666

7767
Create your `MySDF.h` and `MySDF.cc` files in the SDF folder, where this README is located. Implement your SDF using the

plugin/sdf/register.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "gear.h"
1818
#include "nut.h"
1919
#include "torus.h"
20-
#include "sdflib.h"
2120

2221
namespace mujoco::plugin::sdf {
2322

@@ -27,7 +26,6 @@ mjPLUGIN_LIB_INIT {
2726
Gear::RegisterPlugin();
2827
Nut::RegisterPlugin();
2928
Torus::RegisterPlugin();
30-
SdfLib::RegisterPlugin();
3129
}
3230

3331
} // namespace mujoco::plugin::sdf

plugin/sdf/sdflib.cc

Lines changed: 0 additions & 279 deletions
This file was deleted.

0 commit comments

Comments
 (0)