SofaDefrost / Cosserat

A SOFA plugin to simulate linear structures using Cosserat theory
GNU Lesser General Public License v3.0
46 stars 22 forks source link

error: ‘unload’ is not a member of ‘sofa::simulation::node’ #86

Closed SangbaekYoo closed 1 year ago

SangbaekYoo commented 1 year ago

Hi, I am trying to use Sofagym. Currently, I realize that Cosserat plugin is not included in Sofa, so I am building it by using this repository. I am working with Ubuntu 20.04 and using python 3.8. However, when I build Cosserat with ccmake, below error is appeared.

[ 95%] Building CXX object Tests/CMakeFiles/Cosserat_test.dir/forcefield/BeamHookeLawForceFieldTest.cpp.o
/home/control03/sangbaek/package/Cosserat/Tests/forcefield/BeamHookeLawForceFieldTest.cpp: In member function ‘void sofa::BeamHookeLawForceFieldTest<_DataTypes>::TearDown()’:
/home/control03/sangbaek/package/Cosserat/Tests/forcefield/BeamHookeLawForceFieldTest.cpp:57:37: error: ‘unload’ is not a member of ‘sofa::simulation::node’
   57 |             sofa::simulation::node::unload(root);
      |                                     ^~~~~~
/home/control03/sangbaek/package/Cosserat/Tests/forcefield/BeamHookeLawForceFieldTest.cpp: In member function ‘void sofa::BeamHookeLawForceFieldTest<_DataTypes>::testFonctionnel() [with _DataTypes = sofa::defaulttype::StdVectorTypes<sofa::type::Vec<3, double>, sofa::type::Vec<3, double>, double>]’:
/home/control03/sangbaek/package/Cosserat/Tests/forcefield/BeamHookeLawForceFieldTest.cpp:130:33: error: ‘animate’ is not a member of ‘sofa::simulation::node’
  130 |         sofa::simulation::node::animate(root.get(), 1);
      |                                 ^~~~~~~
/home/control03/sangbaek/package/Cosserat/Tests/forcefield/BeamHookeLawForceFieldTest.cpp: In member function ‘void sofa::BeamHookeLawForceFieldTest<_DataTypes>::basicAttributesTest() [with _DataTypes = sofa::defaulttype::StdVectorTypes<sofa::type::Vec<3, double>, sofa::type::Vec<3, double>, double>]’:
/home/control03/sangbaek/package/Cosserat/Tests/forcefield/BeamHookeLawForceFieldTest.cpp:173:33: error: ‘animate’ is not a member of ‘sofa::simulation::node’
  173 |         sofa::simulation::node::animate(root.get(),(double)0.01);
      |                                 ^~~~~~~
make[2]: *** [Tests/CMakeFiles/Cosserat_test.dir/build.make:89: Tests/CMakeFiles/Cosserat_test.dir/forcefield/BeamHookeLawForceFieldTest.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:171: Tests/CMakeFiles/Cosserat_test.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

The main reason is that unload() and animate() function is not member of sofa::simulation::node, but I check these should be defined.

I am using latest sofa binary (SOFA v23.06.00_Linux). One issue is that I did not set GLEW_DIR in cmake configuration, but I guess that this is not reason of error. How can I solve it? Should I also build sofa by source code?

alxbilger commented 1 year ago

If you use SOFA v23.06, you must compile the branch v23.06 of this plugin, not master.

SangbaekYoo commented 1 year ago

Thank you for reply. I will try it. I check that version issue is right. Thank you!