BodyPartSetup - LeftArm

Hi there,

currently I’m working with the AMMR 1.6.1 version and the Standing Human template. I was trying to change the muscle type from simple to 3E_Hill when I stumbled over a strange if-statement in BodyModel.BodyPartsSetup.any of the GenericBodyModel folder, subsubfolder of AAUHuman.

LeftArm:

“…
#if BM_ARM_MUSCLES_LEFT > 1*(CONST_MUSCLES_NONELEFT_ARM)
#if BM_ARM_MUSCLES_LEFT == 1
(CONST_MUSCLES_NONE*LEFT_ARM)
…”

To understand the code I had a looked into BodyModel.constant.any where CONST_MUSCLES_NONE is defined as 0. Therefore I’m wondering why it is multiplied by “1” and “LEFT_ARM”. And why it is not done like in the rest of the file.

Why is it like that?

Hello Felix,

The purpose of this is that you should be able to change the muscle type and all the other configurations like switching of arms or legs, change the scaling law etc. via so called BM statements. BM statements are definitions that configure the human body in your model without touching any other file than the main file where these statements are defined. You can find a description of this in the getting stated tutorial, the option you can use are also written in file out-commented in the top of the template file,


// ----------------------------------------------------------
  // Model configuration:
  // For more info on body model configuration options please load the model and double click on: 
  // #include "<ANYBODY_PATH_BODY>\Documentation\BodyModel.parameters.any"
  // ----------------------------------------------------------  

So in your case you would add


  #define  BM_LEG_MUSCLES_BOTH CONST_MUSCLES_3E_HILL  
  #define BM_ARM_MUSCLES_BOTH CONST_MUSCLES_3E_HILL

before the include statement of the HumanModel.any to change the muscle type.

Best regards
Daniel

Hello Daniel,

thanks for your reply. What I did not understand yet is, why the definition for the muscles of the RightArm:

#if BM_ARM_MUSCLES_RIGHT > CONST_MUSCLES_NONE
  #if BM_ARM_MUSCLES_RIGHT == CONST_MUSCLES_SIMPLE

is different to the LeftArm:

#if BM_ARM_MUSCLES_LEFT > 1*(CONST_MUSCLES_NONE*LEFT_ARM)
  #if BM_ARM_MUSCLES_LEFT == 1*(CONST_MUSCLES_NONE*LEFT_ARM)

If CONST_MUSCLES_NONE is always 0, as defined in in BodyModel.constant.any, the if-statement of the LeftArm with “1*(CONST_MUSCLES_NONE*LEFT_ARM)” is always zero. Whether you multiply it with 1 / LEFTARM or not.

best regards,
felix

Hi Felix,

you shouldn’t worry about that, it’s just another way of implementing it. Since it is handled somewhere else that if there is no arm, it doesn’t matter what kind of muscles it would have, these formulations are doing the same.

Best regards
Daniel

P.S.: I wouldn’t spend too much time on looking through these files. The combinations of the BM statements have been tested systematically so that we are pretty sure that the ones that make sense are working.