Store joint damping and stiffness in the private spec when springdamper is used in the public spec.

PiperOrigin-RevId: 724288204
Change-Id: I7341d5d804e1ea73ded48b8b447addd4e124ab97
This commit is contained in:
Alessio Quaglino
2025-02-07 03:54:35 -08:00
committed by Copybara-Service
parent c27d3758c2
commit c1ecc50081
2 changed files with 27 additions and 0 deletions
+4
View File
@@ -1867,6 +1867,10 @@ void mjCModel::AutoSpringDamper(mjModel* m) {
mjtNum stiffness = inertia / std::max(mjMINVAL, timeconst*timeconst*dampratio*dampratio);
mjtNum damping = 2 * inertia / std::max(mjMINVAL, timeconst);
// save stiffness and damping in the private mjsJoints
joints_[n]->stiffness = stiffness;
joints_[n]->damping = damping;
// assign
m->jnt_stiffness[n] = stiffness;
for (int i=0; i<ndim; i++) {