Page 1 of 1
Launch Point Kinematics Tool from Matlab
Posted: Wed Oct 30, 2013 7:37 am
by chass
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
Re: Launch Point Kinematics Tool from Matlab
Posted: Wed Oct 30, 2013 9:40 am
by aymanh
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
Re: Launch Point Kinematics Tool from Matlab
Posted: Thu Oct 31, 2013 4:13 am
by chass
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
Re: Launch Point Kinematics Tool from Matlab
Posted: Thu Oct 31, 2013 8:39 am
by jimmy
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
Re: Launch Point Kinematics Tool from Matlab
Posted: Fri Nov 01, 2013 2:09 am
by chass
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
. I'll continue to try my best though.
Regards
-Carlo
Re: Launch Point Kinematics Tool from Matlab
Posted: Fri Nov 01, 2013 2:46 pm
by saxbyd
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
Re: Launch Point Kinematics Tool from Matlab
Posted: Sat Nov 02, 2013 10:31 am
by chass
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
Regards
-Carlo
Re: Launch Point Kinematics Tool from Matlab
Posted: Sun Nov 17, 2013 8:21 am
by chass
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