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

Namespaces

 multi_threaded_executor
 
 single_threaded_executor
 

Functions

template<typename ResponseT , 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< int64_t, TimeT > timeout=std::chrono::duration< int64_t, TimeT >(-1))
 Spin (blocking) until the future is complete, it times out waiting, or rclcpp is interrupted. More...
 
template<typename NodeT = rclcpp::node::Node, typename ResponseT , 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< int64_t, TimeT > timeout=std::chrono::duration< int64_t, TimeT >(-1))
 

Function Documentation

◆ spin_node_until_future_complete() [1/2]

template<typename ResponseT , 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< int64_t, TimeT >  timeout = std::chrono::duration<int64_t, 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::Node, typename ResponseT , 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< int64_t, TimeT >  timeout = std::chrono::duration<int64_t, TimeT>(-1) 
)