Replies: 1 comment 3 replies
-
It's to convert between |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I'm trying to understand the equation for qfrc_actuator for hinge/slide joints for a position joint actuator. I couldn't find a similar question, apologies if this was already asked somewhere.
Trying to write out the equation from the code:
gain is:
https://github.com/deepmind/mujoco/blob/fd1070cf039a586e0836d43baf2ff5bf4bd887b4/src/engine/engine_forward.c#L210
bias is:
https://github.com/deepmind/mujoco/blob/fd1070cf039a586e0836d43baf2ff5bf4bd887b4/src/engine/engine_forward.c#L251
actuator_length is:
https://github.com/deepmind/mujoco/blob/fd1070cf039a586e0836d43baf2ff5bf4bd887b4/src/engine/engine_core_smooth.c#L651
and$force = gain*ctrl + bias$ from here and here.
Now for a position actuator,
gainprm = [kp, 0, 0]
andbiasprm = [0, -kp, 0]
from here.plugging these all in we get:
$force = k_p * ctrl - k_p * q * gear$
To get qfrc_actuator
moment is:
https://github.com/deepmind/mujoco/blob/fd1070cf039a586e0836d43baf2ff5bf4bd887b4/src/engine/engine_core_smooth.c#L652
qfrc_actuator is:
https://github.com/deepmind/mujoco/blob/fd1070cf039a586e0836d43baf2ff5bf4bd887b4/src/engine/engine_forward.c#L300
so$qfrc = gear * force = gear * k_p * ctrl - gear^2 * k_p * q$
What's the intuition behind the$gear^2$ term (unless I made some mistake)? I would expect the equation to look something like $gear * k_p * (ctrl - q)$
Thanks for taking a look!!!
Beta Was this translation helpful? Give feedback.
All reactions