15 #ifndef RCLCPP__EXPERIMENTAL__EXECUTORS__EVENTS_EXECUTOR__EVENTS_EXECUTOR_HPP_
16 #define RCLCPP__EXPERIMENTAL__EXECUTORS__EVENTS_EXECUTOR__EVENTS_EXECUTOR_HPP_
23 #include "rclcpp/executor.hpp"
24 #include "rclcpp/executors/executor_entities_collection.hpp"
25 #include "rclcpp/executors/executor_entities_collector.hpp"
26 #include "rclcpp/experimental/executors/events_executor/events_executor_event_types.hpp"
27 #include "rclcpp/experimental/executors/events_executor/events_queue.hpp"
28 #include "rclcpp/experimental/executors/events_executor/simple_events_queue.hpp"
29 #include "rclcpp/experimental/timers_manager.hpp"
33 namespace experimental
61 "rclcpp::experimental::executors::EventsExecutor is deprecated and will be removed in "
62 "m-turtle. use rclcpp::executors::EventsCBGExecutor in single-threaded mode instead")]]
78 rclcpp::experimental::executors::EventsQueue::UniquePtr events_queue = std::make_unique<
80 bool execute_timers_separate_thread =
false);
112 spin_some(std::chrono::nanoseconds max_duration = std::chrono::nanoseconds(0))
override;
130 spin_all(std::chrono::nanoseconds max_duration)
override;
136 spin_once_impl(std::chrono::nanoseconds timeout)
override;
141 spin_some_impl(std::chrono::nanoseconds max_duration,
bool exhaustive);
146 handle_updated_entities(
bool notify)
override;
157 setup_notify_waitable();
164 std::function<void(
size_t)>
165 create_entity_callback(
void * entity_key, ExecutorEventType type);
168 std::function<void(
size_t,
int)>
173 add_notify_waitable_to_collection(
177 template<
typename CollectionType>
178 typename CollectionType::EntitySharedPtr
179 retrieve_entity(
typename CollectionType::Key entity_id, CollectionType & collection)
184 std::lock_guard<std::mutex> guard(mutex_);
187 auto it = collection.find(entity_id);
188 if (it == collection.end()) {
194 auto entity = it->second.entity.lock();
196 collection.erase(it);
204 rclcpp::experimental::executors::EventsQueue::UniquePtr events_queue_;
207 std::shared_ptr<rclcpp::experimental::TimersManager> timers_manager_;
Coordinate the order and timing of available communication tasks.
Events executor implementation.
This class implements an EventsQueue as a simple wrapper around a std::queue. It does not perform any...
Versions of rosidl_typesupport_cpp::get_message_type_support_handle that handle adapted types.
RCLCPP_PUBLIC void spin_some(const rclcpp::node_interfaces::NodeBaseInterface::SharedPtr &node_ptr)
Create a default single-threaded executor and execute any immediately available work.
RCLCPP_PUBLIC void spin(const rclcpp::node_interfaces::NodeBaseInterface::SharedPtr &node_ptr)
Create a default single-threaded executor and spin the specified node.
RCLCPP_PUBLIC void spin_all(const rclcpp::node_interfaces::NodeBaseInterface::SharedPtr &node_ptr, std::chrono::nanoseconds max_duration)
Create a default single-threaded executor and execute all available work exhaustively.
Options to be passed to the executor constructor.
Represent the total set of entities for a single executor.