Use sparse (uncompressed) actuator_moment in mj_transmission.
PiperOrigin-RevId: 692179704 Change-Id: Ic30ac5a98dc13de2028e378df65dc88ba3912bf5
This commit is contained in:
committed by
Copybara-Service
parent
1d58576d28
commit
a51f346059
+9
-1
@@ -491,7 +491,15 @@
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"ctrl0 = np.atleast_2d(qfrc0) @ np.linalg.pinv(data.actuator_moment)\n",
|
||||
"actuator_moment = np.zeros((model.nu, model.nv))\n",
|
||||
"mujoco.mju_sparse2dense(\n",
|
||||
" actuator_moment,\n",
|
||||
" data.actuator_moment,\n",
|
||||
" data.moment_rownnz,\n",
|
||||
" data.moment_rowadr,\n",
|
||||
" data.moment_colind,\n",
|
||||
")\n",
|
||||
"ctrl0 = np.atleast_2d(qfrc0) @ np.linalg.pinv(actuator_moment)\n",
|
||||
"ctrl0 = ctrl0.flatten() # Save the ctrl setpoint.\n",
|
||||
"print('control setpoint:', ctrl0)"
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user