Clear mjData.actuator_moment more selectively.

PiperOrigin-RevId: 566324919
Change-Id: Ie453f8de059d39fa1ebd5248f33a18758ee748af
This commit is contained in:
Yuval Tassa
2023-09-18 09:26:15 -07:00
committed by Copybara-Service
parent 6ca8a7bdf7
commit 812e617fe9
2 changed files with 14 additions and 6 deletions
+3
View File
@@ -1487,6 +1487,9 @@ static void _resetData(const mjModel* m, mjData* d, unsigned char debug_value) {
mju_zero(d->mocap_pos, 3*m->nmocap);
mju_zero(d->mocap_quat, 4*m->nmocap);
// zero out actuator_moment, mj_transmission touches it selectively
mju_zero(d->actuator_moment, m->nv*m->nu);
// copy qpos0 from model
if (m->qpos0) {
memcpy(d->qpos, m->qpos0, m->nq*sizeof(mjtNum));