Using mj_inverse to Obtain Contact Forces #2241
Unanswered
gaoning0109
asked this question in
Asking for Help
Replies: 1 comment
-
mj_inverse writes into qfrc_inverse, cfrc_ext is something else. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Intro
Hi!
I am a student at HEU, I use MuJoCo for my research oncontact forces.
My setup
MuJoCo 3.2.0 C
My question
My goal is to use the mj_inverse function to obtain contact forces given qpos, qvel, and qacc. Of course, qpos, qvel, and qacc are correctly calculated from my robot's motion model. I obtained the corresponding forces from cfrc_ext, and I know that the contact forces in cfrc_ext are derived from mj_contactForce. My model is quite simple: it's just a rigid body with a free_joint in the world. After trying, the forces obtained from cfrc_ext do not behave correctly when applied to my motion model; the model flies away. At the same time, I also tested using the mj_forward function, this time only providing qpos and qvel. In this case, the forces obtained from frc_ext added to my motion model behave according to physical laws, and I can also obtain contact forces. According to my understanding, I should be using mj_inverse rather than mj_forward. Perhaps my understanding is incorrect, and I look forward to your response.
Minimal model and/or code that explain my question
No response
Confirmations
Beta Was this translation helpful? Give feedback.
All reactions