Is catkin tools compatible with pluginlib? [closed]
Some time back, I made the switch from catkin_make to catkin_tools. For the most part, everything works fine. However, my custom plugins are no longer found. Let me emphasize that my plugins (custom displays for RVIZ) work perfectly when I compile with catkin_make
and source {catkin_ws}/devel/setup.sh
, so I do not believe the problem lies with my package.xml
, plugin_description.xml
or my use of the pluginlib macro.
I created a debug profile using catkin tools with suffix 'debug'. The workspace extends /opt/ros/indigo
. My bashrc
file source /opt/ros/indigo/setup.sh
, so by default only installed ros packages are listed by rospack list
. After running catkin build
and sourcing <catkin_ws>/devel_debug/setup.sh
, rospack list
also shows my packages and I am able to run any of my nodes using rosrun
.
However, if I try to load my plugin, only the library file created by catkin_make gets used. If I delete that file and then try to load my plugin in rviz, I can see my plugin in the list of available displays to add, but if I select it, I get this error:
[ERROR] [1484345587.322954842]: PluginlibFactory: The plugin for class 'visualization/Path' failed to load. Error: Could not find library corresponding to plugin visualization/Path. Make sure the plugin description XML file has the correct name of the library and that the library actually exists.
This happens even after I source the setup.sh
file in my debug profile.
I can confirm that my plugin's library file exists in <catkin_ws>/devel_debug/lib
with the same name that I have specified in plugin_description.xml
.
In order to debug this, I wrote my own test program that displays relevant information using pluginlib::ClassLoader
. Running it in the same terminal that yielded the above rviz error, I learn the following information:
- My package's
plugin_description.xml
file is listed as one of the paths to xml manifests for base classrviz::Display
- My plugin is listed as a declared class type for base class
rviz::Display
- The name, class type, package, description, and manifest path for my class are all retrievable
- The path to my library is reported as
devel/lib/libpath.so
(before deleting that file) and throws the same error as rviz (after)
Having concluded that the problem was pluginlib not seeing my libraries, I looked at the source for pluginlib::ClassLoader to see what paths are searched for libraries. Catkin libraries appear to be found via the command catkin_find --lib
. Running the command myself returns the following paths:
<catkin_ws>/devel_debug/.private/catkin_tools_prebuild/lib
<catkin_ws>/devel/lib
/opt/ros/indigo/lib
The 2nd and 3rd paths make sense, but I don't understand why the first is reported rather than the correct directory (<catkin_ws>/devel_debug/lib
). For the time being, I've switched back to catkin_make, but I would really like to move back to catkin build if possible.
Is catkin_tools compatible with pluginlib? If so, do I need to change some setting ...
Even so, I think it'd be good to include the relevant bits from your
CMakeLists.txt
, ascatkin_make
does things slightly different fromcatkin_tools
, which includes what effect the different CMake .... statements have on generated files and directories.
If possible, a link to your sources and / or a minimal reproducable example would be great as well.
As to whether
catkin_tools
is 'compatible with pluginlib': yes. There is actually no interaction between the two. I suspect something is not correct in yourCMakeLists.txt
or related files, as fi MoveIt! makes extensive use of plugins, builds withcatkin_tools
and we have no problems there.Btw: do things work if you don't use the debug profile? I'm just wondering if the
_debug
suffix added to thecatkin_ws/devel
directory name is making things fail.Thank you for the suggestions. Using my release profile didn't work at all. I now I believe that the only reason the debug profile works for nodes is that it is searching the catkin_makedevel directory. The issue is therefore not with pluginlib, but with my catkin_tools profiles.
I will close this question and try catkin_tools in a clean environment. If I still have trouble, I will create a new question.