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

Generating Muscle Activation Data #880

Closed lalmofee closed 1 year ago

lalmofee commented 1 year ago

Hi,

I am a student attempting to analyze muscle activation during an arm movement generated by rotating a crank. Essentially, I am observing the arm muscles in action without actively engaging or activating them, as they naturally move in response to the crank rotation. I attempted to record the muscle activation during the movement, but I encountered an issue where the resulting array is empty. I would like to know if MuJoCo has the capability to generate muscle activation data.

Thank you

GuillaumeVDu commented 1 year ago

Hi, by muscle activation do you mean muscle force?

lalmofee commented 1 year ago

Hey No, I mean as in MjData.act/data.act

Get Outlook for iOShttps://aka.ms/o0ukef


From: Guillaume @.> Sent: Tuesday, May 23, 2023 7:14:09 AM To: deepmind/mujoco @.> Cc: lalmofee @.>; Author @.> Subject: Re: [deepmind/mujoco] Generating Muscle Activation Data (Issue #880)

Hi, by muscle activation do you mean muscle force?

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https://github.com/deepmind/mujoco/issues/880*issuecomment-1559487288__;Iw!!LIr3w8kk_Xxm!sbsE6SgDW2UwYaqU2pDXWWTrZVp-2Gs0CYR7gHsaMKptn5XwiV5UnF31apyF06eR2iK2coMTRy-t8KjdqFfY-2uk$, or unsubscribehttps://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AYFB2VCZ2L7ZIR2AB7JEJH3XHTA3DANCNFSM6AAAAAAYLO4RVE__;!!LIr3w8kk_Xxm!sbsE6SgDW2UwYaqU2pDXWWTrZVp-2Gs0CYR7gHsaMKptn5XwiV5UnF31apyF06eR2iK2coMTRy-t8KjdqCHCazTG$. You are receiving this because you authored the thread.Message ID: @.***>

Vittorio-Caggiano commented 1 year ago

@lalmofee you can have a look how we do it in MyoSuite: https://github.com/facebookresearch/myosuite/blob/e020c6c8ff9db8f5627cd3561a981fba88438ac8/myosuite/envs/env_base.py#L463

MyoSuite was designed exactly to train musculoskeletal models and might provide some of the functionalities you are looking for

GuillaumeVDu commented 1 year ago

@lalmofee Muscle activation is an input that you have to give to the model. If you want to generate it check @Vittorio-Caggiano comment. From what I understand if you want to see the passive effect on crank turning then you will have no muscle activation.

yuvaltassa commented 1 year ago

I don't understand the OP. You are pulling externally on a passive muscle and expecting to see activation? This is passive stretching force, the black line in the top left image in this section. You would get that if you moved the arm of a dead person. No activation required or expected.

Am I missing something?

Closing for now.