rbdl / rbdl-toolkit

Application for visualizing and working with rbdl models
European Union Public License 1.2
19 stars 11 forks source link

ccmake issues with plugins enabled #15

Closed jfslin closed 3 years ago

jfslin commented 3 years ago

I am trying to build the core and optional plugins. If I set TOOLKIT_BUILD_CORE_PLUGINS and TOOLKIT_BUILD_OPTIONAL_PLUGINS to OFF, then it completes correctly. I have libunittest++-dev installed via apt. I installed catch2 via https://github.com/catchorg/Catch2/issues/1383#issuecomment-421548807.

 CMAKE_BUILD_TYPE                                                                                                                                 
 CMAKE_INSTALL_PREFIX             /usr/local                                                                                                      
 CUSTOM_QT_PATH                   /home/jf2lin/Qt/5.15.2/gcc_64                                                                                   
 CUSTOM_RBDL_PATH                                                                                                                                 
 Catch2_DIR                       /usr/local/lib/cmake/Catch2                                                                                      
 Qt53DCore_DIR                    /home/jf2lin/Qt/5.15.2/gcc_64/lib/cmake/Qt53DCore                                                               
 Qt53DExtras_DIR                  /home/jf2lin/Qt/5.15.2/gcc_64/lib/cmake/Qt53DExtras                                                             
 Qt53DInput_DIR                   /home/jf2lin/Qt/5.15.2/gcc_64/lib/cmake/Qt53DInput                                                              
 Qt53DLogic_DIR                   /home/jf2lin/Qt/5.15.2/gcc_64/lib/cmake/Qt53DLogic                                                              
 Qt53DRender_DIR                  /home/jf2lin/Qt/5.15.2/gcc_64/lib/cmake/Qt53DRender                                                             
 Qt5Core_DIR                      /home/jf2lin/Qt/5.15.2/gcc_64/lib/cmake/Qt5Core                                                                 
 Qt5Gamepad_DIR                   /home/jf2lin/Qt/5.15.2/gcc_64/lib/cmake/Qt5Gamepad                                                              
 Qt5Gui_DIR                       /home/jf2lin/Qt/5.15.2/gcc_64/lib/cmake/Qt5Gui                                                                  
 Qt5Network_DIR                   /home/jf2lin/Qt/5.15.2/gcc_64/lib/cmake/Qt5Network                                                              
 Qt5Widgets_DIR                   /home/jf2lin/Qt/5.15.2/gcc_64/lib/cmake/Qt5Widgets                                                              
 Qt5_DIR                          /home/jf2lin/Qt/5.15.2/gcc_64/lib/cmake/Qt5                                                                     
 TOOLKIT_BUILD_CORE_PLUGINS       ON                                                                                                              
 TOOLKIT_BUILD_OPTIONAL_PLUGINS   ON                                                                                                              
 URDF_BUILD_TEST                  ON                                                                                                              
 UnitTest++_DIR                   UnitTest++_DIR-NOTFOUND                                                                                         

However, trying to compile this gives me the following:

CMake Warning at plugins/MotionMarkerPlugin/c3dfile/tests/CMakeLists.txt:11 (FIND_PACKAGE):
   By not providing "FindUnitTest++.cmake" in CMAKE_MODULE_PATH this project
   has asked CMake to find a package configuration file provided by
   "UnitTest++", but CMake did not find one.

   Could not find a package configuration file provided by "UnitTest++" with
   any of the following names:

     UnitTest++Config.cmake
     unittest++-config.cmake

   Add the installation prefix of "UnitTest++" to CMAKE_PREFIX_PATH or set
   "UnitTest++_DIR" to a directory containing one of the above files.  If
   "UnitTest++" provides a separate development package or SDK, be sure it has
   been installed.

 CMake Error at vendor/urdfparser/CMakeLists.txt:36 (ADD_EXECUTABLE):
   The target name "test" is reserved or not valid for certain CMake features,
   such as generator expressions, and may result in undefined behavior.

 CMake Error at vendor/urdfparser/CMakeLists.txt:37 (TARGET_LINK_LIBRARIES):
   Cannot specify link libraries for target "test" which is not built by this
   project.

I can't seem to find a unittest cmake file with my local unittest install, and couldn't find any resources online about it.

ju6ge commented 3 years ago

As far as I am aware that is just a warning, CMake should still have generated all the necessary build files and running make should build the toolkit just fine, since the Unit Testing dependencies are just used to build some test binaries that are part of some of the toolkit dependencies. But I should probably get rid of those warning because they do cause some confusion ;)

ju6ge commented 3 years ago

The errors about the urdf parser can be turned off by setting URDF_BUILD_TEST to OFF. The reason that variable is there is because those tests are only for developing the URDFParser library itself, they are not specific to the toolkit and when building the toolkit we do not actually need to test the urdf parser library again and therefor building the test binary is not required.

jfslin commented 3 years ago

Verified that URDF_BUILD_TEST to OFF removes the errors, and that UnitTest++ is just warnings and can be ignored.

jfslin commented 3 years ago

Sorry, reopening this on a related issue.

Once I build using cmake -DCUSTOM_QT_PATH=~/Qt/5.15.2/gcc_64 -DTOOLKIT_BUILD_CORE_PLUGINS=ON -DTOOLKIT_BUILD_OPTIONAL_PLUGINS=ON ../, and running make, where do I actually find the plugins to load? my /usr/local/bin/ only hasrbdl_luamodel_util,rbdl-toolkit, andrbdl_urdfreader_util`.

ju6ge commented 3 years ago

After running "sudo make install" the plugins and meshes should be copied to /usr/local/share/ORB/rbdl-toolkit

$ ls -alR /usr/local/share/ORB/rbdl-toolkit/
/usr/local/share/ORB/rbdl-toolkit/:
insgesamt 16
drwxr-xr-x 4 root root 4096  9. Sep 14:50 .
drwxr-xr-x 3 root root 4096  9. Sep 14:50 ..
drwxr-xr-x 2 root root 4096  9. Sep 14:50 meshes
drwxr-xr-x 2 root root 4096 18. Dez 16:01 plugins

/usr/local/share/ORB/rbdl-toolkit/meshes:
insgesamt 1088
drwxr-xr-x 2 root root   4096  9. Sep 14:50 .
drwxr-xr-x 4 root root   4096  9. Sep 14:50 ..
-rw-r--r-- 1 root root  25767 10. Okt 2019  arrow_substitute.obj
-rw-r--r-- 1 root root   5824 10. Okt 2019  cylinder.obj
-rw-r--r-- 1 root root   5824 10. Okt 2019  exo6pt_bar.obj
-rw-r--r-- 1 root root  61022 10. Okt 2019  exo6pt_pelvisModule.obj
-rw-r--r-- 1 root root  59865 10. Okt 2019  exo6pt_thighModule.obj
-rw-r--r-- 1 root root 100069 10. Okt 2019  exo6pt_upperTrunkModule.obj
-rw-r--r-- 1 root root  18155 10. Okt 2019  foot.obj
-rw-r--r-- 1 root root  11987 30. Jan 2020  force_arrow.obj
-rw-r--r-- 1 root root  12074 30. Jan 2020  force_arrow_tip.obj
-rw-r--r-- 1 root root  18147 10. Okt 2019  hand.obj
-rw-r--r-- 1 root root  18148 10. Okt 2019  head.obj
-rw-r--r-- 1 root root  18148 10. Okt 2019  knubbi_head.obj
-rw-r--r-- 1 root root  23619 10. Okt 2019  knubbi_lowerarm.obj
-rw-r--r-- 1 root root  25767 10. Okt 2019  knubbi_lowerleg.obj
-rw-r--r-- 1 root root  18182 10. Okt 2019  knubbi_lowertrunk.obj
-rw-r--r-- 1 root root  25827 10. Okt 2019  knubbi_middletrunk.obj
-rw-r--r-- 1 root root  25817 10. Okt 2019  knubbi_upperarm.obj
-rw-r--r-- 1 root root  25805 10. Okt 2019  knubbi_upperleg_L.obj
-rw-r--r-- 1 root root  25818 10. Okt 2019  knubbi_upperleg_R.obj
-rw-r--r-- 1 root root  18176 10. Okt 2019  knubbi_uppertrunk.obj
-rw-r--r-- 1 root root  23619 10. Okt 2019  lowerArm.obj
-rw-r--r-- 1 root root  25827 10. Okt 2019  lumbarVertebrae.obj
-rw-r--r-- 1 root root  25827 10. Okt 2019  middleTrunk.obj
-rw-r--r-- 1 root root  58123 10. Okt 2019  monkeyhead.obj
-rw-r--r-- 1 root root  26183 10. Okt 2019  pelvisModule.obj
-rw-r--r-- 1 root root  18182 10. Okt 2019  pelvis.obj
-rw-r--r-- 1 root root  25767 10. Okt 2019  shank.obj
-rw-r--r-- 1 root root  25818 10. Okt 2019  thigh.obj
-rw-r--r-- 1 root root  57007 30. Jan 2020  torque_arrow.obj
-rw-r--r-- 1 root root  45518 10. Okt 2019  Torus.obj
-rw-r--r-- 1 root root  25827 10. Okt 2019  trunk.obj
-rw-r--r-- 1 root root    736 10. Okt 2019  unit_cube.obj
-rw-r--r-- 1 root root  14578 10. Okt 2019  unit_cylinder_medres.obj
-rw-r--r-- 1 root root   5902 10. Okt 2019  unit_cylinder_medres_z.obj
-rw-r--r-- 1 root root   4422 10. Okt 2019  unit_sphere_lowres.obj
-rw-r--r-- 1 root root  27702 10. Okt 2019  unit_sphere_medres.obj
-rw-r--r-- 1 root root  25817 10. Okt 2019  upperArm.obj
-rw-r--r-- 1 root root  18176 10. Okt 2019  upperTrunk.obj
-rw-r--r-- 1 root root  18182 10. Okt 2019  wholeTorso.obj

/usr/local/share/ORB/rbdl-toolkit/plugins:
insgesamt 46460
drwxr-xr-x 2 root root     4096 18. Dez 16:01 .
drwxr-xr-x 4 root root     4096  9. Sep 14:50 ..
-rwxr-xr-x 1 root root 12445360 18. Dez 16:01 libanimationplugin.so
-rwxr-xr-x 1 root root  7889632 18. Dez 16:01 libcameraoperatorplugin.so
-rwxr-xr-x 1 root root  6862824 18. Dez 16:01 libforcetorqueplugin.so
-rwxr-xr-x 1 root root  5465640 18. Dez 16:01 libIKplugin.so
-rwxr-xr-x 1 root root  8827536 18. Dez 16:01 libmotionmarkerplugin.so
-rwxr-xr-x 1 root root  6060056 18. Dez 16:01 librenderplugin.so

Now I should also add that there is some logic in rbdl-toolkit regarding the loading of plugins. First if build in "Debug" mode rbdl-toolkit will search the local ./plugins directory for the plugins. This is only intended as a dev feature so that when you test rbdl-toolkit you just run it from your build directory and the locally build plugins which you also want to debug are used instead of the ones installed in the system. When build in release mode plugins are loaded from the /usr/local/share/ORB/rbdl-toolkit/plugins directory. Now there is also logic to detect if the toolkit is being run as a appimage. In that case the plugin are loaded from the mounted AppImage.

But you can also load plugins explicitly by using the -p option and giving it the path to the plugin.so.

jfslin commented 3 years ago

Okay, I see the "debug" vs "release" distinction and got it working. Thanks for the clarification.