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 || rclcpp::function_traits::same_arguments<FunctorT, TimerInfoCallbackType>::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.
autostart – timer state on initialization
-
inline virtual ~GenericTimer()
Default destructor.
-
inline virtual std::shared_ptr<void> call() override
See also
- Throws:
std::runtime_error – if it failed to notify timer that callback will occurr
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(const rcl_timer_call_info_t&)
-
template<typename CallbackT = FunctorT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, TimerCallbackType>::value>::type* = nullptr>
inline void execute_callback_delegate(const rcl_timer_call_info_t&)
-
template<typename CallbackT = FunctorT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, TimerInfoCallbackType>::value>::type* = nullptr>
inline void execute_callback_delegate(const rcl_timer_call_info_t &timer_call_info)
-
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.