Template Class GenericTimer
Defined in File timer.hpp
Inheritance Relationships
Base Type
public rclcpp::TimerBase
(Class TimerBase)
Derived Type
public rclcpp::WallTimer< FunctorT, >
(Template Class WallTimer)
Class Documentation
-
template<typename FunctorT, typename std::enable_if<rclcpp::function_traits::same_arguments<FunctorT, VoidCallbackType>::value || rclcpp::function_traits::same_arguments<FunctorT, TimerCallbackType>::value>::type* = nullptr>
class GenericTimer : public rclcpp::TimerBase Generic timer. Periodically executes a user-specified callback.
Subclassed by rclcpp::WallTimer< FunctorT, >
Public Functions
Default constructor.
- Parameters:
clock – [in] The clock providing the current time.
period – [in] The interval at which the timer fires.
callback – [in] User-specified callback function.
context – [in] custom context to be used.
-
inline virtual ~GenericTimer()
Default destructor.
-
inline virtual bool call() override
See also
- Throws:
std::runtime_error – if it failed to notify timer that callback will occurr
-
inline virtual void execute_callback() override
See also
-
template<typename CallbackT = FunctorT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, VoidCallbackType>::value>::type* = nullptr>
inline void execute_callback_delegate()
-
template<typename CallbackT = FunctorT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, TimerCallbackType>::value>::type* = nullptr>
inline void execute_callback_delegate()
-
inline virtual bool is_steady() override
Is the clock steady (i.e. is the time between ticks constant?)
- Returns:
True if the clock used by this timer is steady.