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
Launch Point Kinematics Tool from Matlab
- Carlo Tricarico
- Posts: 21
- Joined: Mon Jul 29, 2013 8:21 am
- Ayman Habib
- Posts: 2248
- Joined: Fri Apr 01, 2005 12:24 pm
Re: Launch Point Kinematics Tool from Matlab
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
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
- Carlo Tricarico
- Posts: 21
- Joined: Mon Jul 29, 2013 8:21 am
Re: Launch Point Kinematics Tool from Matlab
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
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
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
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
- Carlo Tricarico
- Posts: 21
- Joined: Mon Jul 29, 2013 8:21 am
Re: Launch Point Kinematics Tool from Matlab
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
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
- David John Saxby
- Posts: 83
- Joined: Mon May 09, 2011 8:39 pm
Re: Launch Point Kinematics Tool from Matlab
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
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
- Carlo Tricarico
- Posts: 21
- Joined: Mon Jul 29, 2013 8:21 am
Re: Launch Point Kinematics Tool from Matlab
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
Regards
-Carlo
- Carlo Tricarico
- Posts: 21
- Joined: Mon Jul 29, 2013 8:21 am
Re: Launch Point Kinematics Tool from Matlab
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
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