Search found 81 matches

by David John Saxby
Thu Mar 14, 2013 6:55 pm
Forum: OpenSim
Topic: Performing Inverse Dynamics via Matlab API
Replies: 30
Views: 10215

Re: Performing Inverse Dynamics via Matlab API

Hi Ayman, Generally yes, it would be quite useful to be able to modify these properties of the external loads file through the API. I tried via matlab parsing, but as you pointed out quite rightly this messes us the xml file and then it is not handled by the API or GUI. So trying to avoid manually c...
by David John Saxby
Wed Mar 13, 2013 7:53 pm
Forum: OpenSim
Topic: Performing Inverse Dynamics via Matlab API
Replies: 30
Views: 10215

Performing Inverse Dynamics via Matlab API

Hi All, I'm working on Matlab scripts which will use the API to setup and run ID for x number of trials in v3.0.1. I use a setupID.xml template, which functionally empty (model and file are unassigned), with the exception of the external loads xml file, which I have to generic templates based on a l...
by David John Saxby
Mon Mar 11, 2013 1:21 am
Forum: OpenSim
Topic: Scaling with coordinate data for static pose
Replies: 5
Views: 1145

Re: Scaling with coordinate data for static pose

Hi, If you take a look at the example matlab scripts in the release. On my computer: C:\OpenSim 3.0\sdk\Matlab\prescribeMotionInModel.m In this function you provide a model, an sto file containing your joint angles (from some external source), and outputs a model with a corresponding set of angles. ...
by David John Saxby
Mon Mar 11, 2013 1:13 am
Forum: OpenSim
Topic: Scripting in Matlab for Scaling of Model
Replies: 8
Views: 1522

Re: Scripting in Matlab for Scaling of Model

Hey Guys, Solution! I thought the scaleTool had a run method due to an assumption on my part. I thought scaleTool was a member of Tool, similar to InverseKinematicsTool and DynamicsTool. Not so. Check the class hierarchy. To execute the scale operation the method is process model scaler, not run or ...
by David John Saxby
Mon Mar 11, 2013 1:02 am
Forum: OpenSim
Topic: Scaling with coordinate data for static pose
Replies: 5
Views: 1145

Re: Scaling with coordinate data for static pose

Hi,

I think many people have tried to use a coordinate file, but run into some trouble along the way.

Maybe it is best to apply the coordinates directly to the model via the API, then run the scaling commands?

David
by David John Saxby
Tue Mar 05, 2013 6:30 pm
Forum: OpenSim
Topic: Scripting in Matlab for Scaling of Model
Replies: 8
Views: 1522

Re: Scripting in Matlab for Scaling of Model

Hey Guys, Thought I would share my solution up to this point. Earlier in this thread, I didn't realize the time range needed to be an array double and not an integer. So I first define the range: % From the trc file initial_time = markerData.getStartFrameTime(); final_time = markerData.getLastFrameT...
by David John Saxby
Sun Mar 03, 2013 8:03 pm
Forum: OpenSim
Topic: Scripting in Matlab for Scaling of Model
Replies: 8
Views: 1522

Re: Scripting in Matlab for Scaling of Model

Hello again, So I could get the scaleTool.getModelScaler().setTimeRange to work. I don't know if I'm just using this method incorrectly, or if there is something wrong with its current state. I hard coded the time range in the template xml, so unless I have files shorter than 0-0.1 seconds I think I...
by David John Saxby
Tue Feb 26, 2013 7:35 pm
Forum: OpenSim
Topic: Scripting in Matlab for Scaling of Model
Replies: 8
Views: 1522

Re: Scripting in Matlab for Scaling of Model

Sorry one more, Time range for scaling in my generic setup file is empty, as I plan to change this value depending on file length. I suppose I could hard code if there is not a programmatic solution. scaleTool.getModelScaler().setTimeRange(final_time - initial_time) ??? No method 'setTimeRange' with...
by David John Saxby
Tue Feb 26, 2013 7:03 pm
Forum: OpenSim
Topic: Scripting in Matlab for Scaling of Model
Replies: 8
Views: 1522

Re: Scripting in Matlab for Scaling of Model

Hi Ayman,

Thanks a lot!

I'll finish this code and re-up to your site. We have a clinical gait analysis group within the SimTk site, which will be the future repository and distributor for some code.

In the short run, any convenient place to deposit this script?

David
by David John Saxby
Tue Feb 26, 2013 5:02 pm
Forum: OpenSim
Topic: Not Obtaining New Mass Distribution When Scaling
Replies: 5
Views: 664

Re: Not Obtaining New Mass Distribution When Scaling

Stephen, If you go the link below you'll find code developed by Tim Dorn (maybe extended based on other work, don't know the legacy of the code). https://simtk.org/project/xml/downloads.xml?group_id=433#package_id851 These functions allow you to read in Osim models into Matlab and edit the component...