From b120a043fc600a3cd739700178f8fbdb8bd9c489 Mon Sep 17 00:00:00 2001 From: Alexander Mock Date: Thu, 5 Mar 2026 16:51:09 +0100 Subject: [PATCH 1/3] added missing dependencies to rviz_mbf_plugins --- rviz_mbf_plugins/CMakeLists.txt | 56 +++++++++++++------ .../mbf_goal_actions_panel.hpp | 2 +- rviz_mbf_plugins/package.xml | 13 ++++- 3 files changed, 51 insertions(+), 20 deletions(-) diff --git a/rviz_mbf_plugins/CMakeLists.txt b/rviz_mbf_plugins/CMakeLists.txt index 076c2be2..4b2ee903 100644 --- a/rviz_mbf_plugins/CMakeLists.txt +++ b/rviz_mbf_plugins/CMakeLists.txt @@ -5,47 +5,69 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic -Werror) endif() -find_package(ament_cmake_ros REQUIRED) +# Enable Qt MOC automatically +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC OFF) +set(CMAKE_AUTORCC OFF) + +find_package(ament_cmake REQUIRED) -find_package(pluginlib REQUIRED) find_package(rclcpp REQUIRED) +find_package(rclcpp_action REQUIRED) +find_package(pluginlib REQUIRED) +find_package(geometry_msgs REQUIRED) find_package(mbf_msgs REQUIRED) find_package(rviz_common REQUIRED) -qt5_wrap_cpp(MOC_FILES - include/rviz_mbf_plugins/mbf_goal_actions_panel.hpp -) +find_package(Qt5 REQUIRED COMPONENTS Widgets) + +add_library(${PROJECT_NAME}_mbf_goal_actions_panel + src/mbf_goal_actions_panel.cpp) -add_library(${PROJECT_NAME}_mbf_goal_actions_panel src/mbf_goal_actions_panel.cpp ${MOC_FILES}) target_include_directories(${PROJECT_NAME}_mbf_goal_actions_panel PUBLIC $ $ ) + ament_target_dependencies(${PROJECT_NAME}_mbf_goal_actions_panel + rclcpp + rclcpp_action pluginlib - rviz_common + geometry_msgs mbf_msgs + rviz_common ) -install(TARGETS ${PROJECT_NAME}_mbf_goal_actions_panel - EXPORT export_${PROJECT_NAME} - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib - RUNTIME DESTINATION bin +target_link_libraries(${PROJECT_NAME}_mbf_goal_actions_panel + Qt5::Widgets ) -install(DIRECTORY include/ DESTINATION include) -install(FILES plugins_description.xml - DESTINATION share/${PROJECT_NAME} + +install( + TARGETS ${PROJECT_NAME}_mbf_goal_actions_panel + EXPORT export_${PROJECT_NAME} + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin ) +install( + DIRECTORY include/ + DESTINATION include +) + +install( + FILES plugins_description.xml + DESTINATION share/${PROJECT_NAME} +) + +pluginlib_export_plugin_description_file(rviz_common plugins_description.xml) + if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) ament_lint_auto_find_test_dependencies() endif() - ament_export_include_directories(include) ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET) -pluginlib_export_plugin_description_file(rviz_common plugins_description.xml) ament_package() diff --git a/rviz_mbf_plugins/include/rviz_mbf_plugins/mbf_goal_actions_panel.hpp b/rviz_mbf_plugins/include/rviz_mbf_plugins/mbf_goal_actions_panel.hpp index 552471f1..e30811ba 100644 --- a/rviz_mbf_plugins/include/rviz_mbf_plugins/mbf_goal_actions_panel.hpp +++ b/rviz_mbf_plugins/include/rviz_mbf_plugins/mbf_goal_actions_panel.hpp @@ -62,7 +62,7 @@ class MbfGoalActionsPanel : public rviz_common::Panel public: explicit MbfGoalActionsPanel(QWidget * parent = nullptr); - virtual ~MbfGoalActionsPanel() {} + ~MbfGoalActionsPanel() noexcept override = default; void onInitialize() override; void save(rviz_common::Config config) const override; diff --git a/rviz_mbf_plugins/package.xml b/rviz_mbf_plugins/package.xml index 5aa36033..d797ad8d 100644 --- a/rviz_mbf_plugins/package.xml +++ b/rviz_mbf_plugins/package.xml @@ -15,10 +15,19 @@ ament_cmake - mbf_msgs - pluginlib rclcpp + rclcpp_action + pluginlib + mbf_msgs rviz_common + geometry_msgs + + qtbase5-dev + qtbase5-dev + + libqt5-widgets + libqt5-gui + libqt5-core ament_cmake_auto ament_cmake_uncrustify From 2d75952818ce156acaa0c2f4560509e8db388d31 Mon Sep 17 00:00:00 2001 From: Alexander Mock Date: Thu, 5 Mar 2026 17:41:59 +0100 Subject: [PATCH 2/3] readded explicit moc generation instead of auto --- rviz_mbf_plugins/CMakeLists.txt | 34 ++++++++++++------- .../mbf_goal_actions_panel.hpp | 3 +- rviz_mbf_plugins/plugins_description.xml | 2 +- .../src/mbf_goal_actions_panel.cpp | 1 + 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/rviz_mbf_plugins/CMakeLists.txt b/rviz_mbf_plugins/CMakeLists.txt index 4b2ee903..0650d8b9 100644 --- a/rviz_mbf_plugins/CMakeLists.txt +++ b/rviz_mbf_plugins/CMakeLists.txt @@ -5,11 +5,6 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic -Werror) endif() -# Enable Qt MOC automatically -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTOUIC OFF) -set(CMAKE_AUTORCC OFF) - find_package(ament_cmake REQUIRED) find_package(rclcpp REQUIRED) @@ -21,15 +16,26 @@ find_package(rviz_common REQUIRED) find_package(Qt5 REQUIRED COMPONENTS Widgets) -add_library(${PROJECT_NAME}_mbf_goal_actions_panel - src/mbf_goal_actions_panel.cpp) -target_include_directories(${PROJECT_NAME}_mbf_goal_actions_panel PUBLIC +set(rviz_mbf_plugins_headers_to_moc + include/rviz_mbf_plugins/mbf_goal_actions_panel.hpp +) + +foreach(header "${rviz_mbf_plugins_headers_to_moc}") + qt5_wrap_cpp(rviz_mbf_plugins_moc_files "${header}") +endforeach() + +add_library(rviz_mbf_plugins SHARED + ${rviz_mbf_plugins_moc_files} + src/mbf_goal_actions_panel.cpp +) + +target_include_directories(rviz_mbf_plugins PUBLIC $ $ ) -ament_target_dependencies(${PROJECT_NAME}_mbf_goal_actions_panel +ament_target_dependencies(rviz_mbf_plugins rclcpp rclcpp_action pluginlib @@ -38,12 +44,16 @@ ament_target_dependencies(${PROJECT_NAME}_mbf_goal_actions_panel rviz_common ) -target_link_libraries(${PROJECT_NAME}_mbf_goal_actions_panel +target_link_libraries(rviz_mbf_plugins Qt5::Widgets ) +target_compile_definitions(rviz_mbf_plugins PRIVATE "RVIZ_MBF_PLUGINS_BUILDING_LIBRARY") + +pluginlib_export_plugin_description_file(rviz_common plugins_description.xml) + install( - TARGETS ${PROJECT_NAME}_mbf_goal_actions_panel + TARGETS rviz_mbf_plugins EXPORT export_${PROJECT_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib @@ -60,8 +70,6 @@ install( DESTINATION share/${PROJECT_NAME} ) -pluginlib_export_plugin_description_file(rviz_common plugins_description.xml) - if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) ament_lint_auto_find_test_dependencies() diff --git a/rviz_mbf_plugins/include/rviz_mbf_plugins/mbf_goal_actions_panel.hpp b/rviz_mbf_plugins/include/rviz_mbf_plugins/mbf_goal_actions_panel.hpp index e30811ba..e099c152 100644 --- a/rviz_mbf_plugins/include/rviz_mbf_plugins/mbf_goal_actions_panel.hpp +++ b/rviz_mbf_plugins/include/rviz_mbf_plugins/mbf_goal_actions_panel.hpp @@ -62,7 +62,8 @@ class MbfGoalActionsPanel : public rviz_common::Panel public: explicit MbfGoalActionsPanel(QWidget * parent = nullptr); - ~MbfGoalActionsPanel() noexcept override = default; + // ~MbfGoalActionsPanel() noexcept override = default; + virtual ~MbfGoalActionsPanel() {} void onInitialize() override; void save(rviz_common::Config config) const override; diff --git a/rviz_mbf_plugins/plugins_description.xml b/rviz_mbf_plugins/plugins_description.xml index 3f6c98a0..3be1cfae 100644 --- a/rviz_mbf_plugins/plugins_description.xml +++ b/rviz_mbf_plugins/plugins_description.xml @@ -1,4 +1,4 @@ - + diff --git a/rviz_mbf_plugins/src/mbf_goal_actions_panel.cpp b/rviz_mbf_plugins/src/mbf_goal_actions_panel.cpp index 629bb65a..4004eeed 100644 --- a/rviz_mbf_plugins/src/mbf_goal_actions_panel.cpp +++ b/rviz_mbf_plugins/src/mbf_goal_actions_panel.cpp @@ -412,4 +412,5 @@ void MbfGoalActionsPanel::exePathResultCallback( } // namespace rviz_mbf_plugins #include +#include PLUGINLIB_EXPORT_CLASS(rviz_mbf_plugins::MbfGoalActionsPanel, rviz_common::Panel) From b28883765fd69b8ce1ad7192df00305ddd6b6991 Mon Sep 17 00:00:00 2001 From: Alexander Mock Date: Thu, 5 Mar 2026 17:48:19 +0100 Subject: [PATCH 3/3] changed destructor --- .../include/rviz_mbf_plugins/mbf_goal_actions_panel.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rviz_mbf_plugins/include/rviz_mbf_plugins/mbf_goal_actions_panel.hpp b/rviz_mbf_plugins/include/rviz_mbf_plugins/mbf_goal_actions_panel.hpp index e099c152..e30811ba 100644 --- a/rviz_mbf_plugins/include/rviz_mbf_plugins/mbf_goal_actions_panel.hpp +++ b/rviz_mbf_plugins/include/rviz_mbf_plugins/mbf_goal_actions_panel.hpp @@ -62,8 +62,7 @@ class MbfGoalActionsPanel : public rviz_common::Panel public: explicit MbfGoalActionsPanel(QWidget * parent = nullptr); - // ~MbfGoalActionsPanel() noexcept override = default; - virtual ~MbfGoalActionsPanel() {} + ~MbfGoalActionsPanel() noexcept override = default; void onInitialize() override; void save(rviz_common::Config config) const override;