Hello Everyone,
I am using 6DOF custom joint between scapula and humerus to stimulate dislocation. I have generated trajectory in Matlab i.e. translation XYZ and rotation Euler angles. Opensim requires generalized coordinate as an input for prescribing joint motion. Does anyone know how I can implement it.
Please see the attached file from "Minimal formulation of joint motion for biomechanisms"- Ajay seth
I have Theta1,Theta2,Theta3 and P1,P2,P3 wrt. parent body . How can I calculate generalized coordinate q?
Thanks!
Defining Joint Motion using Generalized Cordinates
- Rahul Agrawal
- Posts: 47
- Joined: Mon Aug 31, 2015 3:16 pm
Defining Joint Motion using Generalized Cordinates
- Attachments
-
- Capture1.PNG (10.51 KiB) Viewed 610 times
Tags:
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: Defining Joint Motion using Generalized Cordinates
If theta and p are a function of one independent variable then the easiest way is to use a function in the TransformAxis (e.g. see the example for knee translation as a function of knee_angle_r):
https://github.com/opensim-org/opensim- ... .osim#L590
Unfortunately, I am not sure if OpenSim supports a multivariate function. In this case you would have to implement your own custom function and export it as an OpenSim plugin.
https://github.com/opensim-org/opensim- ... .osim#L590
Unfortunately, I am not sure if OpenSim supports a multivariate function. In this case you would have to implement your own custom function and export it as an OpenSim plugin.
- Rahul Agrawal
- Posts: 47
- Joined: Mon Aug 31, 2015 3:16 pm
Re: Defining Joint Motion using Generalized Cordinates
Hi Dimitar,
Thank you for your reply.
In my case theta and p are independent of each other as I am prescribing motion from located position to dislocated position for humerus.
Do you think is there any way to implement this eg (modelling 6 DOF with 6 different joints at the same location and prescribing thetha and p accordingly).
Thanks!
Regards,
Rahul
Thank you for your reply.
In my case theta and p are independent of each other as I am prescribing motion from located position to dislocated position for humerus.
Do you think is there any way to implement this eg (modelling 6 DOF with 6 different joints at the same location and prescribing thetha and p accordingly).
Thanks!
Regards,
Rahul
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: Defining Joint Motion using Generalized Cordinates
Yes as I told you, you will have to implement your own Function as a plugin that can have multiple dependent variables, because OpenSim does not have such a function. Then you can add this function to the TransformAxis providing the dependent coordinates and the coefficients for evaluating the function value, if we assume that it is a polynomial.
You can look at the source code to see how different function are defined (e.g. check the inheritance diagram https://simtk.org/api_docs/opensim/api_ ... ction.html and particularly the PolynomialFunction) and create your own function by extending OpenSim::Function. Then create a plugin:
https://simtk-confluence.stanford.edu/d ... ng+Plugins
You can look at the source code to see how different function are defined (e.g. check the inheritance diagram https://simtk.org/api_docs/opensim/api_ ... ction.html and particularly the PolynomialFunction) and create your own function by extending OpenSim::Function. Then create a plugin:
https://simtk-confluence.stanford.edu/d ... ng+Plugins