Page 1 of 1

Marker or point location in API

Posted: Thu Jan 16, 2014 1:51 am
by erikdijkstra
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

Re: Marker or point location in API

Posted: Thu Jan 16, 2014 11:08 am
by aymanh
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

Re: Marker or point location in API

Posted: Tue Jan 21, 2014 6:54 am
by erikdijkstra
Hi Ayman,

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


Best regards,
Erik