Page 1 of 2

Anyway to determine STA metrics in OpenSim

Posted: Fri Apr 21, 2023 9:43 am
by vigneshrk
Hi,

I am trying to see if I can determine STA metrics in OpenSim as defined by Grimpampi. I thought the position of the marker in body reference frame would change, so I added a function to SimBody to determine that during IK (image added). But the position remains the same and the transformation changes.

Is there a way to determine these metrics?

Re: Anyway to determine STA metrics in OpenSim

Posted: Fri Apr 21, 2023 1:33 pm
by kernalnet
Hi, If I understand correctly, you are trying to find the position of markers in local reference frame. If this is the case, please see this example (Python):

Code: Select all

model = osim.Model('subject01_simbody.osim')
state = model.initSystem()
ground = model.getGround()
for marker in model.getMarkerSet():
	vec = marker.getLocationInGround(state)
	frame = marker.getParentFrame()
	vec2 = ground.findStationLocationInAnotherFrame(state, vec, frame)

Re: Anyway to determine STA metrics in OpenSim

Posted: Fri Apr 21, 2023 2:12 pm
by vigneshrk
Hi Mohammadreza,

Thank you. Just to confirm this would give me the marker position in the body reference frame (anatomical reference frame) for each point? And it would not be a constant value ?

Thanks

Re: Anyway to determine STA metrics in OpenSim

Posted: Fri Apr 21, 2023 2:24 pm
by kernalnet
Yes, in body reference frame. You need to update coordinates' value for every IK time frame and call those in a loop.

Re: Anyway to determine STA metrics in OpenSim

Posted: Fri Apr 21, 2023 2:44 pm
by vigneshrk
Thank you

Re: Anyway to determine STA metrics in OpenSim

Posted: Sat Apr 22, 2023 1:41 am
by vigneshrk
Hi,

any idea why the command marker.getParentFrame();, throws up an error in C++. It states exception, ComoinentHasNoSysten at memory location

Re: Anyway to determine STA metrics in OpenSim

Posted: Sat Apr 22, 2023 5:23 pm
by kernalnet
Hi, I know nothing about C++. Try this one, the output is already in local reference frame and thus, no conversion would be required.

Code: Select all

vec = marker.get_location()

Re: Anyway to determine STA metrics in OpenSim

Posted: Sun Apr 23, 2023 12:28 am
by vigneshrk
Hi,

Thanks. I tried the get_location() function but the output is always constant.

Thanks

Re: Anyway to determine STA metrics in OpenSim

Posted: Sun Apr 23, 2023 1:14 am
by kernalnet
Yes, the position of model's markers remains constant in local reference frame. They are registered relative to body's frame and won't change during motion.

Re: Anyway to determine STA metrics in OpenSim

Posted: Sun Apr 23, 2023 1:28 am
by vigneshrk
So is the transformation matrixes of the body reference frame change from time instant to time instant ?