getLocation() Matlab API bug

The 2018 Fall Virtual Workshop will bring together a group of international scholars and OpenSim experts to help each other advance their research using modeling and simulation. This forum is a place to accelerate OpenSim based projects while also buildin
POST REPLY
User avatar
Russell Hardesty
Posts: 3
Joined: Thu Feb 05, 2015 10:51 am

getLocation() Matlab API bug

Post by Russell Hardesty » Wed Oct 24, 2018 9:30 am

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.

User avatar
Thomas Uchida
Posts: 1793
Joined: Wed May 16, 2012 11:40 am

Re: getLocation() Matlab API bug

Post by Thomas Uchida » Wed Oct 24, 2018 10:03 am

The getLocation() method requires a State as an argument, which you are not providing. https://simtk.org/api_docs/opensim/api_ ... 46bf803b68

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

Re: getLocation() Matlab API bug

Post by Ayman Habib » Wed Oct 24, 2018 10:05 am

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

User avatar
Russell Hardesty
Posts: 3
Joined: Thu Feb 05, 2015 10:51 am

Re: getLocation() Matlab API bug

Post by Russell Hardesty » Wed Oct 24, 2018 10:48 am

RESOLVED:

That worked guys. Thank you very much.

POST REPLY