segment power analysis
- Carlos Gonçalves
- Posts: 135
- Joined: Wed Jun 08, 2016 4:56 am
Re: segment power analysis
Thanks Nick. I will try it down the line.
But until then, the challenge to me would be converting the forces from all contact surfaces on the feet to a single vector in the "virtual force platform" file. I already managed to get the sum of all force vectors (X,Y,Z) but not yet the position of the GRF vector in lab space.
If someone can share a tip or advice, that would be wonderful. With that, I think is creating a version of the model where the contact forces are removed from the ForceSet, and them follow the normal procedures in OpenSim documentation.
What you think?
Best regards.
But until then, the challenge to me would be converting the forces from all contact surfaces on the feet to a single vector in the "virtual force platform" file. I already managed to get the sum of all force vectors (X,Y,Z) but not yet the position of the GRF vector in lab space.
If someone can share a tip or advice, that would be wonderful. With that, I think is creating a version of the model where the contact forces are removed from the ForceSet, and them follow the normal procedures in OpenSim documentation.
What you think?
Best regards.
- Nicholas Bianco
- Posts: 1044
- Joined: Thu Oct 04, 2012 8:09 pm
Re: segment power analysis
Hi Carlos,
I recently added changes to 'createExternalLoadsTableForGait' to compute center of pressure locations: https://github.com/opensim-org/opensim- ... s.cpp#L321.
You could recreate this for your pipeline to get the position of the GRF vector in the lab space.
-Nick
I recently added changes to 'createExternalLoadsTableForGait' to compute center of pressure locations: https://github.com/opensim-org/opensim- ... s.cpp#L321.
You could recreate this for your pipeline to get the position of the GRF vector in the lab space.
-Nick
- Carlos Gonçalves
- Posts: 135
- Joined: Wed Jun 08, 2016 4:56 am
Re: segment power analysis
Great!!!
I will start with that. Thanks a lot for the help.
I will get back here with some results (fingers crossed) or more doubts
Best regards.
I will start with that. Thanks a lot for the help.
I will get back here with some results (fingers crossed) or more doubts
Best regards.
- Carlos Gonçalves
- Posts: 135
- Joined: Wed Jun 08, 2016 4:56 am
Re: segment power analysis
Hello Nick and everyone.
I saw that the OpenSim 4.5 had enhancements in Moco as well.
https://simtk-confluence.stanford.edu:8 ... =130187315
(fingers crossed emoji).
Best regards.
I saw that the OpenSim 4.5 had enhancements in Moco as well.
https://simtk-confluence.stanford.edu:8 ... =130187315
So, does it mean I can run it, get the resultant contact force for each foot, and load it to IAA in OpenSim?The utility function createExternalLoadsTableForGait() now outputs center of pressure locations for foot-ground contact force elements.
(fingers crossed emoji).
Best regards.
- Nicholas Bianco
- Posts: 1044
- Joined: Thu Oct 04, 2012 8:09 pm
Re: segment power analysis
Hi Carlos,
I realized recently that while the COPs are now included, I don't think I'm computing the "vertical" torque that you would normally expect; I'm just returned the summed contact sphere torques. (Adding the COPs was mainly for visualization purposes, I should have include the vertical torque while I was at it -- my bad!)
But it should be relatively easy to recreate the calculations based on the source code for this utility and modify them to get exactly what you need for IAA. If you want to give that a shot I could port it back into the OpenSim utility.
-Nick
I realized recently that while the COPs are now included, I don't think I'm computing the "vertical" torque that you would normally expect; I'm just returned the summed contact sphere torques. (Adding the COPs was mainly for visualization purposes, I should have include the vertical torque while I was at it -- my bad!)
But it should be relatively easy to recreate the calculations based on the source code for this utility and modify them to get exactly what you need for IAA. If you want to give that a shot I could port it back into the OpenSim utility.
-Nick
- Carlos Gonçalves
- Posts: 135
- Joined: Wed Jun 08, 2016 4:56 am
Re: segment power analysis
Hello Nick,
Let's give it a try, for sure! I'm currently in "writing mode", so I will get back to this soon (I hope).
And don't worry. I just can say "Thank you Moco Team" for all that you guys had been doing. It is the main tool for my research, and as years went by, each new version solved something I needed .
I will keep updating this thread with my results and doubts.
Best regards.
Let's give it a try, for sure! I'm currently in "writing mode", so I will get back to this soon (I hope).
And don't worry. I just can say "Thank you Moco Team" for all that you guys had been doing. It is the main tool for my research, and as years went by, each new version solved something I needed .
I will keep updating this thread with my results and doubts.
Best regards.
- Nicholas Bianco
- Posts: 1044
- Joined: Thu Oct 04, 2012 8:09 pm
Re: segment power analysis
Sounds good, Carlos! Glad to hear Moco has been a reliable research tool for you
- Carlos Gonçalves
- Posts: 135
- Joined: Wed Jun 08, 2016 4:56 am
Re: segment power analysis
Hello Nick,
My simulations are soon over, and I need to implement IAA right now (I have no more excuses for delaying this task ).
I realized I could have access to createExternalLoadsTableForGait main variables with the ForceReporter. It gives me the Forces and Torques for Spheres and HalfPlane. I hadn't the courage to update to OpenSim 4.5 yet (I think I was an early adopter of OpenSim 4.4)
I wonder more about the difference between the measurements in Sphere and HalfPlane frames. The forces are opposites, but the torques are not; here are some graphs.
So, if I treat the HalfPlane data as a force plate, I should add the Sphere torque to the calculation of the COP since the plane exerts this torque in the Sphere (I suppose) and the Sphere exerts the same torque in the Halfplane. But if I do that, the COP will not be under the Sphere. If I do as your code, the COP is correctly placed. Here is a picture of its place with a single HalfPlane/Sphere pair.
Moreover, if I treat the HalfPlane data as a force plate, the twisting torque under the Sphere would require COP information and forces. Again, it is not equal to the Sphere torque in the Y direction (twist had very low values).
Finally, by comparing the data, the method createExternalLoadsTableForGait should change.
What do you think? How are the multiple Sphere and HalfPlane forces related?
Best regards.
My simulations are soon over, and I need to implement IAA right now (I have no more excuses for delaying this task ).
I realized I could have access to createExternalLoadsTableForGait main variables with the ForceReporter. It gives me the Forces and Torques for Spheres and HalfPlane. I hadn't the courage to update to OpenSim 4.5 yet (I think I was an early adopter of OpenSim 4.4)
I wonder more about the difference between the measurements in Sphere and HalfPlane frames. The forces are opposites, but the torques are not; here are some graphs.
So, if I treat the HalfPlane data as a force plate, I should add the Sphere torque to the calculation of the COP since the plane exerts this torque in the Sphere (I suppose) and the Sphere exerts the same torque in the Halfplane. But if I do that, the COP will not be under the Sphere. If I do as your code, the COP is correctly placed. Here is a picture of its place with a single HalfPlane/Sphere pair.
Moreover, if I treat the HalfPlane data as a force plate, the twisting torque under the Sphere would require COP information and forces. Again, it is not equal to the Sphere torque in the Y direction (twist had very low values).
Finally, by comparing the data, the method createExternalLoadsTableForGait should change.
What do you think? How are the multiple Sphere and HalfPlane forces related?
Best regards.
- Nicholas Bianco
- Posts: 1044
- Joined: Thu Oct 04, 2012 8:09 pm
Re: segment power analysis
Hi Carlos,
I think you want to only want to use the half-plane forces and torques for you GRF and COP calculation. You don't want to mix half-plane and sphere forces, since they should be equal and opposite (i.e., you only want one or the other). It's better to use the half-plane values since you know that all the forces and torque are both 1) expressed in the ground frame and 2) applied to / are about the origin.
Best,
Nick
I think you want to only want to use the half-plane forces and torques for you GRF and COP calculation. You don't want to mix half-plane and sphere forces, since they should be equal and opposite (i.e., you only want one or the other). It's better to use the half-plane values since you know that all the forces and torque are both 1) expressed in the ground frame and 2) applied to / are about the origin.
Best,
Nick
- Carlos Gonçalves
- Posts: 135
- Joined: Wed Jun 08, 2016 4:56 am
Re: segment power analysis
Great!
And... It worked!!!!
For everyone interested in IAA analysis with OpenSim API after a Moco simulation, here are my top tips:
And... It worked!!!!
For everyone interested in IAA analysis with OpenSim API after a Moco simulation, here are my top tips:
- Create a ForceReporter file of your simulation
- Follow the code in https://github.com/opensim-org/opensim- ... s.cpp#L310, but change the Twist (torqueY) to: Twist = torqueY_HalfPlane - CopZ*forceX_HalfPlane + CopX*forceZ_HalfPlane
- Keep just a "virtual forceplate" for each foot (API crashes if you don't)
- Follow the tips and screenshots in https://opensimconfluence.atlassian.net ... to+Use+IAA and https://opensimconfluence.atlassian.net ... ns_IAA.pdf to create your XML file, especially your rollingsurface cronstraints
- Remember to disable your contact forces in your model