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());