Hi,
I have created a new component which is a new kind of actuator. I have tested it by create new model using it in main() program with VS C++.
Now, I would like to create a plugin (.dll and .lib) files for my component. I have followed the template for analyses plugin example provided by OpenSim. I am able to build and create .dll and .lib. After I loaded my plugin into GUI, then when I tried to open a .osim model that uses my component, I am not able to open the file.
I guess there could be 2 reasons: either my project of creating plugin is not correct, or my .osim model is not correct.
For the first reason, I wonder are there any differences between creating a plugin for analysis tool and new component which is actuator?
For the second reason, could you suggest a way to use and test my component (use .dll or .lib file in Matlab or GUI)?
Thank you in advance,
Vinh
Create Plugin for new component
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: Create Plugin for new component
What is the error that you get?
You can test if the new actuator is serialized correctly by loading the .osim model in your main, and not add the new actuator programmatically.
You can test if the new actuator is serialized correctly by loading the .osim model in your main, and not add the new actuator programmatically.
- Vinh Nguyen
- Posts: 21
- Joined: Fri Sep 26, 2014 8:53 pm
Re: Create Plugin for new component
=> When I loaded model in GUI, it just kept showing "Loading model file ...".What is the error that you get?
=>I have tried to load the .osim model in my main.Then run the .exe file. The error I got isYou can test if the new actuator is serialized correctly by loading the .osim model in your main, and not add the new actuator programmatically
".. object type 'ElectricActuator' is not a registered Object!.." (attached picture)
- Attachments
-
- ErrorLoadingModel.PNG (10.7 KiB) Viewed 224 times
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: Create Plugin for new component
If you look into the AnalysisPluginExample, you will find the RegisterTypes_osimPlugin*. You have to register the new component so that OpenSim will know what your custom actuator type is during xml parsing. In the main file you can register it through before loading the model. As for the GUI plugin you need to supply the RegisterTypes_*.
Code: Select all
Object::RegisterType( AnalysisPlugin_Template()) ;
- Vinh Nguyen
- Posts: 21
- Joined: Fri Sep 26, 2014 8:53 pm
Re: Create Plugin for new component
Thank you very much, it works with GUI now. I am trying to test with Matlab.
Best,
Vinh
Best,
Vinh