Function rmw_service_server_is_available

Function Documentation

rmw_ret_t rmw_service_server_is_available(const rmw_node_t *node, const rmw_client_t *client, bool *is_available)

Check if a service server is available for the given service client.

This function checks whether one or more service services matching the given service client exist in the ROS graph, as discovered so far by the given local node.

Attribute

Adherence

Allocates Memory

No

Thread-Safe

Yes

Uses Atomics

Maybe [1]

Lock-Free

Maybe [1]

[1] implementation defined, check implementation documentation.

Runtime behavior

To query the ROS graph is a synchronous operation. It is also non-blocking, but it is not guaranteed to be lock-free. Generally speaking, implementations may synchronize access to internal resources using locks but are not allowed to wait for events with no guaranteed time bound (barring the effects of starvation due to OS scheduling).

Parameters:
  • node[in] Node to query the ROS graph.

  • client[in] Service client to look for matching service servers.

  • is_available[out] True if there is a service server available, else false.

Pre:

Given node must be a valid node, as returned by rmw_create_node().

Pre:

Given client must be a valid client, as returned by rmw_create_client().

Pre:

Given node must be the one the client was registered with.

Returns:

RMW_RET_OK if successful, or

Returns:

RMW_RET_INVALID_ARGUMENT if node is NULL, or

Returns:

RMW_RET_INVALID_ARGUMENT if client is NULL, or

Returns:

RMW_RET_INVALID_ARGUMENT if is_available is NULL, or

Returns:

RMW_RET_INCORRECT_RMW_IMPLEMENTATION if the implementation identifier of node or client does not match this implementation, or

Returns:

RMW_RET_ERROR if an unspecified error occurs.