Could not load panel in rviz -- PluginlibFactory: The plugin for class ...
Hello,
I have heavy problems with developing own panel i rviz. I have prepared everything, it compiles without warning but while loading, the rviz writes
PluginlibFactory: The plugin for class 'assistant_panel/Widget_interface' failed to load. Error: Failed to load library /home/xxx/ws/ws_linux/devel/lib/libassistant_panel.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/xxx/ws/ws_linux/devel/lib/libassistant_panel.so: undefined symbol: _ZTVN15assistant_panel16Widget_interfaceE)
Eveyrthing looks ok, but I am trying to solve it for last two days but I am failing.
link for the soft: https://drive.google.com/file/d/0B5_3...
Files:
CMakeLists.txt
##############################################################################
# CMake
##############################################################################
cmake_minimum_required(VERSION 2.8.0)
project(assistant_panel)
##############################################################################
# Catkin
##############################################################################
# qt_build provides the qt cmake glue, roscpp the comms for a default talker
find_package(catkin REQUIRED COMPONENTS qt_build roscpp rviz)
include_directories(${catkin_INCLUDE_DIRS})
# Use this to define what the package will export (e.g. libs, headers).
# Since the default here is to produce only a binary, we don't worry about
# exporting anything.
catkin_package()
##############################################################################
# Qt Environment
##############################################################################
# this comes from qt_build's qt-ros.cmake which is automatically
# included via the dependency call in package.xml
rosbuild_prepare_qt4(QtCore QtGui) # Add the appropriate components to the component list here
##############################################################################
# Sections
##############################################################################
file(GLOB QT_FORMS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ui/*.ui)
file(GLOB QT_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} resources/*.qrc)
file(GLOB_RECURSE QT_MOC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS include/assistant_panel/*.hpp)
QT4_ADD_RESOURCES(QT_RESOURCES_CPP ${QT_RESOURCES})
QT4_WRAP_UI(QT_FORMS_HPP ${QT_FORMS})
QT4_WRAP_CPP(QT_MOC_HPP ${QT_MOC})
##############################################################################
# Sources
##############################################################################
file(GLOB_RECURSE QT_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS src/*.cpp)
##############################################################################
# Binaries
##############################################################################
#add_executable(assistant_panel ${QT_SOURCES} ${QT_RESOURCES_CPP} ${QT_FORMS_HPP} ${QT_MOC_HPP} ${QT_MOC})
add_library(${PROJECT_NAME} ${QT_SOURCES} ${QT_RESOURCES_CPP} ${QT_MOC})
target_link_libraries(assistant_panel ${QT_LIBRARIES} ${catkin_LIBRARIES})
#install(TARGETS assistant_panel RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
install(TARGETS
${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(FILES
plugin_description.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
install(DIRECTORY media/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/media)
install(DIRECTORY icons/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/icons)
install(PROGRAMS scripts/send_test_msgs.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
Package.xml
<package>
<name>assistant_panel</name>
<version>0.1.0</version>
<description>
assistant_panel
</description>
<maintainer email="ReMeDi@gmail.com">ReMeDi</maintainer>
<author>ReMeDi</author>
<license>BSD</license>
<!-- <url type="bugtracker">https://github.com/stonier/qt_ros/issues</url> -->
<!-- <url type="repository">https://github.com/stonier/qt_ros</url> -->
<buildtool_depend>catkin</buildtool_depend>
<build_depend>qt_build</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>libqt4-dev</build_depend>
<build_depend>rviz</build_depend>
<run_depend>rviz</run_depend>
<run_depend>qt_build</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>libqt4-dev</run_depend>
<export>
<rosdoc config="${prefix}/rosdoc.yaml"/>
<rviz plugin="${prefix}/plugin_description.xml"/>
</export>
</package>
plugin_description.xml
<library path="libassistant_panel">
<class name="assistant_panel/Widget_interface"
type="assistant_panel::Widget_interface"
base_class_type="rviz::Panel">
<description>
sddfsrfrfvg.
</description>
</class>
</library>
main_window.hpp
/**
* @file /include/assistant_panel/main_window.hpp
*
* @brief Qt based gui for assistant_panel.
*
* @date November 2010
**/
#ifndef assistant_panel_MAIN_WINDOW_H
#define assistant_panel_MAIN_WINDOW_H
/*****************************************************************************
** Includes
*****************************************************************************/
//#include <QtGui/QWidget_interface>
#include "ui_main_window.h"
#include "qnode.hpp"
#include <ros/ros.h>
#include <geometry_msgs/Twist.h>
#include <rviz/panel.h>
/*****************************************************************************
** Namespace
*****************************************************************************/
namespace assistant_panel {
/*****************************************************************************
** Interface [Widget_interface]
*****************************************************************************/
/**
* @brief Qt central, all operations relating to the view part here.
*/
class Widget_interface : public rviz::Panel {
Q_OBJECT
public:
// Widget_interface();
Widget_interface(QWidget *parent = 0);
~Widget_interface();
public Q_SLOTS:
/******************************************
** Auto-connections (connectSlotsByName ...
This usually happens when you're loading a version of the plugin from a different, overlayed workspace. Make sure you've source'd any setup.bash from your latest workspace before running rviz.
Yes, I am loading. As I have written below the rviz want the symbol, which is actually Undefined. Well, it is very strange, because I have panel which works perfectly. The only difference is not using the ui_ generated header and slightly different CMakeLists. I`ve checked that it is no CMakLists