Function rmw_service_server_is_available
Defined in File rmw.h
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
nodemust be a valid node, as returned by rmw_create_node().- Pre:
Given
clientmust be a valid client, as returned by rmw_create_client().- Pre:
Given
nodemust be the one theclientwas registered with.- Returns:
RMW_RET_OKif successful, or- Returns:
RMW_RET_INVALID_ARGUMENTifnodeisNULL, or- Returns:
RMW_RET_INVALID_ARGUMENTifclientisNULL, or- Returns:
RMW_RET_INVALID_ARGUMENTifis_availableisNULL, or- Returns:
RMW_RET_INCORRECT_RMW_IMPLEMENTATIONif the implementation identifier ofnodeorclientdoes not match this implementation, or- Returns:
RMW_RET_ERRORif an unspecified error occurs.