Skip to content

Commit f53bb71

Browse files
No += overload for Duration class on humble
1 parent a8e0b80 commit f53bb71

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ur_controllers/src/passthrough_trajectory_controller.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444

4545
#include <controller_interface/controller_interface.hpp>
4646
#include <rclcpp/logging.hpp>
47+
#include <rclcpp/version.h>
4748
#include <builtin_interfaces/msg/duration.hpp>
4849
#include <lifecycle_msgs/msg/state.hpp>
4950

@@ -327,8 +328,11 @@ controller_interface::return_type PassthroughTrajectoryController::update(const
327328
scaling_factor_ = scaling_state_interface_->get().get_value();
328329
}
329330

331+
#if RCLCPP_VERSION_MAJOR >= 17
330332
active_trajectory_elapsed_time_ += period * scaling_factor_;
331-
333+
#else
334+
active_trajectory_elapsed_time_ = active_trajectory_elapsed_time_ + period * scaling_factor_;
335+
#endif
332336
// RCLCPP_INFO(get_node()->get_logger(), "Elapsed trajectory time: %f. Scaling factor: %f, period: %f",
333337
// active_trajectory_elapsed_time_.seconds(), scaling_factor_, period.seconds());
334338

0 commit comments

Comments
 (0)