google-deepmind / mujoco

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

Is Ground Reaction Force (GRF) necessary for Mujoco to calculate muscle force through Inverse Dynamics #1011

Closed Hippozhibos closed 1 year ago

Hippozhibos commented 1 year ago

Hi,

I'm a student from Biomechanics background and I'm trying to use MuJoCo for calculating muscle forces through Inverse Dynamics (Just like what OpenSim did).

In OpenSim, GRF must be provided to have an accurate estimation of muscle forces. But, according to this answer,

ab478ab867e0ea7453b63eed69d15b4

it seems that Mujoco could calculate the GRF (or contact force) automatically based on the model, and it would be quite accurate. Is that because Mujoco use the soft contact model while OpenSim does not? And does that mean if I want to estimate muscle forces more accurately, I should consider more about the accuracy of my model instead of the GRF measurement?

Another related question: the output of Inverse Dynamics should be the general force of each DOF, right? then how does Mujoco use these data to calculate the force of each muscle (if there are multiple muscles control one DOF)?

I apologize if my question is too naive. Looking forward to your reply!

Thanks

Hippozhibos commented 1 year ago

With regard to "Calculating muscle forces", I just read the article https://arxiv.org/abs/2112.06061v1, and there is a figure showed the muscle activity of each muscle:

add827deecab15d861363ee0557bad6

So how does Mujoco calculated these data?

Hippozhibos commented 1 year ago

My bad. I double-checked the article https://arxiv.org/abs/2112.06061v1. So actually, the authors trained a policy network to control the agent (the musculoskeletal model of Ostrich) to learn the motion from mocap data. After the policy network learned the behavior, the muscle force (calculated by the policy network?) is considered as the true force which articulate a true animal to do the same motion. Thus, the muscle forces are not calculated from the Inverse Dynamic results, instead they are calculated through the RL process. Is that correct?

Furthermore, I think Prof. Todorov made it clear here: 49219cc9280ae2fe8a620d612e4f2bb Indeed, Mujoco could calculate GRF based on its constraint model. So I may need to read this article https://ieeexplore.ieee.org/document/6907751, it's quite hard for me though.