From e704a157562a92aa8fad481cc31f0de26cdf420e Mon Sep 17 00:00:00 2001 From: Alberto Tudela Date: Thu, 24 Oct 2024 11:46:43 +0200 Subject: [PATCH] Fix rqt plugin Signed-off-by: Alberto Tudela --- dsr_rqt_plugin/CMakeLists.txt | 8 +++++++- .../include/dsr_rqt_plugin/dsr_rqt_plugin.hpp | 11 ++--------- .../src/dsr_rqt_plugin/dsr_rqt_plugin.cpp | 13 +------------ 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/dsr_rqt_plugin/CMakeLists.txt b/dsr_rqt_plugin/CMakeLists.txt index 7528bb9..3ba33d2 100644 --- a/dsr_rqt_plugin/CMakeLists.txt +++ b/dsr_rqt_plugin/CMakeLists.txt @@ -63,9 +63,15 @@ set(dsr_LIBRARIES dsr_api dsr_core dsr_gui) set(fastrtps_LIBRARIES fastrtps fastcdr) set(qt_LIBRARIES Qt5::Core Qt5::OpenGL Qt5::Widgets) +# QT mocs +qt5_wrap_cpp(qt_view_moc + include/${PROJECT_NAME}/dsr_rqt_plugin.hpp +) + # Library add_library(${library_name} SHARED src/${PROJECT_NAME}/dsr_rqt_plugin.cpp + ${qt_view_moc} ) target_include_directories(${library_name} PUBLIC "$" @@ -142,6 +148,6 @@ ament_export_dependencies( ) # Export modern CMake targets -ament_export_targets(${library_name}) +ament_export_targets(${PROJECT_NAME}) ament_package() diff --git a/dsr_rqt_plugin/include/dsr_rqt_plugin/dsr_rqt_plugin.hpp b/dsr_rqt_plugin/include/dsr_rqt_plugin/dsr_rqt_plugin.hpp index 8765b6a..e7747a6 100644 --- a/dsr_rqt_plugin/include/dsr_rqt_plugin/dsr_rqt_plugin.hpp +++ b/dsr_rqt_plugin/include/dsr_rqt_plugin/dsr_rqt_plugin.hpp @@ -16,9 +16,6 @@ #ifndef DSR_RQT_PLUGIN__DSR_RQT_PLUGIN_HPP_ #define DSR_RQT_PLUGIN__DSR_RQT_PLUGIN_HPP_ -// Qt -#include - // C++ #include #include @@ -42,12 +39,8 @@ class DSRView : public rqt_gui_cpp::Plugin public: DSRView(); virtual ~DSRView(); - virtual void initPlugin(qt_gui_cpp::PluginContext & context); - virtual void shutdownPlugin(); - virtual void saveSettings( - qt_gui_cpp::Settings & plugin_settings, qt_gui_cpp::Settings & instance_settings) const; - virtual void restoreSettings( - const qt_gui_cpp::Settings & plugin_settings, const qt_gui_cpp::Settings & instance_settings); + void initPlugin(qt_gui_cpp::PluginContext & context) override; + void shutdownPlugin() override; protected: QWidget * widget_graph_; diff --git a/dsr_rqt_plugin/src/dsr_rqt_plugin/dsr_rqt_plugin.cpp b/dsr_rqt_plugin/src/dsr_rqt_plugin/dsr_rqt_plugin.cpp index 51ae4f1..f045798 100644 --- a/dsr_rqt_plugin/src/dsr_rqt_plugin/dsr_rqt_plugin.cpp +++ b/dsr_rqt_plugin/src/dsr_rqt_plugin/dsr_rqt_plugin.cpp @@ -29,6 +29,7 @@ DSRView::DSRView() DSRView::~DSRView() { + G_.reset(); } /* Initialize the publishers and subscribers */ @@ -58,18 +59,6 @@ void DSRView::shutdownPlugin() G_.reset(); } -void DSRView::saveSettings( - qt_gui_cpp::Settings & /*plugin_settings*/, - qt_gui_cpp::Settings & /*instance_settings*/) const -{ -} - -void DSRView::restoreSettings( - const qt_gui_cpp::Settings & /*plugin_settings*/, - const qt_gui_cpp::Settings & /*instance_settings*/) -{ -} - } // namespace dsr_rqt_plugin PLUGINLIB_EXPORT_CLASS(dsr_rqt_plugin::DSRView, rqt_gui_cpp::Plugin)