Is catkin tools compatible with pluginlib? [closed]

asked 2017-01-13 17:02:40 -0500

cyberguy42 gravatar image

updated 2017-01-14 02:44:44 -0500

gvdhoorn gravatar image

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 class rviz::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 ... (more)

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by cyberguy42
close date 2017-01-19 14:03:36.133928

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

gvdhoorn gravatar image gvdhoorn  ( 2017-01-14 02:46:49 -0500 )edit

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

gvdhoorn gravatar image gvdhoorn  ( 2017-01-14 02:47:57 -0500 )edit

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.

gvdhoorn gravatar image gvdhoorn  ( 2017-01-14 02:49:28 -0500 )edit

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.

gvdhoorn gravatar image gvdhoorn  ( 2017-01-14 02:51:40 -0500 )edit

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.

cyberguy42 gravatar image cyberguy42  ( 2017-01-19 13:59:27 -0500 )edit

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

cyberguy42 gravatar image cyberguy42  ( 2017-01-19 14:02:32 -0500 )edit