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
+36
View File
@@ -7539,6 +7539,42 @@ Extraction
:at:`name`, :at:`noise`, :at:`user`:
See :ref:`CSensor`.
.. _sensor-tactile:
:el-prefix:`sensor/` |-| **tactile** (*)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. image:: images/XMLreference/tactile.png
:align: right
:width: 30%
:target: https://github.com/google-deepmind/mujoco/blob/main/model/tactile/tactile.xml
The tactile sensor returns the penetration pressure and the sliding velocities in the tangent frame at given points
between the geom associated with the sensor and the SDF geoms in contact with it. We define the penetration pressure as
a function of the penetration depth :math:`p(d) = \frac{d}{d_{max}-d}`, which is zero at the surface and goes to
infinity as the maximum depth is reached. The sensor is associated with a geom and a mesh. It is activated by the
contact between its associated geom and other geoms. The vertices of the mesh, when positioned in the geom frame, are
the points at which sensor values are computed, so the dimension of the output is 3 times the number of vertices in the
mesh. The mesh must have 3 normal vectors per vertex, which are used to compute the tangent frame. If the penetration
depth is positive (no contact), then all values are 0 for the corresponding vertex. Only contacts with geoms of type SDF
contribute to the sensor output. The sensor can be visualized by enabling the visualization of contact points.
.. _sensor-tactile-geom:
:at:`geom`: :at-val:`string, required`
Name of the geom to associate the tactile sensor with.
.. _sensor-tactile-mesh:
:at:`mesh`: :at-val:`string, required`
Name of the mesh to associate the tactile sensor with. The mesh will be created by the sensor.
.. _sensor-tactile-name:
.. _sensor-tactile-user:
:at:`name`, :at:`user`:
See :ref:`CSensor`.
.. _sensor-e_potential:
:el-prefix:`sensor/` |-| **e_potential** (*)
+7
View File
@@ -1284,6 +1284,13 @@
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
+------------------------------------+----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |_| sensor |br| |_| |L| | | .. table:: |
| :ref:`tactile | \* | :class: mjcf-attributes |
| <sensor-tactile>` | | |
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
| | | | :ref:`name<sensor-tactile-name>` | :ref:`geom<sensor-tactile-geom>` | :ref:`mesh<sensor-tactile-mesh>` | :ref:`user<sensor-tactile-user>` | |
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
+------------------------------------+----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |_| sensor |br| |_| |L| | | .. table:: |
| :ref:`plugin | \* | :class: mjcf-attributes |
| <sensor-plugin>` | | |
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
+2
View File
@@ -12,6 +12,8 @@ General
- Added the :ref:`contact<sensor-contact>` sensor, for reporting contact information according to user-defined criteria.
The purpose of the :el:`contact` sensor is to report contact-related information in a fixed-size array. This is useful
as input to learning-based agents and in environment logic.
- Added the :ref:`tactile<sensor-tactile>` sensor, for measuring the penetration depth between two objects at given
points and the sliding velocities in the tangent frame. The sensor reports tactile data only when colliding with SDFs.
- Removed the SdfLib plugin and the dependency on `SdfLib <https://github.com/UPC-ViRVIG/SdfLib>`__. SDFs are now
supported natively in mjModel.
- Removed ``oct_depth`` from :ref:`mjvOption` (unused).
Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

+3
View File
@@ -739,6 +739,9 @@ typedef enum mjtSensor_ { // type of sensor
mjSENS_E_KINETIC, // kinetic energy
mjSENS_CLOCK, // simulation time
// sensors related to SDFs
mjSENS_TACTILE, // tactile sensor
// plugin-controlled sensors
mjSENS_PLUGIN, // plugin-controlled