Error when instantiating RVIZ2 plugin custom panel
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...
Whoops, looks like you all couldn't see the error message before. Should be able to now...