google-deepmind / mujoco

Multi-Joint dynamics with Contact. A general purpose physics simulator.
https://mujoco.org
Apache License 2.0
7.84k stars 783 forks source link

How to measure the angle acceleration of a joint? #1884

Closed Josh00-Lu closed 1 month ago

Josh00-Lu commented 1 month ago

I am sorry for asking such a simple question.

According to the document of mujoco, the qpos, qvel only contains angle and angle-speed. Besides, I also do not find any sensors measuring angle acceleration of a joint.

Am I suggested to calculate it myself using angular_accelerations = (current_velocities - prev_velocities) / time_step?

This is inaccurate when nstep>1 using previous qvel and current qvel, it will be a waste of computation using for-loop for nsteps mj_step instead of mujoco.mj_step(self.model, self.data, nstep=nstep). Or am I wrong?

I am wondering whether there are any better solutions. Thank you very much.

quagla commented 1 month ago

Why not reading qacc?