Hi,
How can I know the Transformation matrix between 2 Body frames at certain State? (eg. between the humerus frame and clavicle frame or even ground frame) Are there any codes that I can use in Matlab to extract the Transformation relationship?
Thanks!
Regards,
Hilary
Get Body frame relationship (transformation matrix) in Matlab
- Hilary Cheng
- Posts: 12
- Joined: Thu Oct 04, 2018 9:10 pm
- Thomas Uchida
- Posts: 1793
- Joined: Wed May 16, 2012 11:40 am
Re: Get Body frame relationship (transformation matrix) in Matlab
I think you are looking for the Frame::findTransformBetween() method: https://simtk.org/api_docs/opensim/api_ ... 902fd30aa3.
- Hilary Cheng
- Posts: 12
- Joined: Thu Oct 04, 2018 9:10 pm
Re: Get Body frame relationship (transformation matrix) in Matlab
Hi,
Thanks for the reply!
I have tried the following:
dsrFrame = osimModel.getGround();
body = osimModel.getBodySet().get(0)
transform = body.findTransformBetween(state,dsrFrame)
what I get in Matlab is:
transform =
org.opensim.modeling.Transform@2676dc05
I would like to know how can I convert the value above to a Matlab readable Matrix?
Thanks!
Hilary
Thanks for the reply!
I have tried the following:
dsrFrame = osimModel.getGround();
body = osimModel.getBodySet().get(0)
transform = body.findTransformBetween(state,dsrFrame)
what I get in Matlab is:
transform =
org.opensim.modeling.Transform@2676dc05
I would like to know how can I convert the value above to a Matlab readable Matrix?
Thanks!
Hilary
- Hilary Cheng
- Posts: 12
- Joined: Thu Oct 04, 2018 9:10 pm
Re: Get Body frame relationship (transformation matrix) in Matlab
Problem Solved! =)
for reference:
rotationmatrix = transform.R();
positionvector = transform.p();
Thanks for helping!
Hilary
for reference:
rotationmatrix = transform.R();
positionvector = transform.p();
Thanks for helping!
Hilary