Skip to content

Commit

Permalink
Make ur_controllers compileable on humble (#1207)
Browse files Browse the repository at this point in the history
No += overload for Duration class on humble
  • Loading branch information
christophfroehlich authored Dec 17, 2024
1 parent 89eaadb commit 2dcb86e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ur_controllers/src/passthrough_trajectory_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

#include <controller_interface/controller_interface.hpp>
#include <rclcpp/logging.hpp>
#include <rclcpp/version.h>
#include <builtin_interfaces/msg/duration.hpp>
#include <lifecycle_msgs/msg/state.hpp>

Expand Down Expand Up @@ -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());

Expand Down

0 comments on commit 2dcb86e

Please sign in to comment.