From 4d2bf636eabfc8453a9105c79740a3caec35ae77 Mon Sep 17 00:00:00 2001 From: Kevin Zakka Date: Mon, 1 May 2023 08:01:02 -0700 Subject: [PATCH] Improve `touch_grid` sensor documentation. PiperOrigin-RevId: 528473107 Change-Id: I2fecc10667b1b94a4b2b32653685f0a6d9da4ba9 --- plugin/sensor/README.md | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/plugin/sensor/README.md b/plugin/sensor/README.md index 1e07a455..1d79acf0 100644 --- a/plugin/sensor/README.md +++ b/plugin/sensor/README.md @@ -1,13 +1,19 @@ # Sensor Plugins -Custom sensors implemented as [engine plugins](https://mujoco.readthedocs.io/en/latest/programming/extension.html#engine-plugins). +Custom sensors implemented as [engine +plugins](https://mujoco.readthedocs.io/en/latest/programming/extension.html#engine-plugins). -## Touch Grid +- [Touch Grid](#touch-grid) + - [Example model](#example-model) + - [Illustration of fields-of-view in spherical coordinates](#illustration-of-fields-of-view-in-spherical-coordinates) + - [Illustration of foveal deformation](#illustration-of-foveal-deformation) + - [Illustration combining resolution, fields-of-view and foveal deformation](#illustration-combining-resolution-fields-of-view-and-foveal-deformation) + +## [Touch Grid](touch_grid.h) This sensor aggregates contact forces into "taxels": a rectangular array of pixel-like elements. - -A `touch grid` sensor is associated with a site and senses contact forces and +A `touch_grid` sensor is associated with a site and senses contact forces and torques between the site's parent body and all other bodies. The site's frame determines the orientation of the sensor with the same convention used for cameras and lights: the sensor points in the frame's **negative-z** direction, @@ -16,7 +22,7 @@ so the x and y axes correspond to horizontal and vertical, respectively. The output of the sensor is a stack of 1 to 6 "touch images" corresponding to forces and torques in the frame of the sensor. Forces and torques are in the in [z, x, y] order, corresponding to the ordering in contact frames: [normal, tangent, -tangent] and [torsional, rolling, rolling]. Each "taxel" codderponds to an angular bin +tangent] and [torsional, rolling, rolling]. Each "taxel" corresponds to an angular bin in spherical coordinates, and aggregates all the forces occuring inside this bin, which occur between the body in which the sensor's site is defined and any other body. @@ -53,22 +59,30 @@ deformation parameters. These parameters are passed as plugin config attributes: Note the following: -- The dimensionality of the sensor output is `nchannel * size_x *size_y`. -- `objtype="site" objname="touch"` specify that the sensor is associated with - a site, and the name of the specific site. -- Field-of-view angles are always in degrees, disregarding the `` - "angle" directive. +- The dimensionality of the sensor output is `nchannel * size_x *size_y`. +- `objtype="site" objname="touch"` specify that the sensor is associated with a + site, and the name of the specific site. +- Field-of-view angles are always in degrees, disregarding the `` + "angle" directive. -### Illustration of fields-of-view in spherical coordinates: +### Example model + + + Watch the video + + +See [touch_grid.xml](../../model/plugin/touch_grid.xml) to play with the model above. + +### Illustration of fields-of-view in spherical coordinates -### Illustration of foveal deformation: +### Illustration of foveal deformation ![foveal deformation](images/fovea.png) -### Illustration combining resolution, fields-of-view and foveal deformation: +### Illustration combining resolution, fields-of-view and foveal deformation [![touch grid illustration](https://img.youtube.com/vi/YScjmR8LwQI/0.jpg)](https://www.youtube.com/watch?v=YScjmR8LwQI)