I need help in modifying the squat model in the demo file

I'm having a hard time modifying the internal code of the Anybody program now. I need help in modifying the code of the Squat modle among the Anybody Demo file.

  1. I modified the maximum range of knee bending in the Squat model.
    At this time, I proceeded by modifying the position of the BigToeNode, but when I proceeded in this way, the entire body was tilted forward.
    I wonder how to modify the code so that the body does not lean when modifying the degree of bending of the knee in the squat model.

  2. I wonder if there is a way to make Femur and Tibia bend at the same angle when the knee is bent in Demo's Squat model.
    ex) If the knee is bent at a total of 120 degrees, Femur and Tibia are each bent by 60 degrees.

  3. I made an additional Seg, but it came out that over constrain was applied in the output. I wonder what to do in this case.

  4. I wonder how to change the number of foot print nodes from 25 to 26. First of all, when I changed from 25 to 26 in the related code, an error appeared.

It's my first time coding Anybody program, so I'm having a lot of trouble and need a lot of help; please help me a lot

Hi @Seong

First a comment on modifying the internal human model code.
Be aware that when you do this it affects all models in the ammr you are working on.
If possible you should contain modifications to your application code and keep the internal code as is.

  1. How did you modify the knee flexion range? did you use the Parameters.any file? that is aimed at being the control of the squat model and it has a Min and Max parameter for the knee flexion.
    The BigToeNode is part of multiple drivers for that model so I think it is unwise to change its location. Try to add a new node that is only used for what you need.

  2. To accomplish this I think you need to change how the model is driven. Currently that scenario is not supported by the way it is set up. You need to make new drivers that honor that constraint.

  3. When you introduce a new segment you also introduce 6 degree of freedom that you need to specify constraints for. either by joints, contacts or general constraint equations. See this tutorial.

  4. Where and how did you change it to 26? what error message did you see?

For a good experience with the software i would suggest doing a few of the tutorials in the link above before trying to modify a model as heavily as you are trying now. That can give you a better understanding of the different elements.

Best regards,
Bjørn

Thanks for your help.

I made a model based on the Squat model in the demo file, but I want to change the rotation of the tibia to internal rotation instead of external rotation. I checked the script and saw if it could be modified... but I couldn't come up with a proper way. When I added the code, an error saying that it was over constrained popped up... I need help with this part

ezgif.com-gif-maker

A GIF file is attached for easy understanding.
I don't want Squat model knees to widen while doing squats like that. I think that's the cause, causing external rotation of the tibia. How can I solve this?

Hi @Seong

You should have a driver that affects the external rotation of the tibia - that you can modify to do internal rotation instead.
If you don't have that driver, you can make one using for instance the AnyKinMotion class.

Best regards,
Bjørn

Thank you Bjorn!!

I found the relevant code, but changing the numbers in DriverPos or DriverVel didn't change the result. I'm also wondering if I've found the code correctly. Could you possibly know where the code is to change Tibia's external rotation to internal rotation in the Squat model in the demo?

Hi @Seong

What you have found is a class template which in general you should not change - it will affect your whole ammr, and it have conditions so it is hard for me to say if it is active or not in your model.

The ammr squat model does not come with drivers for rotating the tibia - you will have to make does yourself.
There is both a:
Main.HumanModel.BodyModel.Right.Leg.Seg.Thigh.KneeJoint.VarusValgusRotation
Main.HumanModel.BodyModel.Right.Leg.Seg.Shank.AnkleJoint.TibialTorsionOffset
which you might want to use in defining your driver.

Best regards,
Bjørn

This topic was automatically closed 125 days after the last reply. New replies are no longer allowed.