Only enable Timer if clock type is steady
This commit is contained in:
		
							parent
							
								
									02311dee4c
								
							
						
					
					
						commit
						e7833fa709
					
				
					 1 changed files with 4 additions and 3 deletions
				
			
		| 
						 | 
					@ -84,10 +84,11 @@ using TimerCallbackType = std::function<void(TimerBase &)>;
 | 
				
			||||||
/// Generic timer templated on the clock type. Periodically executes a user-specified callback.
 | 
					/// Generic timer templated on the clock type. Periodically executes a user-specified callback.
 | 
				
			||||||
template<
 | 
					template<
 | 
				
			||||||
  typename FunctorT,
 | 
					  typename FunctorT,
 | 
				
			||||||
  class Clock = std::chrono::high_resolution_clock,
 | 
					  class Clock,
 | 
				
			||||||
  typename std::enable_if<
 | 
					  typename std::enable_if<
 | 
				
			||||||
    rclcpp::function_traits::same_arguments<FunctorT, VoidCallbackType>::value ||
 | 
					    (rclcpp::function_traits::same_arguments<FunctorT, VoidCallbackType>::value ||
 | 
				
			||||||
    rclcpp::function_traits::same_arguments<FunctorT, TimerCallbackType>::value
 | 
					    rclcpp::function_traits::same_arguments<FunctorT, TimerCallbackType>::value) &&
 | 
				
			||||||
 | 
					    Clock::is_steady
 | 
				
			||||||
  >::type * = nullptr
 | 
					  >::type * = nullptr
 | 
				
			||||||
>
 | 
					>
 | 
				
			||||||
class GenericTimer : public TimerBase
 | 
					class GenericTimer : public TimerBase
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue