Move tactile sensor to the engine.

PiperOrigin-RevId: 788863133
Change-Id: I3172ebb7641fa8146469da25cba7db794760e7b1
This commit is contained in:
Alessio Quaglino
2025-07-30 05:26:39 -07:00
committed by Copybara-Service
parent 89f4789085
commit 51babec9c5
28 changed files with 418 additions and 687 deletions
+3 -2
View File
@@ -390,8 +390,9 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjSENS_E_POTENTIAL', 43),
('mjSENS_E_KINETIC', 44),
('mjSENS_CLOCK', 45),
('mjSENS_PLUGIN', 46),
('mjSENS_USER', 47),
('mjSENS_TACTILE', 46),
('mjSENS_PLUGIN', 47),
('mjSENS_USER', 48),
]),
)),
('mjtStage',
+3
View File
@@ -1011,6 +1011,9 @@ PYBIND11_MODULE(_specs, m) {
if (mjs_makeMesh(self, mjMESH_BUILTIN_WEDGE, params, 5)) {
throw pybind11::value_error(mjs_getError(mjs_getSpec(self->element)));
}
self->scale[0] = radius;
self->scale[1] = radius;
self->scale[2] = radius;
},
py::arg("resolution") = std::array<int, 2>{0, 0}, py::arg("radius"),
py::arg("fov") = std::array<double, 2>{0, 0}, py::arg("gamma") = 0);
+2 -1
View File
@@ -487,10 +487,11 @@ class SpecsTest(absltest.TestCase):
def test_make_mesh(self):
spec = mujoco.MjSpec()
mesh = spec.add_mesh(name='wedge')
mesh.make_wedge(resolution=[25, 25], radius=1, fov=[90, 45], gamma=0)
mesh.make_wedge(resolution=[25, 25], radius=.1, fov=[90, 45], gamma=0)
model = spec.compile()
self.assertEqual(model.nmesh, 1)
self.assertEqual(model.nmeshvert, 25 * 25)
np.testing.assert_array_equal(model.mesh_scale[0], [0.1, 0.1, 0.1])
def test_compile_errors_with_line_info(self):
spec = mujoco.MjSpec()