Closed meyerj closed 1 year ago
- It may still work without, as long as the devel-space is around and has not been cleaned, but not for a binary package built by the OSRF buildfarm, for example.
Confirmed that the latest ros-noetic-stag-ros
binary package for Ubuntu Focal, version 0.3.9-3
, indeed does not work:
johannes@im-laptop-007:~$ source /opt/ros/noetic/setup.bash
johannes@im-laptop-007:~$ rosrun stag_ros stag_node
/opt/ros/noetic/lib/stag_ros/stag_node: error while loading shared libraries: libstag_core.so: cannot open shared object file: No such file or directory
johannes@im-laptop-007:~$ rosrun stag_ros stag_nodelet_runnable
[ INFO] [1675885893.643372928]: Initializing nodelet with 8 worker threads.
[ERROR] [1675885893.655363470]: Failed to load nodelet [/stag_nodelet] of type [stag_ros/stag_nodelet] even after refreshing the cache: Could not find library corresponding to plugin stag_ros/stag_nodelet. Make sure the plugin description XML file has the correct name of the library and that the library actually exists.
[ERROR] [1675885893.655398627]: The error before refreshing the cache was: Could not find library corresponding to plugin stag_ros/stag_nodelet. Make sure the plugin description XML file has the correct name of the library and that the library actually exists.
Thank you for your contribution!
Thanks for your nice package, or more specifically for porting STag and integrating it with ROS!
Some suggested changes to
CMakeLists.txt
:List library
stag_core
incatkin_package(LIBRARIES ...)
, such that other derived packages can link to it. A library namedstag_ros
is not built nor installed by this package, so trying toas-is would trigger a "library not found" error in catkin. See here for the official documentation.
Background: We are integrating the STag in another package built with catkin. So starting from
stag_ros
is convenient, but we would like to link to librarystag_core
only, and not use the nodelets or node executables as-is.All library targets need to be installed for the package to work with an install-space, not only the executables. Unless the libraries would be linked statically, but that is not the default with catkin.
If not, running
stag_node
throws an error:It may still work without, as long as the devel-space is around and has not been cleaned, but not for a binary package built by the OSRF buildfarm, for example.
_Edit (after https://github.com/usrl-uofsc/stag_ros/pull/18/commits/13aa45ee22606a13b8a1d5b87b908146a29966eb):_ Also the header files need to be installed.
If you prefer not to export any library target and/or header file to downstream packages, that is also fine. Then we can fork STag directly and add a
package.xml
andCMakeLists.txt
file there. I would still recommend to leave thecatkin_package()
call empty then, because there is nothing to export, and for simply running the nodes or nodelets that is not required.