From e36e9ed9a6b8b952900321dcb44f03bd9f899749 Mon Sep 17 00:00:00 2001 From: Stefan Scherzinger Date: Tue, 9 Jan 2024 18:49:19 +0100 Subject: [PATCH] Fix ROS2 version detection for IK solvers --- cartesian_controller_base/CMakeLists.txt | 6 +++++- .../include/cartesian_controller_base/IKSolver.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cartesian_controller_base/CMakeLists.txt b/cartesian_controller_base/CMakeLists.txt index 21f49074..afabe043 100644 --- a/cartesian_controller_base/CMakeLists.txt +++ b/cartesian_controller_base/CMakeLists.txt @@ -60,7 +60,6 @@ add_library(${PROJECT_NAME} SHARED src/cartesian_controller_base.cpp src/SpatialPDController.cpp src/PDController.cpp - src/IKSolver.cpp ) # Manual includes for local directories and non-ament packages @@ -72,6 +71,10 @@ target_include_directories(${PROJECT_NAME} ${CMAKE_BINARY_DIR} # ROS2VersionConfig.h ) +target_link_libraries(${PROJECT_NAME} + ik_solvers +) + ament_target_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${THIS_PACKAGE_INCLUDE_DEPENDS} @@ -90,6 +93,7 @@ target_include_directories(ik_solvers PUBLIC $ $ + ${CMAKE_BINARY_DIR} # ROS2VersionConfig.h ) # Prevent pluginlib from using boost diff --git a/cartesian_controller_base/include/cartesian_controller_base/IKSolver.h b/cartesian_controller_base/include/cartesian_controller_base/IKSolver.h index 4415114a..79f0bc04 100644 --- a/cartesian_controller_base/include/cartesian_controller_base/IKSolver.h +++ b/cartesian_controller_base/include/cartesian_controller_base/IKSolver.h @@ -57,6 +57,7 @@ #include #include +#include "ROS2VersionConfig.h" #include "rclcpp/node.hpp" #include "rclcpp_lifecycle/lifecycle_node.hpp"