I have been working through a couple of the sdk examples in OpenSim 3.0 and have been having trouble compiling the BodyDrag example in the ForcePluginExample folder. All of the issues seem to be coming from the Force.h file. Could anybody point me in the right direction with this one please?
C:\OpenSim 3.0\sdk\APIExamples\Plugin\ForcePluginExample\BodyDrag.cpp(99): error C2259: 'OpenSim::BodyDrag' : cannot instantiate abstract class due to following members:
'OpenSim::Force *OpenSim::Force::clone(void) const' : is abstract
C:/OpenSim 3.0/sdk/include\OpenSim/Simulation/Model/Force.h(49) : see declaration of 'OpenSim::Force::clone'
'const std::string &OpenSim::Force::getConcreteClassName(void) const' : is abstract
C:/OpenSim 3.0/sdk/include\OpenSim/Simulation/Model/Force.h(49) : see declaration of 'OpenSim::Force::getConcreteClassName'
C:\OpenSim 3.0\sdk\APIExamples\Plugin\ForcePluginExample\BodyDrag.cpp(110): error C2248: 'OpenSim::Force::copyData' : cannot access private member declared in class 'OpenSim::Force'
C:/OpenSim 3.0/sdk/include\OpenSim/Simulation/Model/Force.h(221) : see declaration of 'OpenSim::Force::copyData'
C:/OpenSim 3.0/sdk/include\OpenSim/Simulation/Model/Force.h(48) : see declaration of 'OpenSim::Force'
C:\OpenSim 3.0\sdk\APIExamples\Plugin\ForcePluginExample\BodyDrag.cpp(122): error C3861: 'setType': identifier not found
C:\OpenSim 3.0\sdk\APIExamples\Plugin\ForcePluginExample\BodyDrag.cpp(157): error C2039: 'setup' : is not a member of 'OpenSim::Force'
C:/OpenSim 3.0/sdk/include\OpenSim/Simulation/Model/Force.h(48) : see declaration of 'OpenSim::Force'
RegisterTypes_osimPlugin.cpp
C:\OpenSim 3.0\sdk\APIExamples\Plugin\ForcePluginExample\RegisterTypes_osimPlugin.cpp(42): error C2259: 'OpenSim::BodyDrag' : cannot instantiate abstract class due to following members:
'OpenSim::Force *OpenSim::Force::clone(void) const' : is abstract
C:/OpenSim 3.0/sdk/include\OpenSim/Simulation/Model/Force.h(49) : see declaration of 'OpenSim::Force::clone'
'const std::string &OpenSim::Force::getConcreteClassName(void) const' : is abstract
C:/OpenSim 3.0/sdk/include\OpenSim/Simulation/Model/Force.h(49) : see declaration of 'OpenSim::Force::getConcreteClassName'
Error building the ForcePluginExample in OpenSim 3.0
- Moe Curtin
- Posts: 43
- Joined: Fri Oct 02, 2009 5:40 am
- Ayman Habib
- Posts: 2248
- Joined: Fri Apr 01, 2005 12:24 pm
Re: Error building the ForcePluginExample in OpenSim 3.0
Hi Moe,
Sorry about that but this API example, packaged with the release, needs update to match the latest API changes. We'll be putting an updated set of examples on the downloads page shortly.
Best regards,
-Ayman
Sorry about that but this API example, packaged with the release, needs update to match the latest API changes. We'll be putting an updated set of examples on the downloads page shortly.
Best regards,
-Ayman
- Moe Curtin
- Posts: 43
- Joined: Fri Oct 02, 2009 5:40 am
Re: Error building the ForcePluginExample in OpenSim 3.0
Thanks Ayman!
- Benjamin Johnson
- Posts: 5
- Joined: Thu Feb 07, 2013 3:11 pm
Re: Error building the ForcePluginExample in OpenSim 3.0
I'm having a problem where it can't find the include files in OpenSim/Simulation/... Have new examples been posted recently? I downloaded OpenSim 3.0 in January.
Thanks
Thanks
Last edited by Benjamin Johnson on Fri Mar 15, 2013 1:35 pm, edited 1 time in total.
- Ayman Habib
- Posts: 2248
- Joined: Fri Apr 01, 2005 12:24 pm
Re: Error building the ForcePluginExample in OpenSim 3.0
Hi Benjamin,
We updated the examples with the source release, and they should be updated in version 3.0.1 available in beta form. Please give it a spin and let us know how it goes so we can fix any problems, if any, before the official release.
Best regards,
-Ayman
We updated the examples with the source release, and they should be updated in version 3.0.1 available in beta form. Please give it a spin and let us know how it goes so we can fix any problems, if any, before the official release.
Best regards,
-Ayman
- Benjamin Johnson
- Posts: 5
- Joined: Thu Feb 07, 2013 3:11 pm
Re: Error building the ForcePluginExample in OpenSim 3.0
I downloaded 3.0.1, and things mostly work. The plugin compiles and loads into the GUI without a problem. If I do the forward dynamics from the GUI things work fine and agree with the expected results. When I run from the command line, it acts like it hasn't loaded the plugin and says 'BodyDragForce' is not a registered object. From the command line execution:
C:\OpenSim 3.0.1\sdk\APIExamples\Plugin\ForcePluginExample\TestPlugin\Example1_ThreeMasses>forward -L BodyDrag -S forward.xml
Failed to load library BodyDrag
ERROR- library BodyDrag could not be loaded.
Constructing tool from setup file forward.xml.
AbstractTool Three Masses loading model 'ThreeMasses.osim'
Object::newInstanceOfType(): object type 'BodyDragForce' is not a registered Obj
ect!
Object type BodyDragForce not recognized
Object::newInstanceOfType(): object type 'BodyDragForce' is not a registered Obj
ect!
Object type BodyDragForce not recognized
Object::newInstanceOfType(): object type 'BodyDragForce' is not a registered Obj
ect!
Object type BodyDragForce not recognized
Loaded model Three Masses from file ThreeMasses.osim
-----------------------------------------------------------------------
Running tool Three Masses.
No external loads will be applied (external loads file not specified).
MODEL: Three Masses
ANALYSES (1)
...
Integrating from 0 to 20
Printing results of investigation Three Masses to ..
Forward simulation time = 100ms
C:\OpenSim 3.0.1\sdk\APIExamples\Plugin\ForcePluginExample\TestPlugin\Example1_ThreeMasses>forward -L BodyDrag -S forward.xml
Failed to load library BodyDrag
ERROR- library BodyDrag could not be loaded.
Constructing tool from setup file forward.xml.
AbstractTool Three Masses loading model 'ThreeMasses.osim'
Object::newInstanceOfType(): object type 'BodyDragForce' is not a registered Obj
ect!
Object type BodyDragForce not recognized
Object::newInstanceOfType(): object type 'BodyDragForce' is not a registered Obj
ect!
Object type BodyDragForce not recognized
Object::newInstanceOfType(): object type 'BodyDragForce' is not a registered Obj
ect!
Object type BodyDragForce not recognized
Loaded model Three Masses from file ThreeMasses.osim
-----------------------------------------------------------------------
Running tool Three Masses.
No external loads will be applied (external loads file not specified).
MODEL: Three Masses
ANALYSES (1)
...
Integrating from 0 to 20
Printing results of investigation Three Masses to ..
Forward simulation time = 100ms
- Ayman Habib
- Posts: 2248
- Joined: Fri Apr 01, 2005 12:24 pm
Re: Error building the ForcePluginExample in OpenSim 3.0
Hi Benjamin,
The problem is that the dll BodyDrag could not be located. Since the dll/shared-library is not located, the object defined in this library is not recognized and that explains the problems you reported downstream. You can work around this in two possible ways:
1. use the full path after the -L option (recommended)
2. Add the directory where the dll is located to your Path environment variable.
Thanks for testing and please let us know if that resolves your problem.
Best regards,
-Ayman
The problem is that the dll BodyDrag could not be located. Since the dll/shared-library is not located, the object defined in this library is not recognized and that explains the problems you reported downstream. You can work around this in two possible ways:
1. use the full path after the -L option (recommended)
2. Add the directory where the dll is located to your Path environment variable.
Thanks for testing and please let us know if that resolves your problem.
Best regards,
-Ayman
- Benjamin Johnson
- Posts: 5
- Joined: Thu Feb 07, 2013 3:11 pm
Re: Error building the ForcePluginExample in OpenSim 3.0
I used option 1 and it worked.
Thanks,
-Ben
Thanks,
-Ben