rviz does not know of custom panel
TL;DR I cannot get my custom rviz panel to show up in rviz.
EDIT: Initial problem was a hosed workspace somehow. New problem is missing symbol in the library.
CURRENT PROBLEM (MISSING SYMBOL DEFINITION):
When loading the panel (which exists in rviz) I get the following:
[ERROR] [1552945665.814417674]: PluginlibFactory: The plugin for class 'myrviz/CustomPanel' failed to load. Error: Failed to load library /home/zlacelle/catkin_ws/devel/lib//libcustompanel.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/user/catkin_ws/devel/lib//libcustompanel.so: undefined symbol: _ZTVN10myrviz11CustomPanelE)
nm
confirms this symbol is undefined.
I have the constructor defined, with a QWidget* argument, which is defaulted to '0' in the function definition.
ORIGINAL PROBLEM (SOLVED BY NEW WORKSPACE):
I'm running ROS Kinetic, using catkin to build my packages. I've made a custom rviz plugin to visualize some data, based on examples here:
https://github.com/OctoMap/octomap_rv...
https://github.com/ccny-ros-pkg/imu_t...
I've created a package.xml that:
- Has
<build_depend>
on rviz - Has
<exec_depend>
on rviz - Has an
<export>
section that lists<rviz plugin="${prefix}/plugin_description.xml" />
I have a plugin_description.xml which has all of the normal fields.
I have a CMakeLists.txt which:
- Has a find_package on rviz
- Has CATKIN_DEPENDS on rviz
- Has an install() on plugin_description.xml to the SHARE_DESTINATION
Finally, I have a PLUGINLIB_EXPORT_CLASS(myrviz::CustomPanel,rviz::Panel) at the bottom of my source code declaration.
All of this builds, and I then source my devel/setup.bash. I can see the library libcustompanel.so
in devel/lib. I can also see my plugin_description.xml in install/share/custompanel.
However, I cannot see the plugin listed with rospack plugins --attrib=plugin rviz
. It lists the following:
moveit_ros_visualization /opt/ros/kinetic/share/moveit_ros_visualization/robot_state_rviz_plugin_description.xml moveit_ros_visualization /opt/ros/kinetic/share/moveit_ros_visualization/planning_scene_rviz_plugin_description.xml moveit_ros_visualization /opt/ros/kinetic/share/moveit_ros_visualization/motion_planning_rviz_plugin_description.xml moveit_ros_visualization /opt/ros/kinetic/share/moveit_ros_visualization/trajectory_rviz_plugin_description.xml grid_map_rviz_plugin /opt/ros/kinetic/share/grid_map_rviz_plugin/plugin_description.xml octomap_rviz_plugins /opt/ros/kinetic/share/octomap_rviz_plugins/plugin_description.xml rviz_imu_plugin /opt/ros/kinetic/share/rviz_imu_plugin/plugin_description.xml rviz /opt/ros/kinetic/share/rviz/plugin_description.xml
What's my next step to try and debug this issue?