Hey, so I have R_FTC and L_FTC as a part of CAST markers in my c3d file for both Static and GIAT. Unfortunately, AnyBody does not have them in its inbuilt Marker Protocal file and I am trying to add them manually in the script with location as 'Most lateral prominence of the left/right greater trochanter' but I cannot find Trochanter, UpperFemure or GreaterFemoral etc in the 'Seg' file which I can use to put the markers on.
Please help.
Thank you.
Hi Romy,
Welcome to the AnyScript forum!
First of all, I would suggest you to go through this link to use your own data in the mocap model. It explains in general all the things that you should be aware of.
You can first of all explore the human leg. As you didn't find existing landmarks, you can create them yourself. Somewhere in your code, please write the following lines for example:
Main = {
Main.HumanModel.BodyModel.Right.Leg.Seg.Thigh = {
AnyRefNode Trochanter = {
sRel = {.....};
};
};
};
Alternatively, you could modify or create a copy of the existing markers in the marker protocol file to include your markers. In this way you can base the marker directly on the AnatomicalFrame by providing appropriate sRelOpt
// make sure to write #define _R_FTC in the beginning
#ifdef _R_FTC
// Marker on the Right Trochanter
CreateMarkerDriver R_FTC (
MarkerPlacement= Right.Leg.Seg.Thigh,
PlaceMarkerAt = AnatomicalFrame,
OptX=OFF,OptY=OFF,OptZ=OFF,
WeightX=1.0,WeightY=1.0,WeightZ=1.0,
UseC3DWeightResiduals=ON
) = {
sRelOpt = {0.0, -0.02, 0.05}; // approximately
};
#endif
Hope that helps.
Best regards,
Dave
Hey,
Thank you for the link. I will go through them! Your recommendations are well noted however, I have a small clarification: I tried to modify or create a copy of the existing markers in the marker protocal file to include the markers but I could not find the anatomical frame for the same and in order to introduce trochanter node in my Seg anyscript file I am confused with the sRel for the same!
I will go through the link now and get back if I find the solution.
Thank you.
Hi Romy,
Every segment in the human model has an anatomical frame. You should be able to find it if you explore to Main.HumanModel.BodyModel.Right.Leg.Seg.Thigh.AnatomicalFrame in the model tree (and likewise for other segments).
Regarding the sRel, this is just the relative location of the reference node to the parent reference frame, which can be the origin of a segment, another reference node, etc. You have two ways to create the marker at the right location: You either create the reference node on your human model and use this reference node in the marker protocol file, or you use another reference frame and provide the sRelOpt so that the marker is correctly located.
If you are confused about sRel, I would highly recommend that you go through the AnyBody tutorials. It is fundamental that you get an idea of the basics of AnyBody before you start working on detailed human model.
Also, to create a reference node on the leg, you don't necessarily need to make changes to the Seg file in the AMMR folder. I would advise against that as you will introduce the change in all the application examples using that copy of the AMMR. You can introduce changes to the body model through your specific model. The lines for making the reference node on thigh that I wrote in my previous post can be written in your model, for example in the LabSpecificData.any file. Moreover, I would suggest that you use the Scale function as is done for the rest of the reference nodes on the thigh segment (like you can see in the Seg file). The Scale function will make sure that the reference node is scaled according to the anthropometrics of the subject.
I hope that clarifies a bit more.
Best regards,
Dave
Hey,
I read through the suggested links and introduced the two markers in my 'MarkerProtocalStatic' file by using a existing anatomical mark in the thigh. However, I still have two clarifications.
- If I run the parameter identification with 1-2 Markers with Optimization=ON in just 1 direction to get a better experimental-body marker alignment. My body gets dismorphed. Is that common? Do we settle for the best we can achieve?
- I have the optimized parameters (Decent I hope). Since my experimental setup soley concentrates on Lower body I used Lowerextremity.main instead of MultiTrial StandingRef.main as opposed to the link you and AnyBody Tutorials says. Now I am getting errors while loading parameters from the above to MultiTrial FlySquat to run a dynamic simulation.
ERROR(SCR.EXP3) : ForcePlates.any(24) : Defined at : ForcePlateAutoDetection.any(112) : 'ForcePlateType' : Index [2] out of range for 'AnyInt[2]' I had no such errors with Forceplate when I ran in Lowerextremity.main. Can you help me understand why and how I can eradicate it?
Thank you.
Hi Romy,
- It really depends on the freedom in the optimization problem. Remember that also segment dimensions are getting optimized, so if you allow the vertical directions to be optimized as well as the segment dimension in case of the leg, then the solver can't find a good solution because all solutions are good.
- The LowerExtremity.main is from the Plug-in-gait_Simple model, if I understand correctly. These are two separate models with different settings for the lab. So, you will run into some errors like this becuase maybe the force plate settings are different, eg. number of force plates, forceplate type. You should stick to one model and work in that because then you will ensure you have consistent settings across your trials.
Best regards,
Dave
Hey again Dave,
I managed to get a decent parameter identification, thanks. I loaded the obtained parameters onto my GIAT and ran inverse dynamics which seems to be satisfactory! (By looking at the charts) These were to validate the c3d files and model.
I am now moving in to my next step which has my test subject laying in supine position on a bed placed on the force plates. Everything looked good until parameter identification. However, when I run the Inverse Dynamics (Using StandingRef) I get the following error message:
ERROR(SCR.EXP0) : JointsAndDriversOptimized.any(12) : UpdDriverPos : Error in evaluation. Please refer to the following error messages for details ...
ERROR(SCR.EXP.FUN2) : JointsAndDriversOptimized.any(12) : JntDriverTrunkFull : Error in function InterpolatedData : Called from object JntDriverTrunkFull : Parameter has an invalid value for this interpolation; extrapolations are not allowed.
Additional Information:
- I have added #define INCLUDE_UPPERBODY OFF in my TrialSpecifcData.any as I do not have any markers on my test subjects upper body as the experiment solely concentrates on lower body.
- As my Upperbody was not constrained I modified,
#define MOCAP_HUMAN_GROUND_RESIDUALS "PelvisTrunkAndContacts" //Changed.
in LabSpecificData.any by adding 'PelvisTrunkandContacts' in HumanGroundResiduals. In addition to Pelvis and Trunk, I have added 4 nodes (Thigh and Shank for both R&L) and 2 Heel to help the solver keep the body from falling.
When I skip the inverse dynamics and run 'FlywheelSquat' with parameters loaded from the StandingRef my Inverse dynamics run with the following message:
0.1.678) ...Inverse dynamic analysis completed
NOTICE(OBJ.OPR1) : AnyMocapModel.any(63) : InverseDynamicStudy.InverseDynamics : Operation finished with non-fatal errors. Please verify whether these errors are acceptable.
NOTICE(OBJ.OPR1) : RunApplication.any(52) : SubOperations : Operation finished with non-fatal errors. Please verify whether these errors are acceptable.
NOTICE(OBJ.OPR1) : RunApplication.any(49) : InverseDynamics : Operation finished with non-fatal errors. Please verify whether these errors are acceptable.
I would be happy to elaborate or give you additional details if necessary. Please help. Thanks in advance.
Hi Romy,
Regarding the error about interpolation... This happens because the joint angle output file, which has the results from marker tracking, contains data in a specific time period (start and end time of the trial), and when you tried to run inverse dynamics analysis, somehow, the inverse dynamics study is simulating another time period. For example, you may have changed the start time or end time of the trial and not run marker tracking again. The solution is to run marker tracking again.
I think, it's a little bit more confusing to understand what's happening in other trials. In one trial, you are simulating the subject lying on a bed, in another trial you are simulating the FlywheelSquat. These two trials clearly have different support conditions. The bed provides support all over the body, while in squat you are standing on your feet. So, you should be careful when you switch trials and ensure the right conditions are applied. The best way to do this is to make them in separate folders. I would also suggest you look at the seated human model to get an idea of how to simulate a bed. You could make the seat lie completely flat.
Best regards,
Dave
Greetings Dave,
Thank you, I figured that out and corrected them.
The points are noted but to shed more light on it: My test subject is laying flat (Supine position) with both ankles outside the end of bed frame.
A external load acts on the left ankle.
I am using StandingRef for parameter identification and use FlywheelSquat (with same C3D file as my test scenarios are static with just change in load acting on the ankle for different scenarios) so I have introduced 7 nodes in MyEnvironmentAdditions.any and used those nodes to modify my HumanGroundResiduals.any to have the following 6 constraints:
1 lin and 1 rot in trunk. (Exsisting trunk constraint)
1 lin in right shank node, left shank node, right thigh node, left thigh node.
I have not added heels as my ankle is placed outside the area of bed (hanging).
The JRF looks decent at the first glance but the HGR (for Lin LeftShank X and Y is a bit excessive) I assumed it must be the frictional force!
I am trying to introduce friction in it but reading your suggestion should I work on Seated human model or SpinePressureLyingBack so that the my model suits better?
Thank you.
Romy Jemals
Hi Romy,
Sorry for the delayed reply! It is a bit busy here in this period.
Yea, If you are working with a supine position, then the Seated Human or Spine Pressure Lying Back are great places to start with. In fact, I believe the Spine Pressure Lying Back model is basically the seated human model driven to the supine posture. This will make your work substantially easier. You would still need to modify some of the contact points as you mentioned the ankle are outside the bed frame.
Best regards,
Dave
Hey,
I understand, please don't be.
I took your advice and started working with Spine Pressure Lying Back but since it is a Validation model and not a MoCap working model.
I am curious if there is a possibility of me using the existing SPLB model with my c3d file and MoCap data?
I did try changing the body weight and height (curious to see results) but it leads to error as I presume a lot in the code is dependent on the above.
I am as of now working on StandingRef Mocap model but adapting it to resemble SPLB model by introducing Support.any, ConnectionsSegments.any, Environment.any, Initialpositions.any etc such as in the above.
I am not sure if it produces intended results but it is working. However, it's been a confusing ride so far as the coordinate systems between my model and SPLB model are different and certain code sections like sRel,ARel (for SeatPelvisJntNode, PelvisSeatJntNode,SeatAdjNode, etc) are not explained in the SPLB model: As in why certain nodes need to be in same coordinate axis and why a few are not. It would be beneficial if I could understand the underlying concept.
Thank you.
With Regards,
Romy Jemals
Hi Romy,
You will need to port the seat/bed model to your own mocap model. This means you will have to bring in the code for segments, support, joints and drivers for the seat. I think that's exactly what you have described, so it should be alright. It will be a bit of work, but since you are working with marker based data, you will only have to do this one time. You basically need to position the bed in a sensible way according to your mocap data. This can of course be complicated for a whole bunch of reasons. Most critical, as you say, would be if your lab coordinate system is not consistent with the global ref in the SPLB validation model. I think, you should be able to adjust some of the input parameters or drivers between the seat and the global ref to account for that. The rest of the segments (backrest, footrest, etc) should simply follow the corresponding drivers between the seat and the segment.
Best regards,
Dave
Greetings Dave,
Thank you for your timely response. All the said points are noted. However, I have a remark and a question to follow.
Remark being: Since my test scenario is static case, I have skipped drivers. I have instead used AnyKinEq for BedRest, BackRest, HeadRest, LegRest with the following:
MeasureOrganizer = {0, 1, 2, 3, 4, 5}; and
Type = RotVector; for AnyKinRotational.
Is that okay?
- I am the verge of completing my model to resemble SPLB Model but I have not modified my ARel for any node so far and let it in its default position. Do you reckon I fix it like the SPLB model for complete validation/success or I leave it in their own default coordinate axes. Incase yes, Can I know why certain nodes need to be in same coordinate axis and why a few should not. It would be beneficial if I could understand the underlying concept to replicate.
Thank you.
With Regards,
Romy Jemals
In addition:
I just ran the Inverse Dynamics study. ParameterIdentification and Marker Tracking work fine. The body is placed on the bed segment (as close as possible to SPLB model except the coordinate axes alignment).
This is how it looks after Marker Tracking.
However, when I run InverseDynamics I get the following error:
- Operation Sequence: (Operation: Main.RunAnalysis.InverseDynamics):
0.0) Operation Sequence: (Operation: Main.RunAnalysis.InverseDynamics.SubOperations):
0.0.0) Dummy operation: (Operation: Main.RunAnalysis.InverseDynamics.SubOperations.dummy):
0.1.0) InverseDynamics (Operation: Main.Studies.InverseDynamicStudy.InverseDynamics):
0.1.0.0) PreOperation (Operation: Main.Studies.InverseDynamicStudy.InverseDynamics.PreOperation):
0.1.0.0.0) InitialConditions (Operation: Main.Studies.InverseDynamicStudy.InitialConditions):
0.1.0.0.0) ...Design variables have been updated.
0.1.0.0.1) ...Load-time positions have been re-established.
0.1.0.0.1.0) PreOperation (Operation: Main.Studies.InverseDynamicStudy.InitialConditions.PreOperation):
0.1.0.0.1.0.0) Operation Sequence: (Operation: Main.ModelSetup.Views.SetViewMacros.InverseDynamicView):
0.1.0.0.1.0.0.0) mcr (Operation: Main.ModelSetup.Views.SetViewMacros.InverseDynamicView.mcr):
Macro command : mcr(1:1)> classoperation Main.ModelSetup.Views.InverseDynamicView"Set View"
0.1.0.0.2) ...Kinematic analysis completed.
0.1.0.0.3) ...Dependent variables are fully updated.
0.1.0) Inverse dynamic analysis...
ERROR(OBJ.MCH.MUS4) : AnyMocapModel.any(63) : InverseDynamicStudy.InverseDynamics : Muscle recruitment solver : solver aborted due to singular KKT matrix
Can you help me understand why I get this and how I should proceed to eradicate the said error?
Thank you.
With Regards,
Romy Jemals