Marker or point location in API

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Erik Dijkstra
Posts: 21
Joined: Wed Aug 18, 2010 5:24 am

Marker or point location in API

Post by Erik Dijkstra » Thu Jan 16, 2014 1:51 am

Hi,

I would like to get the location of a point on a body through the API. The location of the point of interest should scale along with the body it is attached to.

I haven't found a way to define a point on a body so the only option I could think of is to define a marker on the body and get its position. And there is also a problem: How do I get the location of a marker on a body in the API?

The marker has a property that defines its location but I cannot seem to access it. I get till the marker itself and then I am lost. There is a getProperty() option but I can't figure out how to use this.

Code: Select all

osimModel.getMarkerSet().get("markerName")
Best regards,
Erik

User avatar
Ayman Habib
Posts: 2255
Joined: Fri Apr 01, 2005 12:24 pm

Re: Marker or point location in API

Post by Ayman Habib » Thu Jan 16, 2014 11:08 am

Hi Erik,

Instead of the Properties interface, you can invoke a method on the Marker object

Code: Select all

SimTK::Vec3 markerOffest;
marker.getOffset(markerOffest) 
this will populate a Vec3 with the values specified in your model. If using the Matlab API or scripting then you don't need the SimTK namespace specification.

There're methods to transform points from one body frame to another that are available in the class SimbodyEngine. Please let us know if you need help finding or using them.

Hope this helps,
-Ayman

User avatar
Erik Dijkstra
Posts: 21
Joined: Wed Aug 18, 2010 5:24 am

Re: Marker or point location in API

Post by Erik Dijkstra » Tue Jan 21, 2014 6:54 am

Hi Ayman,

Thanks for the reply! I already found and figured out the ways to transform the points to another body.


Best regards,
Erik

POST REPLY