diff --git a/rclcpp/include/rclcpp/timer.hpp b/rclcpp/include/rclcpp/timer.hpp index 9632a86..d70a2e9 100644 --- a/rclcpp/include/rclcpp/timer.hpp +++ b/rclcpp/include/rclcpp/timer.hpp @@ -84,10 +84,11 @@ using TimerCallbackType = std::function; /// Generic timer templated on the clock type. Periodically executes a user-specified callback. template< typename FunctorT, - class Clock = std::chrono::high_resolution_clock, + class Clock, typename std::enable_if< - rclcpp::function_traits::same_arguments::value || - rclcpp::function_traits::same_arguments::value + (rclcpp::function_traits::same_arguments::value || + rclcpp::function_traits::same_arguments::value) && + Clock::is_steady >::type * = nullptr > class GenericTimer : public TimerBase