Page 1 of 1

getLocation() Matlab API bug

Posted: Wed Oct 24, 2018 9:30 am
by russh26
I'm attempting to pull my model's muscle pathpoint locations using the Matlab API, but it keeps displaying an error as though that function is not appropriate for the AbstractPathPoints class.

My syntax is as follows
hModel = Model([sModelPath sModelFile]);
hModel.getMuscles.get(0).getGeometryPath.getPathPointSet.get(0).getLocation;

The getLocation function appears both when I query available methods for the class in Matlab as well as the online documentation:

https://simtk.org/api_docs/opensim/api_ ... Point.html

Also I can successfully pull the muscle pathpoint's name (using getName) and the class is properly displayed as AbstractPathPoint using the getClass function.

This script had previously worked in OpenSim 3.3 using the getLocationCoord method for the same class. We are now using 4.0.

Thanks.

Re: getLocation() Matlab API bug

Posted: Wed Oct 24, 2018 10:03 am
by tkuchida
The getLocation() method requires a State as an argument, which you are not providing. https://simtk.org/api_docs/opensim/api_ ... 46bf803b68

Re: getLocation() Matlab API bug

Posted: Wed Oct 24, 2018 10:05 am
by aymanh
Hi Russel,

getLocation method takes a state object as an rgument now. Also note that the method is on base class and may not be implemented for some types of PathPoints. This is a change from 3.3 API.

Hope this helps,
-Ayman

Re: getLocation() Matlab API bug

Posted: Wed Oct 24, 2018 10:48 am
by russh26
RESOLVED:

That worked guys. Thank you very much.