Ask Your Question
0

Error when instantiating RVIZ2 plugin custom panel

asked 2020-04-29 14:27:34 -0600

mkopack gravatar image

updated 2020-04-30 08:58:24 -0600

Hey all...

I was having the same problem as this person: https://answers.ros.org/question/3412... but the solution worked and I was able to see my custom panel in the Panels list. But now whenever I try to instantiate my panel I get the following error:

[ERROR] [rviz2]: PluginlibFactory: The plugin for class 'plugins/MissionPanel' failed to load. Error: Failed to load library /home/user1/raa/raa_ros2/install/ui/lib/ui/libui.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = /home/user1/raa/raa_ros2/install/ui/lib/ui/libui.so: undefined symbol: _ZTVN7plugins12MissionPanelE)

I've been fighting with this for 2 days with no luck and haven't found anything online that explains what's going on. It's a VERY simple panel with just a single text field. I'm not even doing any publication/subscription stuff yet in it. Everything is set up the same as that guy (from the linked question) had.

Any ideas? My package is called ui, and my code is using a namespace called plugins in a class called MissionPanel.

I see the libui.so file where it says it's looking for it. It just can't seem to find my class inside there.

ROS2 Dashing. I've tried both Debian package install and building from source. Same effect.

Here's the critical 2 lines from my .cpp:

#include <pluginlib/class_list_macros.hpp>
PLUGINLIB_EXPORT_CLASS(plugins::MissionPanel, rviz_common::Panel)

and here's my plugin_description file:

<library path="ui">

  <!-- Displays plugins -->

  <class
    name="plugins/MissionPanel"
    type="plugins::MissionPanel"
    base_class_type="rviz_common::Panel"
  >
    <description>
      Panel for control and display of status for the RAA robot system.
    </description>
  </class>
</library>

Any ideas what I'm doing wrong??? And yes, I've resourced my environment after building...

edit retag flag offensive close merge delete

Comments

Whoops, looks like you all couldn't see the error message before. Should be able to now...

mkopack gravatar image mkopack  ( 2020-04-30 09:00:11 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2020-04-30 10:37:05 -0600

mkopack gravatar image

Ok, finally got it working. It was in the CMakeLists.txt file. I used the one from the ros2/rviz/rviz_default_plugins package as the template and anything I didn't have in mine that they did, I added (minus the testing related things).

This REALLY REALLY needs to be documented better folks!

edit flag offensive delete link more
0

answered 2020-04-30 10:35:14 -0600

You are using plugins as the package name in the .cpp and plugin_description references to MissionPanel and not ui which is an issue.

In the build section of your CMakeLists, you will need:

# Must be rviz_common to be detected by plugin_lib pluginlib_export_plugin_description_file(rviz_common plugins_description.xml)

Do you have that line?

edit flag offensive delete link more

Comments

Yes had that line... It's not an issue with the package and namespace names. It was a cMAkeList.txt file issue. Apparently I was missing some stuff.. I swear, deciphering what magical incantations you need in there is 99% of my ROS headaches...

mkopack gravatar image mkopack  ( 2020-04-30 10:38:30 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-04-29 14:27:34 -0600

Seen: 284 times

Last updated: Apr 30 '20