Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin not found: "CosseratPlugin" #53

Open
0707yiliu opened this issue Nov 8, 2022 · 11 comments
Open

Plugin not found: "CosseratPlugin" #53

0707yiliu opened this issue Nov 8, 2022 · 11 comments

Comments

@0707yiliu
Copy link

I‘m trying to add this plugin into the SofaGym-CartStemContactScene.
When I import it into sofa without using the test selection, it's working.

And Using the SofaGym test_env.py to make env, it would feedback the error like:

[ERROR] [RequiredPlugin(SofaPlugins)] Plugin not found: "CosseratPlugin"

Failed to load: ["CosseratPlugin"]

Init cartstem_config...
Init CartStem...
[ERROR] [SofaRuntime] ValueError: Object type BeamHookeLawForceField<> was not created
The object is not in the factory.

Traceback (most recent call last):
File "/home/yi/peg_in_hole/SofaGym/sofagym/env/common/rpc_client.py", line 178, in
root = init_simulation(config, _startCmd, mode='simu')
File "/home/yi/peg_in_hole/SofaGym/sofagym/env/common/../../../sofagym/env/common/simulate.py", line 50, in init_simulation
create_scene(root, config, mode = mode)
File "/home/yi/peg_in_hole/SofaGym/sofagym/env/common/../../../sofagym/env/CartStemContact/CartStemContactScene.py", line 68, in createScene
cartstem.onEnd(rootNode)
File "/home/yi/peg_in_hole/SofaGym/sofagym/env/common/../../../sofagym/env/CartStemContact/CartStemContact.py", line 55, in onEnd
self.path = cosserat(self.cartstem, path_config, name="Path", orientation=[0, 0, 0, 1], radius=0.5)
File "/home/yi/peg_in_hole/SofaGym/sofagym/env/common/../../../sofagym/env/CartStemContact/../common/utils.py", line 136, in createCosserat
BeamHookeLawForce = rateAngularDeformNode.addObject('BeamHookeLawForceField',

Exception in thread Thread-2:

@alxbilger
Copy link
Member

Hi @0707yiliu,

you did not mention if you already have CosseratPlugin or not. It's an external plugin, so it does not come with Sofa. You need to compile it or get the binaries.

@0707yiliu
Copy link
Author

Yes, I have import the plugin into sofa, and using the cmake-gui to make the whole sofa like:

Adding plugin ArticulatedSystemPlugin
SofaPython3 is compiled as a subproject to the external project 'Sofa'.
Adding plugin SofaPython3
Python:
Version: 3.9.12
Executable: /home/yi/anaconda3/envs/peginhole/bin/python3.9
Headers: /home/yi/anaconda3/envs/peginhole/include/python3.9
Libraries: /home/yi/anaconda3/envs/peginhole/lib/libpython3.9.so
User site: /root/.local/lib/python3.9/site-packages
pybind11:
Version: 2.9.1
Config: /usr/lib/cmake/pybind11/pybind11Config.cmake
Adding binding module SofaBaseTopology
Adding binding module SofaDeformable
Adding binding module SofaLinearSolver
Adding binding module SofaConstraintSolver
Adding binding module SofaGL
Adding plugin SofaMatrix
Adding plugin BeamAdapter
Install prefix: /home/yi/sofa/build/v22.06/applications/plugins/plugin.Cosserat/install/CosseratPlugin
Adding plugin STLIB
Install prefix: /home/yi/sofa/build/v22.06/applications/plugins/STLIB/install/STLIB
Adding plugin SoftRobots
Install prefix: /home/yi/sofa/build/v22.06/applications/plugins/STLIB/install/STLIB
-- Found dependency : 'STLIB' plugin .
Adding plugin CosseratPlugin
Install prefix: /home/yi/sofa/build/v22.06/applications/plugins/plugin.Cosserat/install/CosseratPlugin
-- Found dependency : 'STLIB' plugin .
-- Found dependency: 'SoftRobots' plugin.
-- Python3 packages will be installed.
Adding application SceneChecking
Adding application runSofa
Write Plugin list at /home/yi/sofa/build/v22.06/lib/plugin_list.conf.default
Configuring done
CMake Warning at /usr/share/cmake-3.22/Modules/FindPython/Support.cmake:3330 (add_library):
Cannot generate a safe runtime search path for target Bindings.SofaExporter
because files in some directories may conflict with libraries in implicit
directories:

runtime library [libz.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/yi/anaconda3/envs/peginhole/lib

Some of these libraries may not be found correctly.
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/FindPython.cmake:580 (__Python_add_library)
applications/plugins/SofaPython3/CMake/SofaPython3Tools.cmake:125 (python_add_library)
applications/plugins/SofaPython3/bindings/SofaExporter/CMakeLists.txt:18 (SP3_add_python_module)

Generating done

@0707yiliu
Copy link
Author

Hi, @alxbilger , one more thing I need to said that my system is Ubuntu22 and python3.9, I'm not sure whether it would produce bug or not.

@alxbilger
Copy link
Member

Do you see the binary of the plugin in your build directory? It's the folder where you have the runSofa executable

@0707yiliu
Copy link
Author

Do you see the binary of the plugin in your build directory? It's the folder where you have the runSofa executable

Hi, @alxbilger .
Do you means the CosseratPlugin's binary file? I installed the git-source file into sofa/src/applications/plugins/.

@alxbilger
Copy link
Member

Yes, the binary file of the Cosserat plugin. It should be in bin, in your build folder.

@0707yiliu
Copy link
Author

Hi, @alxbilger

I can not see any binary file about the Cosserat Plugin in this dir: build/v22.06/bin, which has runSofa and some plugins'test file such as BeamAdapter_test.

@alxbilger
Copy link
Member

That is why SOFA cannot find the plugin. Check that you do compile the plugin.

@0707yiliu
Copy link
Author

It's weird, I can see the plugin has been imported into sofa in cmake-gui. But I can not see it in build/lib or build/bin

@0707yiliu
Copy link
Author

Updating...

the plugin has working, but the .so file (binary file) is generated in build/application/plugins dir, I copied it to build/lib dir which makes the sofa can search the plugin.

Second, the plugin's src/config and src/init file may has some problem? (I modified the project name to real name XXXplugin instead of @PROJECT_NAME@, otherwise, the sofa would get the plugin name like "@PROJECT_NAME@")

If you know what make it has the problem like above, please let me know.

Best

Yi

@alxbilger
Copy link
Member

@0707yiliu thanks for reporting the issue. Indeed, there was a problem on the location of the plugin. This should be solved soon on the master branch.

I am not so sure about the project name. I was not able to reproduce the problem. At least, not on the master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants