rclcpp  master
C++ ROS Client Library API
Classes | Functions
rclcpp::executors Namespace Reference

Classes

class  MultiThreadedExecutor
 
class  SingleThreadedExecutor
 Single-threaded executor implementation. More...
 

Functions

template<typename ResponseT , typename TimeRepT = int64_t, typename TimeT = std::milli>
rclcpp::executor::FutureReturnCode spin_node_until_future_complete (rclcpp::executor::Executor &executor, rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr, std::shared_future< ResponseT > &future, std::chrono::duration< TimeRepT, TimeT > timeout=std::chrono::duration< TimeRepT, TimeT >(-1))
 Spin (blocking) until the future is complete, it times out waiting, or rclcpp is interrupted. More...
 
template<typename NodeT = rclcpp::Node, typename ResponseT , typename TimeRepT = int64_t, typename TimeT = std::milli>
rclcpp::executor::FutureReturnCode spin_node_until_future_complete (rclcpp::executor::Executor &executor, std::shared_ptr< NodeT > node_ptr, std::shared_future< ResponseT > &future, std::chrono::duration< TimeRepT, TimeT > timeout=std::chrono::duration< TimeRepT, TimeT >(-1))
 

Function Documentation

◆ spin_node_until_future_complete() [1/2]

template<typename ResponseT , typename TimeRepT = int64_t, typename TimeT = std::milli>
rclcpp::executor::FutureReturnCode rclcpp::executors::spin_node_until_future_complete ( rclcpp::executor::Executor executor,
rclcpp::node_interfaces::NodeBaseInterface::SharedPtr  node_ptr,
std::shared_future< ResponseT > &  future,
std::chrono::duration< TimeRepT, TimeT >  timeout = std::chrono::duration<TimeRepT, TimeT>(-1) 
)

Spin (blocking) until the future is complete, it times out waiting, or rclcpp is interrupted.

Parameters
[in]executorThe executor which will spin the node.
[in]node_ptrThe node to spin.
[in]futureThe future to wait on. If SUCCESS, the future is safe to access after this function
[in]timeoutOptional timeout parameter, which gets passed to Executor::spin_node_once. -1 is block forever, 0 is non-blocking. If the time spent inside the blocking loop exceeds this timeout, return a TIMEOUT return code.
Returns
The return code, one of SUCCESS, INTERRUPTED, or TIMEOUT.

◆ spin_node_until_future_complete() [2/2]

template<typename NodeT = rclcpp::Node, typename ResponseT , typename TimeRepT = int64_t, typename TimeT = std::milli>
rclcpp::executor::FutureReturnCode rclcpp::executors::spin_node_until_future_complete ( rclcpp::executor::Executor executor,
std::shared_ptr< NodeT >  node_ptr,
std::shared_future< ResponseT > &  future,
std::chrono::duration< TimeRepT, TimeT >  timeout = std::chrono::duration<TimeRepT, TimeT>(-1) 
)