Hello! I have written a quick rqt plugin, starting with the roscreate-qt-pkg command to create a package and then following the rqt tutorials. When trying to load the plugin in rqt_gui, I get the following error:
"Failed to load nodelet [control_centre/MyPlugin_1] of type [control_centre/MyPlugin]: Failed to load library /home/pioneer/ros_workspace/control_centre/lib/libcontrol_centre.so. Make sure that you are calling the PLUGINLIB_REGISTER_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Cannot load library: No manifest in /home/pioneer/ros_workspace/control_centre/lib/libcontrol_centre.so: control_centre__MyPlugin"
I am using ROS fuerte on Ubuntu 12.04.
My manifest.xml is the following:
<package>
...
<rosdep name="qt4"/>
<depend package="qt_build"/>
<depend package="roscpp"/>
<depend package="rqt_gui"/>
<depend package="rqt_gui_cpp"/>
<rosbuild2>
<depend package="qt_build"/>
<depend package="roscpp"/>
<depend package="rqt_gui"/>
<depend package="rqt_gui_cpp"/>
</rosbuild2>
<export>
<rqt_gui plugin="${prefix}/plugin.xml" />
</export>
</package>
My plugin.xml is the following:
<library path="lib/libcontrol_centre">
<class name="control_centre/MyPlugin" type="control_centre::MyPlugin" base_class_type="rqt_gui_cpp::Plugin">
<description>
Controls for toggling various rescueneer robot features.
</description>
<qtgui>
<label>Rescueneer Control Centre</label>
<icon type="theme">system-help</icon>
<statustip>..</statustip>
</qtgui>
</class>
</library>
My CMakeLists.txt is the following:
##############################################################################
# Rosbuild2
##############################################################################
if(ROSBUILD)
include(rosbuild.cmake OPTIONAL)
return()
endif()
##############################################################################
# CMake
##############################################################################
cmake_minimum_required(VERSION 2.4.6)
##############################################################################
# Ros Initialisation
##############################################################################
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
rosbuild_init()
#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
#include_directories( ${PROJECT_SOURCE_DIR}/include/control_centre )
# Set the build type. Options are:
# Coverage : w/ debug symbols, w/o optimization, w/ code-coverage
# Debug : w/ debug symbols, w/o optimization
# Release : w/o debug symbols, w/ optimization
# RelWithDebInfo : w/ debug symbols, w/ optimization
# MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries
#set(ROS_BUILD_TYPE Debug)
##############################################################################
# Qt Environment
##############################################################################
rosbuild_include(qt_build qt-ros)
rosbuild_prepare_qt4(QtCore QtGui) # Add the appropriate components to the component list here
##############################################################################
# Sections
##############################################################################
set(CMAKE_INCLUDE_CURRENT_DIR ON)
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/control_centre/*.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
##############################################################################
rosbuild_add_library(control_centre ${QT_SOURCES} ${QT_RESOURCES_CPP} ${QT_FORMS_HPP} ${QT_MOC_HPP})
rosbuild_add_executable(control_centre ${QT_SOURCES} ${QT_RESOURCES_CPP} ${QT_FORMS_HPP} ${QT_MOC_HPP})
target_link_libraries(control_centre ${QT_LIBRARIES})
And finally, my source file has the following declaration at the bottom:
PLUGINLIB_DECLARE_CLASS(control_centre, MyPlugin, control_centre::MyPlugin, rqt_gui_cpp::Plugin)
I have also compared my code to that of rqt_image_view and I can't find the difference. The code compiles and I can run it as a stand-alone application, but I can't seem to open it in rqt_gui. Thanks!
Originally posted by Valts on ROS Answers with karma: 41 on 2013-10-08
Post score: 0