Hi, i use the Mocap Example in the repository and i have a CSV file with the bed contact reaction force that syncs with the time of force plates and the BVH file. My subject leans on the bed frame during the task.
So, In the main file, I have defined two AnyRefNode at the bed frame (for left and right leg contact).
I tried to read a column of bed reaction data from CSV and put it inside the F in AnyForce3D as shown:
There is an error in the F there. May I know how to put the bed reaction column data into F?
Besides, do I need to include interpolation of bed reaction force data since i already sync it with the data from force plates and BVH?
After defining the bed reaction force in the environment model, are there any more settings needed so that the bed reaction force is included in the inverse dynamics?
You can construct a AnyFunInterpol if you need interpolation of the force.
If you AnyForce3D is included in your study - then the inverse dynamics simulation will pick it up and include it.
ERROR(SCR.EXP0) : BedReac.any(27) : 'F' : Error in expression. Please refer to the following error messages for details ...
ERROR(SCR.EXP1) : BedReac.any(27) : Operator '{' : Illegal operation for given argument types : 'AnyFloat','AnyFloat','AnyFloat[111]'
That is because you are currently trying to assign the whole column of force data into the AnyForce3D and you need something that gives you only one value each timestep.
Something like:
AnyFunInterpol ForceFun = {
Data = .Fz;
T = Main.Study.tArray;
Type=BSpline;
};
AnyForce3D LeftBedReac= {
AnyRefFrame &ref=Main.EnvironmentModel.Bed.NodeLeft0;
F={0,0, .ForceFun(Main.Study.t)};
};
For simplification the interpol class can read directly from a comma separated file
Your error is a type error. The T and Data arrays of the interpol function needs to be the same size.
The error indicates that it is the code on line 16 of the BedReac.any file that is the issue. Please check and try to fix it.
Thanks. I found that the inverse dynamics will take the 3 frames after start time, and 3 frames before the end time of .bvh and force plates CSV file. May i know how to define the time for bed reaction data to follow the same pattern?