Hello, I'm new to MuJoCo and I'm trying to test a simple two-link arm hitting a sphere in a zero gravity environment. I am recording the positions, velocities, and accelerations of the bodies after each simulation step so that I can plot this data.
The floating objects section of the documentation shows how to get the joint addresses for qpos and qvel. Is the address returned by MjModel.jnt_dofadr a valid address for accessing the joint's acceleration via MjData.qacc, or can this address only be used to access MjData.qvel? My intuition tells me that jnt_dofadr should work for both qvel and qacc (i.e., the dimensionality of the velocity and acceleration should be the same), but the documentation and code comments for jnt_dofadr indicate that this should only be used for qvel. Also, the fact that this field is called jnt_dofadr instead of something like jnt_qveladr makes me think that it's applicable to both qvel and qacc.
Here's the model I'm using:
simple_arm_zero_gravity.xml
```XML
```
Additional details:
OS: Ubuntu 22.04
Python version: 3.10.12
MuJoCo version: 3.1.3 (installed in a venv with the Python version listed above)
Your assumptions are correct, qvel and qacc are aligned, the same index refers to the same DoF on the model (unlike qpos). So you can use dofadr for both!
Hello, I'm new to MuJoCo and I'm trying to test a simple two-link arm hitting a sphere in a zero gravity environment. I am recording the positions, velocities, and accelerations of the bodies after each simulation step so that I can plot this data.
The floating objects section of the documentation shows how to get the joint addresses for
qpos
andqvel
. Is the address returned byMjModel.jnt_dofadr
a valid address for accessing the joint's acceleration viaMjData.qacc
, or can this address only be used to accessMjData.qvel
? My intuition tells me thatjnt_dofadr
should work for bothqvel
andqacc
(i.e., the dimensionality of the velocity and acceleration should be the same), but the documentation and code comments forjnt_dofadr
indicate that this should only be used forqvel
. Also, the fact that this field is calledjnt_dofadr
instead of something likejnt_qveladr
makes me think that it's applicable to bothqvel
andqacc
.Here's the model I'm using:
simple_arm_zero_gravity.xml
```XMLAdditional details: OS: Ubuntu 22.04 Python version: 3.10.12 MuJoCo version: 3.1.3 (installed in a
venv
with the Python version listed above)