Bipedal-locomotion-framework: Unable to use the yarp devices defined in blf

Created on 11 Jun 2021  路  19Comments  路  Source: dic-iit/bipedal-locomotion-framework

When I try to call yarpdev --list I get the following output. Notice that the other devices work fine

blf is installed by the superbuild

[INFO] |yarp.dev.Drivers| Here are devices listed for your system:
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FTIMULoggerDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FTIMULoggerDevice.so: undefined symbol: FTIMULoggerDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FTIMULoggerDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FTIMULoggerDevice.so: undefined symbol: FTIMULoggerDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FTIMULoggerDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FTIMULoggerDevice.so: undefined symbol: FTIMULoggerDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FTIMULoggerDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FTIMULoggerDevice.so: undefined symbol: FTIMULoggerDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FTIMULoggerDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FTIMULoggerDevice.so: undefined symbol: FTIMULoggerDevice
[WARNING] |yarp.dev.Drivers| Wrong library name for plugin FTIMULoggerDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FloatingBaseEstimatorDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FloatingBaseEstimatorDevice.so: undefined symbol: FloatingBaseEstimatorDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FloatingBaseEstimatorDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FloatingBaseEstimatorDevice.so: undefined symbol: FloatingBaseEstimatorDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FloatingBaseEstimatorDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FloatingBaseEstimatorDevice.so: undefined symbol: FloatingBaseEstimatorDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FloatingBaseEstimatorDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FloatingBaseEstimatorDevice.so: undefined symbol: FloatingBaseEstimatorDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FloatingBaseEstimatorDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FloatingBaseEstimatorDevice.so: undefined symbol: FloatingBaseEstimatorDevice
[WARNING] |yarp.dev.Drivers| Wrong library name for plugin FloatingBaseEstimatorDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/ROSPublisherTestDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/ROSPublisherTestDevice.so: undefined symbol: ROSPublisherTestDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/ROSPublisherTestDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/ROSPublisherTestDevice.so: undefined symbol: ROSPublisherTestDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/ROSPublisherTestDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/ROSPublisherTestDevice.so: undefined symbol: ROSPublisherTestDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/ROSPublisherTestDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/ROSPublisherTestDevice.so: undefined symbol: ROSPublisherTestDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/ROSPublisherTestDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/ROSPublisherTestDevice.so: undefined symbol: ROSPublisherTestDevice
[WARNING] |yarp.dev.Drivers| Wrong library name for plugin ROSPublisherTestDevice
[INFO] |yarp.dev.Drivers| Device "AudioPlayerWrapper", available on request (found in /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/yarp_AudioPlayerWrapper.so library), is a network wrapper.
[INFO] |yarp.dev.Drivers| Device "AudioRecorderWrapper", available on request (found in /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/yarp_AudioRecorderWrapper.so library), is a network wrapper.
[INFO] |yarp.dev.Drivers| Device "IMURosPublisher", available on request (found in /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/yarp_IMURosPublisher.so library), is a network wrapper.
[INFO] |yarp.dev.Drivers| Device "JoypadControlClient", available on request (found in /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/yarp_JoypadControlClient.so library), is a network wrapper.
[INFO] |yarp.dev.Drivers| Device "JoypadControlServer", available on request (found in /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/yarp_JoypadControlServer.so library), is a network wrapper.
[INFO] |yarp.dev.Drivers| Device "MagneticFieldRosPublisher", available on request (found in /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/yarp_MagneticFieldRosPublisher.so library), is a network wrapper.
[INFO] |yarp.dev.Drivers| Device "PoseStampedRosPublisher", available on request (found in /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/yarp_PoseStampedRosPublisher.so library), is a network wrapper.

cc @prashanthr05 and @traversaro

bug

All 19 comments

I noticed adding the prefix yarp_ to the library value in FTIMULoggerDevice.ini (and all the other devices) the errors disappear. However the warning remains

INFO] |yarp.dev.Drivers| Here are devices listed for your system:
[WARNING] |yarp.dev.Drivers| Wrong library name for plugin FTIMULoggerDevice
[WARNING] |yarp.dev.Drivers| Wrong library name for plugin FloatingBaseEstimatorDevice
[WARNING] |yarp.dev.Drivers| Wrong library name for plugin ROSPublisherTestDevice

edit
if I run YARP_ROBOT_NAME=iCubGenova04 yarprobotinterface --config launch-ft-imu-logger.xml I got

[WARNING] |yarp.os.YarpPluginSettings| Cannot load plugin from shared library (yarp_FTIMULoggerDevice)
[WARNING] |yarp.os.YarpPluginSettings| (yarp_FTIMULoggerDevice: cannot open shared object file: No such file or directory)

and the interface closes

I am using a BLF build outside of the superbuild with yarp version: YARP version 3.4.100+20201111.5+git08c1f164d I have YARP_DATA_DIRS and LD_LIBRARY_PATH updated as,

export YARP_DATA_DIRS=${YARP_DATA_DIRS:+${YARP_DATA_DIRS}:}${BipedalLocomotionFramework_DIR}/share/yarp:${BipedalLocomotionFramework_DIR}/share/BipedalLocomotionFramework
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${BipedalLocomotionFramework_DIR}/lib

And for me running a yarpdev --list gives,
image

yarp plugin --all shows,

image

doing a cat on the ini file displays,

image

Maybe I should try updating YARP and see if things fail.

I noticed adding the prefix yarp_ to the library value in FTIMULoggerDevice.ini (and all the other devices) the errors disappear

The library field should reflect the installed .so file in <install_prefix>/lib/yarp folder.

At the moment, there are no explicit checks, just being careful about the CONFIGURE_PACKAGE_NAME parameter passed to the macro being different than NAME parameter,

https://github.com/dic-iit/bipedal-locomotion-framework/blob/b7adab2f8dc5bd448533cac7d31633c5e4926a9b/devices/examples/FTIMULoggerDevice/CMakeLists.txt#L13

@GiulioRomualdi can you provide the CMakeCache.txt of blf in your case?

Furthermore, which version of YARP are you using @GiulioRomualdi ?

@traversaro, is it strange that for me the ini files are being installed like,
image

After updating YARP to YARP version 3.4.101+20210611.21+git5437b92dc, I get the following error

image

Furthermore, which version of YARP are you using @GiulioRomualdi ?

YARP version 3.4.2+20-20210204.2+gitb966f9f29

I quickly checked with the released binaries in conda:
~
conda create -n blf
conda activate blf
conda install -c conda-forge -c robotology bipedal-locomotion-framework
~

and the problem is present also there:
~
(blf) gitpod@ws-840219e8-49e2-4a4b-b398-141ed14d5ae3:/workspace/gitpod-ubuntu-20.04$ yarpdev --list
[INFO] |yarp.dev.Drivers| Here are devices listed for your system:
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gitpod/mambaforge/envs/blf/lib/yarp/FloatingBaseEstimatorDevice.so:
/home/gitpod/mambaforge/envs/blf/lib/yarp/FloatingBaseEstimatorDevice.so: undefined symbol: FloatingBaseEstimatorDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gitpod/mambaforge/envs/blf/lib/yarp/FloatingBaseEstimatorDevice.so:
/home/gitpod/mambaforge/envs/blf/lib/yarp/FloatingBaseEstimatorDevice.so: undefined symbol: FloatingBaseEstimatorDevice
[WARNING] |yarp.dev.Drivers| Wrong library name for plugin FloatingBaseEstimatorDevice
~

Removing the constructor with the explicit keyword,
https://github.com/dic-iit/bipedal-locomotion-framework/blob/b7adab2f8dc5bd448533cac7d31633c5e4926a9b/devices/examples/FTIMULoggerDevice/include/BipedalLocomotion/FTIMULoggerDevice.h#L28

https://github.com/dic-iit/bipedal-locomotion-framework/blob/b7adab2f8dc5bd448533cac7d31633c5e4926a9b/devices/examples/FTIMULoggerDevice/src/FTIMULoggerDevice.cpp#L18-L22

fixes the error in #335 (comment).

This doesn't fix the problem

 yarpdev --list
[INFO] |yarp.dev.Drivers| Here are devices listed for your system:
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FloatingBaseEstimatorDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FloatingBaseEstimatorDevice.so: undefined symbol: FloatingBaseEstimatorDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FloatingBaseEstimatorDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FloatingBaseEstimatorDevice.so: undefined symbol: FloatingBaseEstimatorDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FloatingBaseEstimatorDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FloatingBaseEstimatorDevice.so: undefined symbol: FloatingBaseEstimatorDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FloatingBaseEstimatorDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FloatingBaseEstimatorDevice.so: undefined symbol: FloatingBaseEstimatorDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FloatingBaseEstimatorDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FloatingBaseEstimatorDevice.so: undefined symbol: FloatingBaseEstimatorDevice
[WARNING] |yarp.dev.Drivers| Wrong library name for plugin FloatingBaseEstimatorDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/ROSPublisherTestDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/ROSPublisherTestDevice.so: undefined symbol: ROSPublisherTestDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/ROSPublisherTestDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/ROSPublisherTestDevice.so: undefined symbol: ROSPublisherTestDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/ROSPublisherTestDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/ROSPublisherTestDevice.so: undefined symbol: ROSPublisherTestDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/ROSPublisherTestDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/ROSPublisherTestDevice.so: undefined symbol: ROSPublisherTestDevice
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/ROSPublisherTestDevice.so:
  /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/ROSPublisherTestDevice.so: undefined symbol: ROSPublisherTestDevice
yarp plugin  FRIIMULoggerDevice
[ERROR] |yarp.os.YarpPluginSettings| Cannot find "FRIIMULoggerDevice" plugin (not built in, and no .ini file found for it)Check that YARP_DATA_DIRS leads to at least one directory with plugins/FRIIMULoggerDevice.ini or share/yarp/plugins/FRIIMULoggerDevice.ini in it
[ERROR] cannot find a plugin with the specified name
[ERROR]     Cannot find or load shared library

However FTIMULoggerDevice.ini is located in ~/robot-code/robotology-superbuild/build/install/share/yarp/plugins and YARP_DATA_DIRS is

bash: /home/gromualdi/robot-code/robotology-superbuild/build/install/share/yarp:/home/gromualdi/robot-code/robotology-superbuild/build/install/share/iCub:/home/gromualdi/robot-code/robotology-superbuild/build/install/share/ICUBcontrib

I noticed that there are these three options in the CMake configuration

ENABLE_FTIMULoggerDevice                                                               
ENABLE_FloatingBaseEstimatorDe   
ENABLE_ROSPublisherTestDevice 

by default, there are OFF. If I put them ON and I apply https://github.com/dic-iit/bipedal-locomotion-framework/issues/335#issuecomment-859674712

yarpdev --list

The error disappears

[INFO] |yarp.dev.Drivers| Device "FTIMULoggerDevice", available on request (found in /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FTIMULoggerDevice.so library).
[INFO] |yarp.dev.Drivers| Device "FloatingBaseEstimatorDevice", available on request (found in /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FloatingBaseEstimatorDevice.so library).

Why these parameters are there?

I noticed that there are these three options in the CMake configuration

ENABLE_FTIMULoggerDevice                                                               
ENABLE_FloatingBaseEstimatorDe   
ENABLE_ROSPublisherTestDevice 

by default, there are OFF. If I put them ON and I apply #335 (comment)

yarpdev --list

The error disappears

[INFO] |yarp.dev.Drivers| Device "FTIMULoggerDevice", available on request (found in /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FTIMULoggerDevice.so library).
[INFO] |yarp.dev.Drivers| Device "FloatingBaseEstimatorDevice", available on request (found in /home/gromualdi/robot-code/robotology-superbuild/build/install/lib/yarp/FloatingBaseEstimatorDevice.so library).

Why these parameters are there?

Good catch! I was also affected by the issue in the past and I had forgot about it. The reason is that yarp_prepare_device defines them (see https://github.com/robotology/yarp/blob/5313b2defd8be7237567ea56eca8dde93dfc8121/cmake/YarpPlugin.cmake#L214). If the option is off, the shared library is installed normally (and this is the confusing part) but the YARP_DEFINE_SHARED_SUBCLASS macro is not compiled (see https://github.com/robotology/yarp/blob/5313b2defd8be7237567ea56eca8dde93dfc8121/cmake/YarpPlugin.cmake#L492) so some necessary symbols are not defined. If you want a device to be by default on, you can add on top of fixes in https://github.com/dic-iit/bipedal-locomotion-framework/pull/337/files the DEFAULT ON option to the yarp_prepare_plugin call, see for example: https://github.com/robotology/whole-body-estimators/blob/master/devices/genericSensorClient/CMakeLists.txt#L10 . You can also set ADVANCED so the option do not pollute the users-facing options: https://github.com/robotology/yarp/blob/5313b2defd8be7237567ea56eca8dde93dfc8121/cmake/YarpPlugin.cmake#L220 .

I opened https://github.com/robotology/yarp/issues/2606 to mitigate the risk of this happening again.

Great, thanks @traversaro !!

Was this page helpful?
0 / 5 - 0 ratings