From 65757b18ecb5757e42a351653eae8e3978d586dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Fr=C3=B6hlich?= Date: Wed, 25 Mar 2026 20:20:35 +0100 Subject: [PATCH 1/3] GPL custom validator: Use tl_expected from libexpected-dev (#2212) (cherry picked from commit 813ed25b48d8cec5ce789d323082b36dfe839303) # Conflicts: # joint_trajectory_controller/CMakeLists.txt # joint_trajectory_controller/include/joint_trajectory_controller/validate_jtc_parameters.hpp --- joint_trajectory_controller/CMakeLists.txt | 34 +++++++++++++++++++ .../validate_jtc_parameters.hpp | 16 ++++++++- joint_trajectory_controller/package.xml | 2 +- 3 files changed, 50 insertions(+), 2 deletions(-) diff --git a/joint_trajectory_controller/CMakeLists.txt b/joint_trajectory_controller/CMakeLists.txt index 3e360e781a..efd2090d5d 100644 --- a/joint_trajectory_controller/CMakeLists.txt +++ b/joint_trajectory_controller/CMakeLists.txt @@ -6,6 +6,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") endif() set(THIS_PACKAGE_INCLUDE_DEPENDS +<<<<<<< HEAD angles control_msgs control_toolbox @@ -20,6 +21,22 @@ set(THIS_PACKAGE_INCLUDE_DEPENDS rsl tl_expected trajectory_msgs +======= + angles + control_msgs + control_toolbox + controller_interface + generate_parameter_library + hardware_interface + pluginlib + rclcpp + rclcpp_action + rclcpp_lifecycle + realtime_tools + rsl + trajectory_msgs + urdf +>>>>>>> 813ed25 (GPL custom validator: Use tl_expected from libexpected-dev (#2212)) ) find_package(ament_cmake REQUIRED) @@ -46,9 +63,26 @@ target_include_directories(joint_trajectory_controller PUBLIC $ ) target_link_libraries(joint_trajectory_controller PUBLIC +<<<<<<< HEAD joint_trajectory_controller_parameters ) ament_target_dependencies(joint_trajectory_controller PUBLIC ${THIS_PACKAGE_INCLUDE_DEPENDS}) +======= + joint_trajectory_controller_parameters + control_toolbox::control_toolbox + controller_interface::controller_interface + hardware_interface::hardware_interface + pluginlib::pluginlib + rclcpp::rclcpp + rclcpp_action::rclcpp_action + rclcpp_lifecycle::rclcpp_lifecycle + realtime_tools::realtime_tools + rsl::rsl + urdf::urdf + angles::angles + ${trajectory_msgs_TARGETS} + ${control_msgs_TARGETS}) +>>>>>>> 813ed25 (GPL custom validator: Use tl_expected from libexpected-dev (#2212)) # Causes the visibility macros to use dllexport rather than dllimport, # which is appropriate when building the dll but not consuming it. diff --git a/joint_trajectory_controller/include/joint_trajectory_controller/validate_jtc_parameters.hpp b/joint_trajectory_controller/include/joint_trajectory_controller/validate_jtc_parameters.hpp index 0b22c7cdd9..aaf91a4031 100644 --- a/joint_trajectory_controller/include/joint_trajectory_controller/validate_jtc_parameters.hpp +++ b/joint_trajectory_controller/include/joint_trajectory_controller/validate_jtc_parameters.hpp @@ -21,7 +21,7 @@ #include "parameter_traits/parameter_traits.hpp" #include "rclcpp/parameter.hpp" #include "rsl/algorithm.hpp" -#include "tl_expected/expected.hpp" +#include "tl/expected.hpp" namespace joint_trajectory_controller { @@ -33,7 +33,12 @@ tl::expected command_interface_type_combinations( // Check if command interfaces combination is valid. Valid combinations are: // 1. effort // 2. velocity +<<<<<<< HEAD // 2. position [velocity, [acceleration]] +======= + // 3. position [velocity, [acceleration]] + // 4. position, effort +>>>>>>> 813ed25 (GPL custom validator: Use tl_expected from libexpected-dev (#2212)) if ( rsl::contains>(interface_types, "velocity") && @@ -57,9 +62,18 @@ tl::expected command_interface_type_combinations( if ( rsl::contains>(interface_types, "effort") && +<<<<<<< HEAD interface_types.size() > 1) { return tl::make_unexpected("'effort' command interface has to be used alone"); +======= + !(interface_types.size() == 1 || + (interface_types.size() == 2 && + rsl::contains>(interface_types, "position")))) + { + return tl::make_unexpected( + "'effort' command interface has to be used alone or with a 'position' interface"); +>>>>>>> 813ed25 (GPL custom validator: Use tl_expected from libexpected-dev (#2212)) } return {}; diff --git a/joint_trajectory_controller/package.xml b/joint_trajectory_controller/package.xml index 138f72a570..368cec3ca2 100644 --- a/joint_trajectory_controller/package.xml +++ b/joint_trajectory_controller/package.xml @@ -24,13 +24,13 @@ control_toolbox generate_parameter_library hardware_interface + libexpected-dev pluginlib rclcpp rclcpp_action rclcpp_lifecycle realtime_tools rsl - tl_expected trajectory_msgs ament_cmake_gmock From 420e568ce558a63528f7e22b067d5b7335b39e36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Fr=C3=B6hlich?= Date: Thu, 26 Mar 2026 08:25:09 +0100 Subject: [PATCH 2/3] Update validate_jtc_parameters.hpp --- .../validate_jtc_parameters.hpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/joint_trajectory_controller/include/joint_trajectory_controller/validate_jtc_parameters.hpp b/joint_trajectory_controller/include/joint_trajectory_controller/validate_jtc_parameters.hpp index aaf91a4031..6866f3a15b 100644 --- a/joint_trajectory_controller/include/joint_trajectory_controller/validate_jtc_parameters.hpp +++ b/joint_trajectory_controller/include/joint_trajectory_controller/validate_jtc_parameters.hpp @@ -33,12 +33,7 @@ tl::expected command_interface_type_combinations( // Check if command interfaces combination is valid. Valid combinations are: // 1. effort // 2. velocity -<<<<<<< HEAD - // 2. position [velocity, [acceleration]] -======= // 3. position [velocity, [acceleration]] - // 4. position, effort ->>>>>>> 813ed25 (GPL custom validator: Use tl_expected from libexpected-dev (#2212)) if ( rsl::contains>(interface_types, "velocity") && @@ -62,18 +57,9 @@ tl::expected command_interface_type_combinations( if ( rsl::contains>(interface_types, "effort") && -<<<<<<< HEAD interface_types.size() > 1) { return tl::make_unexpected("'effort' command interface has to be used alone"); -======= - !(interface_types.size() == 1 || - (interface_types.size() == 2 && - rsl::contains>(interface_types, "position")))) - { - return tl::make_unexpected( - "'effort' command interface has to be used alone or with a 'position' interface"); ->>>>>>> 813ed25 (GPL custom validator: Use tl_expected from libexpected-dev (#2212)) } return {}; From 0f40b8b9a9df72b71ea1548dc91b949553a59887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Fr=C3=B6hlich?= Date: Thu, 26 Mar 2026 08:27:40 +0100 Subject: [PATCH 3/3] Update CMakeLists.txt --- joint_trajectory_controller/CMakeLists.txt | 35 ---------------------- 1 file changed, 35 deletions(-) diff --git a/joint_trajectory_controller/CMakeLists.txt b/joint_trajectory_controller/CMakeLists.txt index efd2090d5d..1550553405 100644 --- a/joint_trajectory_controller/CMakeLists.txt +++ b/joint_trajectory_controller/CMakeLists.txt @@ -6,7 +6,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") endif() set(THIS_PACKAGE_INCLUDE_DEPENDS -<<<<<<< HEAD angles control_msgs control_toolbox @@ -19,24 +18,7 @@ set(THIS_PACKAGE_INCLUDE_DEPENDS rclcpp_lifecycle realtime_tools rsl - tl_expected trajectory_msgs -======= - angles - control_msgs - control_toolbox - controller_interface - generate_parameter_library - hardware_interface - pluginlib - rclcpp - rclcpp_action - rclcpp_lifecycle - realtime_tools - rsl - trajectory_msgs - urdf ->>>>>>> 813ed25 (GPL custom validator: Use tl_expected from libexpected-dev (#2212)) ) find_package(ament_cmake REQUIRED) @@ -63,26 +45,9 @@ target_include_directories(joint_trajectory_controller PUBLIC $ ) target_link_libraries(joint_trajectory_controller PUBLIC -<<<<<<< HEAD joint_trajectory_controller_parameters ) ament_target_dependencies(joint_trajectory_controller PUBLIC ${THIS_PACKAGE_INCLUDE_DEPENDS}) -======= - joint_trajectory_controller_parameters - control_toolbox::control_toolbox - controller_interface::controller_interface - hardware_interface::hardware_interface - pluginlib::pluginlib - rclcpp::rclcpp - rclcpp_action::rclcpp_action - rclcpp_lifecycle::rclcpp_lifecycle - realtime_tools::realtime_tools - rsl::rsl - urdf::urdf - angles::angles - ${trajectory_msgs_TARGETS} - ${control_msgs_TARGETS}) ->>>>>>> 813ed25 (GPL custom validator: Use tl_expected from libexpected-dev (#2212)) # Causes the visibility macros to use dllexport rather than dllimport, # which is appropriate when building the dll but not consuming it.