Template Function rclcpp::executors::spin_node_until_future_complete(rclcpp::Executor&, rclcpp::node_interfaces::NodeBaseInterface::SharedPtr, const FutureT&, std::chrono::duration<TimeRepT, TimeT>)

Function Documentation

template<typename FutureT, typename TimeRepT = int64_t, typename TimeT = std::milli>
rclcpp::FutureReturnCode rclcpp::executors::spin_node_until_future_complete(rclcpp::Executor &executor, rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr, const FutureT &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:
  • executor[in] The executor which will spin the node.

  • node_ptr[in] The node to spin.

  • future[in] The future to wait on. If SUCCESS, the future is safe to access after this function

  • timeout[in] Optional 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.