Easy way to create Task.xml and Actuators.xml for a model
- Neethan Ratnakumar
- Posts: 8
- Joined: Wed Aug 14, 2019 1:35 pm
Easy way to create Task.xml and Actuators.xml for a model
Hi,
I am new to openSim and want to try out CMC with new models.
Is there any easy way to create the Task.xml and Actuators.xml files for a model, which can be then used for a CMC or RRA? Or do they have to be created manually each time?
Maybe, is there a script available?
Thank you.
I am new to openSim and want to try out CMC with new models.
Is there any easy way to create the Task.xml and Actuators.xml files for a model, which can be then used for a CMC or RRA? Or do they have to be created manually each time?
Maybe, is there a script available?
Thank you.
Tags:
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: Easy way to create Task.xml and Actuators.xml for a model
Typically, you can borrow and adapt the already existing files (e.g., from gait2392) for your model. Alternatively, you can write a script to automate this process. There are not any publicly available.
- Neethan Ratnakumar
- Posts: 8
- Joined: Wed Aug 14, 2019 1:35 pm
Re: Easy way to create Task.xml and Actuators.xml for a model
Thank you so much for your kind reply.
Can you please suggest me a document or any web link which talks about the xml files in detail? I have few doubts about what the weights and tracking coordinates physically mean in the Task.xml files. Also, I am not much clear about the requirement of additional actuators.
Also how do I ensure that my xml files have no errors?
Thank you again for your answer.
Can you please suggest me a document or any web link which talks about the xml files in detail? I have few doubts about what the weights and tracking coordinates physically mean in the Task.xml files. Also, I am not much clear about the requirement of additional actuators.
Also how do I ensure that my xml files have no errors?
Thank you again for your answer.
Re: Easy way to create Task.xml and Actuators.xml for a model
Future releases will include a matlab script for creating an actuators file. For now, you can find it here
- Neethan Ratnakumar
- Posts: 8
- Joined: Wed Aug 14, 2019 1:35 pm
Re: Easy way to create Task.xml and Actuators.xml for a model
Thank you so much.
regards
Neethan
regards
Neethan
- RAHUL GHARATE
- Posts: 84
- Joined: Thu Jun 13, 2019 11:43 pm
Re: Easy way to create Task.xml and Actuators.xml for a model
Respected Sir,
I have a tried a lot but don't get it how to provide actuator to the gait2354 model. So please tell me briefly.
Please help me.
I have a tried a lot but don't get it how to provide actuator to the gait2354 model. So please tell me briefly.
Please help me.
- Evaa Martin
- Posts: 1
- Joined: Tue Sep 24, 2019 2:26 am
Re: Easy way to create Task.xml and Actuators.xml for a model
Thank you. It is helpful. I'd like to try it
Re: Easy way to create Task.xml and Actuators.xml for a model
This is helpful for me too and thanks for sharing this code. I have a simple question: after creating this actuator ForceSet and saving it to an XML file '..._actuator.xml', how do I load it back into Matlab workspace later (in v4.0 API) ? Previously in v3.3, I used the syntax 'ForceSet(model,full_file_name)' to import a ForceSet from XML, but it seems such syntax has gone away in v4.0. What is the new way to load a previously saved actuator set from XML? Thanks.
Re: Easy way to create Task.xml and Actuators.xml for a model
Perhaps the constructor changed and takes different augments. It looks like you are trying to pass a Model object and a file path, in 4.0 the ForceSet takes just a file path to a ForceSet file and it seems to work fine.
interfaces to classes often change between versions so it is handy to be able to figure out what the interface is. There is API documentation for each of the classes and you can use the methodsview() function in Matlab.
Code: Select all
import org.opensim.modeling.*
% Generaate ForceSet file (.xml)
createActuatorsFile('gait2392_simbody.osim');
% Define the name of the ForceSet file (.xml)
filename = 'gait2392_simbody_actuators.xml';
% Construct a ForceSet from the the ForceSet file.
fn = ForceSet(filename);
interfaces to classes often change between versions so it is handy to be able to figure out what the interface is. There is API documentation for each of the classes and you can use the methodsview() function in Matlab.
Re: Easy way to create Task.xml and Actuators.xml for a model
Hi James,jimmy wrote: ↑Tue Sep 24, 2019 9:37 amPerhaps the constructor changed and takes different augments. It looks like you are trying to pass a Model object and a file path, in 4.0 the ForceSet takes just a file path to a ForceSet file and it seems to work fine.
Code: Select all
import org.opensim.modeling.* % Generaate ForceSet file (.xml) createActuatorsFile('gait2392_simbody.osim'); % Define the name of the ForceSet file (.xml) filename = 'gait2392_simbody_actuators.xml'; % Construct a ForceSet from the the ForceSet file. fn = ForceSet(filename);
interfaces to classes often change between versions so it is handy to be able to figure out what the interface is. There is API documentation for each of the classes and you can use the methodsview() function in Matlab.
Thanks for the response. I tried only passing the actuator file path (a character string) in ForceSet but it did not work for me, instead an error was thrown: "No constructor 'org.opensim.modeling.ForceSet' with matching signature found." I checked methodsview of ForceSet and this was what I saw:
Apparently solely passing a file path String was not an option; the only available ForceSet constructor other than the default () was to pass in a long and a boolean parameter, which I am not sure how to use. Any idea why this happens? I am using the Matlab API with OpenSim version 4.0. Thanks again for the help!