vikaskaul
(vikaskaul)
November 20, 2014, 9:45pm
1
Dear experts,
I notice that the elbow joint constraints are violated during replay of the results of a simulation performed a few days ago.
Here’s my procedure to replay the saved results:
Open AnyBody
Open the MoCap model
Turn the Inverse Dynamics switch on (if it is not on already)
Load the model
In the model tree, go to Studies->InverseDynamicStudy->Output and Load the saved results
In the operations tree, go to Studies->Inverse Dynamic Study->Replay
Am I missing something? I had visualized the saved results on the day I carried out the simulation and everything looked fine.
Thank you,
Vikas
toerholm
(Søren Tørholm)
November 21, 2014, 4:07pm
2
Hi Vikas,
If the model has been optimized you might be missing to load into the model the optimized results, which would change the bone lengths etc?
Best regards
Søren
vikaskaul
(vikaskaul)
November 21, 2014, 5:19pm
3
Hi Søren,
Thank you. I thought about that right after I posted that question and I tried loading the optimized results as well but it did not help. Could you please add a line or two could to the relevant Wiki link?
Thanks,
Vikas
mkjung9980
(mkjung9980)
November 28, 2014, 12:04pm
4
Hi Vikas,
Here I would make some suggestions for you.
For automatic saving process of the result in the form of ‘h5’ file,
you can just change one line setting in the ‘MoCap_FullBody.main.any’ file.
#ifndef AutoSaveOption
#define AutoSaveOption 1
#endif
Then the h5 file will be saved after the execution of ‘InverseDynamicAnalysisSequence’
In the ‘InverseDynamics.any’ file, I would suggest you to add a few more lines like this:
//** Creates the RunApplication **//
Main = {
AnyOperationMacro InverseDynamicAnalysisSequence =
{
MacroStr =
({
"classoperation Main.Studies.LoadParametersOptimizationResults" + " " + strquote("Load design") + " --file=" + strformat("\x22") + "../Input/" + OutputFileNamePrefix + Main.ModelSetup.C3DFileData.NameOfFile +"-"+"OptimizedParameters.txt" + strformat("\x22"),
"classoperation Main" + strformat("\x22")+ "Update Values" + strformat("\x22"),
"operation Main.Studies.InverseDynamicStudy.InitialConditions",
"run",
"operation Main.Studies.HumanModel.Calibration.CalibrationSequence",
"run",
"operation Main.Studies.InverseDynamicStudy.InverseDynamics",
"run"
#if AutoSaveOption
,
"classoperation Main.Studies.InverseDynamicStudy.Output" + strquote("Save data") + " --file="+ "../Output/" + OutputFileNamePrefix + Main.ModelSetup.C3DFileData.NameOfFile + ".anydata.h5 " + "--type=Deep"
#endif
});
};
#if AutoSaveOption
Main =
{
AnyOperationMacro ReplayIDAnalysisSequence =
{
MacroStr =
({
"classoperation Main.Studies.LoadParametersOptimizationResults" + " " + strquote("Load design") + " --file=" + strformat("\x22") + "../Input/" + OutputFileNamePrefix + Main.ModelSetup.C3DFileData.NameOfFile +"-"+"OptimizedParameters.txt" + strformat("\x22"),
"classoperation Main" + strformat("\x22")+ "Update Values" + strformat("\x22"),
"classoperation Main.Studies.InverseDynamicStudy.Output" + strquote("Load data") + " --file="+ "../Output/" + OutputFileNamePrefix + Main.ModelSetup.C3DFileData.NameOfFile + ".anydata.h5 " + "--type=Deep",
"operation Main.Studies.InverseDynamicStudy.Replay",
"run"
});
};
};
#endif
};
...
After adding these lines, then you can seee ‘ReplayIDAnalysisSequence’ operation in the Operations tree.
Then you can execute this operation sequence for reply with proper pre-loaded scaling.
I hope this may help you.
Best regards,
Moonki
vikaskaul
(vikaskaul)
December 1, 2014, 5:30pm
5
Thank you very much, Moonki. That piece of script was very helpful!
Vikas