ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Writing your own main
and then trying to use a C++ rqt plugin won't be an easy task. rqt
is a framework which does a lot of complex things behind the scene.
If you look into the code you will find that your C++ rqt plugin subclasses from rqt_gui_cpp::Plugin
(https://github.com/ros-visualization/rqt/blob/groovy-devel/rqt_gui_cpp/include/rqt_gui_cpp/plugin.h). This class is a Nodelet
as well as a qt_gui_cpp::Plugin
(https://github.com/ros-visualization/qt_gui_core/blob/groovy-devel/qt_gui_cpp/include/qt_gui_cpp/plugin.h). This class is a QObject
and not a widget. Therefore you can't simply cast it to QDockWidget
.
A rqt plugin can provide more than one widget throught the PluginContext
(https://github.com/ros-visualization/qt_gui_core/blob/1eaff5a7586e78ec4f5bf501d9a3172a5da07b06/qt_gui_cpp/include/qt_gui_cpp/plugin_context.h#L82). If you want to implement your own main
you need to use the same API and mimic the behavior in order to leverage existing plugins.