use plugins with GUI scripting / MATLAB

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Wietse van Dijk
Posts: 2
Joined: Sun Sep 20, 2015 12:45 pm

use plugins with GUI scripting / MATLAB

Post by Wietse van Dijk » Sun Sep 20, 2015 12:50 pm

Hi,

I made a plugin for a new joint type (CustomJointFilter). I can load the plugin in OpenSim (Tools -> User Plugins -> CustomJointFilterPlugin) and I can load models that contain this new joint type in OpenSim. So far so good.

I would also like to make new joints with GUI scripting or Matlab, but I’m not able to do this so far. I tried this:

[GUI]
>>> j = modeling.CustomJointFilter
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: 'javapackage' object has no attribute 'CustomJointFilter'

[MATLAB]
>> j = CustomJointFilter
Undefined function or variable 'CustomJointFilter'.

I would also like to do this for a Tool plugin. So do something like:
myTool = myNewTool(‘myNewToolSettings.xml’)
myTool.run

Maybe I did overlook something. Any help is welcome.
Wietse

User avatar
Ayman Habib
Posts: 2238
Joined: Fri Apr 01, 2005 12:24 pm

Re: use plugins with GUI scripting / MATLAB

Post by Ayman Habib » Mon Sep 21, 2015 12:48 pm

Hi,

Our current plugin mechanism is intended for users writing C++ plugins. Classes defined in a plugin are not accessible through the scripting layer (Matlab or GUI). If you load the plugin (e.g. using System.LoadLibrary) then the classes will be available for use/reading/writing but not through scripting basically because the types defined in the plugin are not known to the corresponding interpreter. You can only use the Properties interface assuming your Class derives from OpenSim::Object, which is what the GUI and serialization code does.

We'll try to make this process easier in upcoming releases but for now what you're trying to accomplish is not supported.

Hope this helps,
-Ayman

User avatar
Wietse van Dijk
Posts: 2
Joined: Sun Sep 20, 2015 12:45 pm

Re: use plugins with GUI scripting / MATLAB

Post by Wietse van Dijk » Wed Sep 23, 2015 9:13 am

Hi Ayman,

Thank you for your answer. I’ll try to solve it in a different way. I might come back with a follow up.

Best,

Wietse

POST REPLY