Reduce flex stiffness and bending memory size to the exact amount needed.

PiperOrigin-RevId: 911774147
Change-Id: I3b18eba23e75ec91ece8342945f25e0cd7c63a1a
This commit is contained in:
Alessio Quaglino
2026-05-06 23:52:46 -07:00
committed by Copybara-Service
parent b6aac76cc4
commit 0c05215e18
5 changed files with 70 additions and 81 deletions
+5 -1
View File
@@ -951,7 +951,11 @@ static void mjd_flexInterp_kernel(const mjModel* m, mjData* d, mjtFlexOp op,
}
// get stiffness and damping
mjtNum* K = m->flex_stiffness + m->flex_stiffnessadr[f];
int stiffnessadr = m->flex_stiffnessadr[f];
if (stiffnessadr < 0) {
continue;
}
mjtNum* K = m->flex_stiffness + stiffnessadr;
// skip if rigid or no stiffness
if (m->flex_rigid[f] || K[0] == 0) {