Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Free moment through wrapper #6

Open
jimmyDunne opened this issue Jun 23, 2015 · 5 comments
Open

Get Free moment through wrapper #6

jimmyDunne opened this issue Jun 23, 2015 · 5 comments
Labels

Comments

@jimmyDunne
Copy link

Can't find a method to get the calculated free moments through matlab/python interface.

Would be an important feature for those using btk to export data to OpenSim.

Thanks for all your awesome work!

@Alzathar
Copy link
Member

The free moment is available by computing the ground reaction wrench associated with each force platforms. Each wrench contains forces and moments at the point of application. The free moment corresponds to the vertical coordinate of the moment.

Matlab
Within Matlab, you have to use the function btkGetGroundReactionWrenches. For example if you have two force platforms and the vertical axis of the global frame is the Z-axis, you can use the following example

h = btkReadAcquisition('path/to/my/file');
grw = btkGetGroundReactionWrenches(h);
Tz1 = grw(1).M(:,3); % Free moment for the first platform
Tz2 = grw(2).M(:,3); % Free moment for the second platform

Python
It is also possible to compute these wrenches with the Python wrapping, but the way to do is different. You can use the example given in this tutorial. The output of the pipeline (grwc) is a btk.btkWrenchCollection object.

@jimmyDunne
Copy link
Author

Thanks for the answer!

Are the wrenches in Nmm rather than Nm? I didn't necessarily think the wrenches were the free moment since the values are in the hundreds when I am expecting walking free moment values ~10 Nm

@Alzathar
Copy link
Member

The unit for the moments depends of your acquisition settings. To know the stored unit for the moment, you can use the Matlab function btkGetPointsUnit.

h = btkReadAcquisition('path/to/my/file');
btkGetPointsUnit(h,'moment')

@jimmyDunne
Copy link
Author

Thanks! The only two active OpenSim c3d conversion tools are MOtoNMS and c3d2OpenSim.

Both of these projects rely on btk as the c3d reader, but I feel we both under utilize your software. For instance, both projects calculate free moment rather than using the wrenches class.

Im not sure how to really deal with that. May be a conversation for a different medium :)

@Alzathar
Copy link
Member

We can continue this conversation on the mailing-list BTK Users if you want. Other BTK/OpenSim users might be interested in this discussion and could contribute too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants