Change tactile sensor normal component to report penetration depth.

The normal component of the tactile sensor now reports the maximum penetration depth at each taxel, instead of a derived normal force. The depth is negated so that positive values indicate penetration.

PiperOrigin-RevId: 921980899
Change-Id: Ide4103c0aff465e25a81cfdda650f6a0e2da9e0b
This commit is contained in:
Alessio Quaglino
2026-05-27 02:00:00 -07:00
committed by Copybara-Service
parent 583aa5ad4f
commit f6cd0234fd
5 changed files with 18 additions and 27 deletions
+2 -8
View File
@@ -172,14 +172,8 @@ static void* tactile_taxel_batch(void* args) {
mesh_normal[normal_stride*j + 2]};
mju_rotVecQuat(normal, normal, m->mesh_quat + 4 * mesh_id);
// get contact force
mjtNum force[3];
mjtNum kMaxDepth = 0.05;
mjtNum pressure = depth / mju_max(kMaxDepth - depth, mjMINVAL);
mju_scl3(force, normal, pressure);
// accumulate into forcesT (disjoint writes per taxel j)
t->forcesT[0*ncon + j] += mju_dot3(force, normal);
// take max penetration depth (SDF distance is negative; negate for positive output)
t->forcesT[0*ncon + j] = mju_max(t->forcesT[0*ncon + j], -depth);
if (has_frame) {
mjtNum tang1[3] = {mesh_normal[normal_stride*j + 3],