From 12c64922addf52fe21663048aaefec19e3245adf Mon Sep 17 00:00:00 2001 From: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com> Date: Sun, 24 Apr 2022 23:41:02 +0900 Subject: [PATCH] fix(ad_service_state_monitor): modify build error in rolling (#716) Signed-off-by: wep21 --- system/ad_service_state_monitor/CMakeLists.txt | 7 +++++++ .../ad_service_state_monitor/state_machine.hpp | 2 -- .../ad_service_state_monitor_node.cpp | 2 -- .../ad_service_state_monitor_node/diagnostics.cpp | 2 -- .../ad_service_state_monitor_node/state_machine.cpp | 13 ++++++++++--- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/system/ad_service_state_monitor/CMakeLists.txt b/system/ad_service_state_monitor/CMakeLists.txt index efc7238c2ccac..c68afa92fdf26 100644 --- a/system/ad_service_state_monitor/CMakeLists.txt +++ b/system/ad_service_state_monitor/CMakeLists.txt @@ -29,6 +29,13 @@ ament_auto_add_executable(ad_service_state_monitor ${AD_SERVICE_STATE_MONITOR_SRC} ) +# workaround to allow deprecated header to build on both galactic and rolling +if(${tf2_geometry_msgs_VERSION} VERSION_LESS 0.18.0) + target_compile_definitions(ad_service_state_monitor PRIVATE + USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER + ) +endif() + if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) ament_lint_auto_find_test_dependencies() diff --git a/system/ad_service_state_monitor/include/ad_service_state_monitor/state_machine.hpp b/system/ad_service_state_monitor/include/ad_service_state_monitor/state_machine.hpp index 764441cf84db4..dbf4420b116e6 100644 --- a/system/ad_service_state_monitor/include/ad_service_state_monitor/state_machine.hpp +++ b/system/ad_service_state_monitor/include/ad_service_state_monitor/state_machine.hpp @@ -31,8 +31,6 @@ #include #include -#include - #include #include #include diff --git a/system/ad_service_state_monitor/src/ad_service_state_monitor_node/ad_service_state_monitor_node.cpp b/system/ad_service_state_monitor/src/ad_service_state_monitor_node/ad_service_state_monitor_node.cpp index cbfb469a72fa2..e5a59692983ca 100644 --- a/system/ad_service_state_monitor/src/ad_service_state_monitor_node/ad_service_state_monitor_node.cpp +++ b/system/ad_service_state_monitor/src/ad_service_state_monitor_node/ad_service_state_monitor_node.cpp @@ -14,8 +14,6 @@ #include "ad_service_state_monitor/ad_service_state_monitor_node.hpp" -#include - #include #include #include diff --git a/system/ad_service_state_monitor/src/ad_service_state_monitor_node/diagnostics.cpp b/system/ad_service_state_monitor/src/ad_service_state_monitor_node/diagnostics.cpp index 4d5fe4a77742b..e20841fd48890 100644 --- a/system/ad_service_state_monitor/src/ad_service_state_monitor_node/diagnostics.cpp +++ b/system/ad_service_state_monitor/src/ad_service_state_monitor_node/diagnostics.cpp @@ -14,8 +14,6 @@ #include "ad_service_state_monitor/ad_service_state_monitor_node.hpp" -#include - #include #include diff --git a/system/ad_service_state_monitor/src/ad_service_state_monitor_node/state_machine.cpp b/system/ad_service_state_monitor/src/ad_service_state_monitor_node/state_machine.cpp index 062f8b92e1cf8..a0b4511cce13f 100644 --- a/system/ad_service_state_monitor/src/ad_service_state_monitor_node/state_machine.cpp +++ b/system/ad_service_state_monitor/src/ad_service_state_monitor_node/state_machine.cpp @@ -12,13 +12,20 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "ad_service_state_monitor/state_machine.hpp" + #include #include -#define FMT_HEADER_ONLY -#include "ad_service_state_monitor/state_machine.hpp" - +#define FMT_HEADER_ONLY // NOLINT #include +#include + +#ifdef USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER +#include +#else +#include +#endif namespace {