Function rcl_wait_for_clients

Function Documentation

rcl_ret_t rcl_wait_for_clients(const rcl_node_t *node, rcl_allocator_t *allocator, const char *service_name, const size_t count, rcutils_duration_value_t timeout, bool *success)

Wait for there to be a specified number of clients on a given service.

Attribute

Adherence

Allocates Memory

Yes

Thread-Safe

No

Uses Atomics

No

Lock-Free

Maybe [1]

[1] implementation may need to protect the data structure with a lock

Parameters:
  • node[in] the handle to the node being used to query the ROS graph

  • allocator[in] to allocate space for the rcl_wait_set_t used to wait for graph events

  • service_name[in] the name of the service in question

  • count[in] number of clients to wait for

  • timeout[in] maximum duration to wait for clients

  • success[out] true if the number of clients is equal to or greater than count, or false if a timeout occurred waiting for clients.

Returns:

RCL_RET_OK if there was no errors, or

Returns:

RCL_RET_NODE_INVALID if the node is invalid, or

Returns:

RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or

Returns:

RCL_RET_TIMEOUT if a timeout occurs before the number of clients is detected, or

Returns:

RCL_RET_ERROR if an unspecified error occurred.