Robotics StackExchange | Archived questions

Is catkin tools compatible with pluginlib?

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:

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:

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, or update some package, or do something else? Any help would be greatly appreciated!

Asked by cyberguy42 on 2017-01-13 18:02:40 UTC

Comments

I do not believe the problem lies with my package.xml, plugin_description.xml or [..]

Even so, I think it'd be good to include the relevant bits from your CMakeLists.txt, as catkin_make does things slightly different from catkin_tools, which includes what effect the different CMake ..

Asked by gvdhoorn on 2017-01-14 03:46:49 UTC

.. 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.

Asked by gvdhoorn on 2017-01-14 03:47:57 UTC

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 your CMakeLists.txt or related files, as fi MoveIt! makes extensive use of plugins, builds with catkin_tools and we have no problems there.

Asked by gvdhoorn on 2017-01-14 03:49:28 UTC

Btw: do things work if you don't use the debug profile? I'm just wondering if the _debug suffix added to the catkin_ws/devel directory name is making things fail.

Asked by gvdhoorn on 2017-01-14 03:51:40 UTC

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_make devel directory. The issue is therefore not with pluginlib, but with my catkin_tools profiles.

Asked by cyberguy42 on 2017-01-19 14:59:27 UTC

I will close this question and try catkin_tools in a clean environment. If I still have trouble, I will create a new question.

Asked by cyberguy42 on 2017-01-19 15:02:32 UTC

Answers