Anyway to determine STA metrics in OpenSim

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
User avatar
Radhakrishnan Vignesh
Posts: 104
Joined: Tue Jun 01, 2021 8:09 am

Anyway to determine STA metrics in OpenSim

Post by Radhakrishnan Vignesh » Fri Apr 21, 2023 9:43 am

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?
Attachments
simBody.JPG
simBody.JPG (93.29 KiB) Viewed 271 times

User avatar
Mohammadreza Rezaie
Posts: 365
Joined: Fri Nov 24, 2017 12:48 am

Re: Anyway to determine STA metrics in OpenSim

Post by Mohammadreza Rezaie » Fri Apr 21, 2023 1:33 pm

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)

User avatar
Radhakrishnan Vignesh
Posts: 104
Joined: Tue Jun 01, 2021 8:09 am

Re: Anyway to determine STA metrics in OpenSim

Post by Radhakrishnan Vignesh » Fri Apr 21, 2023 2:12 pm

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

User avatar
Mohammadreza Rezaie
Posts: 365
Joined: Fri Nov 24, 2017 12:48 am

Re: Anyway to determine STA metrics in OpenSim

Post by Mohammadreza Rezaie » Fri Apr 21, 2023 2:24 pm

Yes, in body reference frame. You need to update coordinates' value for every IK time frame and call those in a loop.

User avatar
Radhakrishnan Vignesh
Posts: 104
Joined: Tue Jun 01, 2021 8:09 am

Re: Anyway to determine STA metrics in OpenSim

Post by Radhakrishnan Vignesh » Fri Apr 21, 2023 2:44 pm

Thank you

User avatar
Radhakrishnan Vignesh
Posts: 104
Joined: Tue Jun 01, 2021 8:09 am

Re: Anyway to determine STA metrics in OpenSim

Post by Radhakrishnan Vignesh » Sat Apr 22, 2023 1:41 am

Hi,

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

User avatar
Mohammadreza Rezaie
Posts: 365
Joined: Fri Nov 24, 2017 12:48 am

Re: Anyway to determine STA metrics in OpenSim

Post by Mohammadreza Rezaie » Sat Apr 22, 2023 5:23 pm

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()

User avatar
Radhakrishnan Vignesh
Posts: 104
Joined: Tue Jun 01, 2021 8:09 am

Re: Anyway to determine STA metrics in OpenSim

Post by Radhakrishnan Vignesh » Sun Apr 23, 2023 12:28 am

Hi,

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

Thanks

User avatar
Mohammadreza Rezaie
Posts: 365
Joined: Fri Nov 24, 2017 12:48 am

Re: Anyway to determine STA metrics in OpenSim

Post by Mohammadreza Rezaie » Sun Apr 23, 2023 1:14 am

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.

User avatar
Radhakrishnan Vignesh
Posts: 104
Joined: Tue Jun 01, 2021 8:09 am

Re: Anyway to determine STA metrics in OpenSim

Post by Radhakrishnan Vignesh » Sun Apr 23, 2023 1:28 am

So is the transformation matrixes of the body reference frame change from time instant to time instant ?

POST REPLY