15 #ifndef NAV2_ROS_COMMON__NODE_THREAD_HPP_
16 #define NAV2_ROS_COMMON__NODE_THREAD_HPP_
20 #include "rclcpp/rclcpp.hpp"
36 rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_base)
39 executor_ = std::make_shared<rclcpp::executors::SingleThreadedExecutor>();
40 thread_ = std::make_unique<std::thread>(
43 executor_->add_node(node_);
45 executor_->remove_node(node_);
54 rclcpp::executors::SingleThreadedExecutor::SharedPtr executor)
57 thread_ = std::make_unique<std::thread>(
67 template<
typename NodeT>
82 rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_;
83 std::unique_ptr<std::thread> thread_;
84 rclcpp::Executor::SharedPtr executor_;
A background thread to process node/executor callbacks.
~NodeThread()
A destructor.
NodeThread(rclcpp::executors::SingleThreadedExecutor::SharedPtr executor)
A background thread to process executor's callbacks constructor.
NodeThread(rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_base)
A background thread to process node callbacks constructor.
NodeThread(NodeT node)
A background thread to process node callbacks constructor.