15 #include "rclcpp/node_interfaces/node_timers.hpp"
19 #include "tracetools/tracetools.h"
24 : node_base_(node_base)
27 NodeTimers::~NodeTimers()
32 rclcpp::TimerBase::SharedPtr timer,
33 rclcpp::CallbackGroup::SharedPtr callback_group)
42 callback_group->add_timer(timer);
46 callback_group->trigger_notify_guard_condition();
48 throw std::runtime_error(
49 std::string(
"failed to notify wait set on timer creation: ") + ex.what());
52 TRACETOOLS_TRACEPOINT(
53 rclcpp_timer_link_node,
54 static_cast<const void *
>(timer->get_timer_handle().get()),
Thrown when a callback group is missing from the node, when it wants to utilize the group.
Created when the return code does not match one of the other specialized exceptions.
Pure virtual interface class for the NodeBase part of the Node API.
virtual RCLCPP_PUBLIC void trigger_notify_guard_condition()=0
Trigger the guard condition that notifies of internal node state changes.
virtual RCLCPP_PUBLIC bool callback_group_in_node(rclcpp::CallbackGroup::SharedPtr group)=0
Return true if the given callback group is associated with this node.
virtual RCLCPP_PUBLIC rclcpp::CallbackGroup::SharedPtr get_default_callback_group()=0
Return the default callback group.
virtual RCLCPP_PUBLIC rcl_node_t * get_rcl_node_handle()=0
Return the rcl_node_t node handle (non-const version).
Implementation of the NodeTimers part of the Node API.
RCLCPP_PUBLIC void add_timer(rclcpp::TimerBase::SharedPtr timer, rclcpp::CallbackGroup::SharedPtr callback_group) override
Add a timer to the node.