Fix bug in slider-crank transmission.

The associated row in `actuator_moment` was not cleared before being updated.

PiperOrigin-RevId: 688207085
Change-Id: I2f925e984c5c493e64ead66667aef57c4844acfe
This commit is contained in:
Yuval Tassa
2024-10-21 11:20:26 -07:00
committed by Copybara-Service
parent a70aea918c
commit aa91f3c047
2 changed files with 7 additions and 1 deletions
+4 -1
View File
@@ -7,10 +7,13 @@ Upcoming version (not yet released)
MJX
^^^
- Added ``apply_ft``, ``jac``, and ``xfrc_accumulate`` as public functions.
- Added ``TOUCH`` sensor.
Bug fixes
^^^^^^^^^
- Fixed a bug in slider-crank ref:`transmission<geTransmission>`. The bug was introduced in 3.0.0.
Version 3.2.4 (Oct 15, 2024)
----------------------------
+3
View File
@@ -1000,6 +1000,9 @@ void mj_transmission(const mjModel* m, mjData* d) {
mj_jacSite(m, d, jac, 0, id);
mju_subFrom(jac, jacS, 3*nv);
// clear moment
mju_zero(moment+i*nv, nv);
// apply chain rule
for (int j=0; j < nv; j++) {
for (int k=0; k < 3; k++) {