ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
After some search in the rqt_rviz package I finally was able to let rqt_gui detect my C++ plugin. I will try to describe what I needed to do (those things are only useful for c++ plugins) and what sometimes really confused me (correct me if I got something wrong, I will use the package name rqt_something and the classes name will be MyGUIClass):
rqt_something
) must also be the namespace (rqt_something::MyGUIClass
)plugin.xml
the very first line must be changed to <library path="lib/librqt_something">
The second line does also differ from the example (because we are using c++)
<class name="rqt_seneka/MyGUIClass" type="rqt_something::MyGUIClass" base_class_type="rqt_gui_cpp::Plugin">
You must add the following lines in the CMakeLists.txt before the rosbuild_add_library and after invoking the moc:
rosbuild_include(pluginlib hide_plugin_symbols)
pluginlib_hide_plugin_symbols(rqt_something MyGUIClass)
This should work with the example code from the C++ specific tutorial. If you want to use a .ui file (in this case myguiclass_widget.ui) you should put in in the resource folder and add the following lines to your CMakeLists.txt:
qt_wrap_ui(ui_MyGUIClass ui_MyGUIClass_HDRS ui_MyGUIClass_SRCS resource/myguiclass_widget.ui)
include_directories(${CMAKE_BINARY_DIR})
#Here comes the moc-part
#Add ${ui_MyGUIClass_HDRS} to the sources of the library as done in this example
rosbuild_add_library(${PROJECT_NAME} ${rqt_something_SRCS} ${rqt_something_MOCS} ${ui_MyGUIClass_HDRS})
I hope I did not forget anything. Maybe somebody could link to this question in the tutorials.