Launch Point Kinematics Tool from Matlab

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Carlo Tricarico
Posts: 21
Joined: Mon Jul 29, 2013 8:21 am

Launch Point Kinematics Tool from Matlab

Post by Carlo Tricarico » Wed Oct 30, 2013 7:37 am

Hello Everybody,
does anybody know if and how can I manage to launch a Point Kinematics analysis from Matlab? I was able to find a script where an Analyze tool is launched but I don't think that it perfectly fits my needs.

Thanks for your help

Carlo

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

Re: Launch Point Kinematics Tool from Matlab

Post by Ayman Habib » Wed Oct 30, 2013 9:40 am

Hi Carlo,

PointKinematics is just another analysis that you need to run through the AnalyzeTool which processes full trajectories, so you should follow the example you have for using AnalyzeTool from Matlab, just add a PointKinematics analysis to the tool and configure it to report the quantities of interest to you.

Please let us know if you have a question regarding how to setup the PointKinematics analysis.

Best regards,
-Ayman

User avatar
Carlo Tricarico
Posts: 21
Joined: Mon Jul 29, 2013 8:21 am

Re: Launch Point Kinematics Tool from Matlab

Post by Carlo Tricarico » Thu Oct 31, 2013 4:13 am

Hi Ayman,
that's exactly my problem: I don't know neither what should I write to launch Point Kinematics from Matlab nor what it needs to run properly.

Thanks for your help

Carlo

User avatar
jimmy d
Posts: 1375
Joined: Thu Oct 04, 2007 11:51 pm

Re: Launch Point Kinematics Tool from Matlab

Post by jimmy d » Thu Oct 31, 2013 8:39 am

Hi Carlo,
The documentation for both AnalyzeTool() and PointKinematics() can be found on doxygen. The best way I have found to understand the hierarchy and structure is to look up the tag names in an example xml and relate them to the doxygen documentation.

In the mean time, the easiest way to construct an AnalyzeTool() object with PointKinematics() attached is to construct it from an existing example. If you have downloaded the point kinematic example package (http://simtk-confluence.stanford.edu:80 ... cs+Example), you will see an analyze setup example xml (analyzePointKinematicsPendulum.xml).

you can write something like this:
...
filename='C:\OpenSim 3.1\Models\PendulumExample\analyzePointKinematicsPendulum.xml'
analyzeTool = AnalyzeTool(filename) % construct an analyzeTool object from file
pointKinematicsObject=analyzeTool ().getAnalysisSet().get('PointKinematics') % get a handle to PK object
....
Note: You will need to edit all variables to be specific for your data and models. You may want to do this in the xml file before hand.

Once you have that all setup correctly you execute by using 'analyzeTool .run()' command.

hope that helps,
-james

User avatar
Carlo Tricarico
Posts: 21
Joined: Mon Jul 29, 2013 8:21 am

Re: Launch Point Kinematics Tool from Matlab

Post by Carlo Tricarico » Fri Nov 01, 2013 2:09 am

Hi James,
thanks for your help, it's been useful at least for understand how things should be done; nevertheless I can't really understand how to get infos from the Doxygen :oops: . I'll continue to try my best though.

Regards
-Carlo

User avatar
David John Saxby
Posts: 83
Joined: Mon May 09, 2011 8:39 pm

Re: Launch Point Kinematics Tool from Matlab

Post by David John Saxby » Fri Nov 01, 2013 2:46 pm

Carlo,

Try James' point whereby you look in the xml file for the corresponding operation (i.e Point Kinematics operation within general Analyze Tool) and took at the tags and their names. If you then look up/search the name in the doxygen you will likely find the corresponding command (get/set, etc...) embedded within the hierarchy. I'm not sure this works in all cases because I believe there was some discontinues between the xml names and the API commands for the scale tool.

Best,

David

User avatar
Carlo Tricarico
Posts: 21
Joined: Mon Jul 29, 2013 8:21 am

Re: Launch Point Kinematics Tool from Matlab

Post by Carlo Tricarico » Sat Nov 02, 2013 10:31 am

Thanks everybody for your help but still I can't manage to solve my problem: the tips James gave me didn't work on my matlab, and still I cannot figure out how to read the Doxygen. I think I will have to continue implement my studies from OpenSim :roll:

Regards
-Carlo

User avatar
Carlo Tricarico
Posts: 21
Joined: Mon Jul 29, 2013 8:21 am

Re: Launch Point Kinematics Tool from Matlab

Post by Carlo Tricarico » Sun Nov 17, 2013 8:21 am

With your help and a lot of efforts I've finally managed to launch my analysis from Matlab, thanks a lot to everybody.
Now I have another question: is it possible in some way to "command" OpenSim from the command window of Matlab? I mean open the software, load a model, load a motion and so on?

Thank you in advance
-Carlo

POST REPLY