From 2dcb86e8f1007f0cf50c103945110d872b511014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Fr=C3=B6hlich?= Date: Tue, 17 Dec 2024 06:56:55 +0100 Subject: [PATCH] Make ur_controllers compileable on humble (#1207) No += overload for Duration class on humble --- ur_controllers/src/passthrough_trajectory_controller.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ur_controllers/src/passthrough_trajectory_controller.cpp b/ur_controllers/src/passthrough_trajectory_controller.cpp index 0b09bb6fe..0ae84cffb 100644 --- a/ur_controllers/src/passthrough_trajectory_controller.cpp +++ b/ur_controllers/src/passthrough_trajectory_controller.cpp @@ -44,6 +44,7 @@ #include #include +#include #include #include @@ -327,8 +328,12 @@ controller_interface::return_type PassthroughTrajectoryController::update(const scaling_factor_ = scaling_state_interface_->get().get_value(); } +#if RCLCPP_VERSION_MAJOR >= 17 active_trajectory_elapsed_time_ += period * scaling_factor_; - +#else + // This is kept for Humble compatibility + active_trajectory_elapsed_time_ = active_trajectory_elapsed_time_ + period * scaling_factor_; +#endif // RCLCPP_INFO(get_node()->get_logger(), "Elapsed trajectory time: %f. Scaling factor: %f, period: %f", // active_trajectory_elapsed_time_.seconds(), scaling_factor_, period.seconds());