Page 2 of 2

Re: Easy way to create Task.xml and Actuators.xml for a model

Posted: Wed Sep 25, 2019 8:03 am
by jimmy
Hi, Ke-

The code I posted above was using the latest development version of OpenSim, so I didn't have your issue. I went back and tested the 4.0 version and saw the issue that you are describing. We obviously didn't catch this bug when we released, but it was subsequently fixed during a different overhaul.

As of now, you won't be able to construct a ForceSet from a force set file (.xml) in Matlab. One workaround you could do is to modify the createActuatorsFile.m file so it returns a ForceSet object (as well as printing to file). I have attached a version of the Matlab function that does that. You could then make modifications to the ForceSet object in memory and re-print.

Code: Select all

% Construct a ForceSet object from a Model. 
forceset = createActuatorsFile_ReturnForceSet(path2Model)

% Make modifications to the ForceSet
...

% Write to file
forceset.print('path2writeFile.xml')
Again, this bug has seemed to be fixed in 4.1, which will be released soon.

Thanks,
-J

Re: Easy way to create Task.xml and Actuators.xml for a model

Posted: Wed Sep 25, 2019 8:56 am
by ksopensim
Thank you for explaining this and the suggested workaround, very appreciated! - Ke