Skip to content

Commit b5f3dcc

Browse files
committed
Add function for getting clients by node
Signed-off-by: Jacob Perron <[email protected]>
1 parent f9c6283 commit b5f3dcc

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

rmw/include/rmw/get_node_info_and_types.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,41 @@ rmw_get_client_names_and_types_by_node(
166166
const char * node_namespace,
167167
rmw_names_and_types_t * service_names_and_types);
168168

169+
/// Return a list of service client topic names and their types.
170+
/**
171+
* This function returns a list of service client topic names and their types.
172+
*
173+
* The node parameter must not be `NULL`, and must point to a valid node.
174+
*
175+
* The topic_names_and_types parameter must be allocated and zero initialized.
176+
* The topic_names_and_types is the output for this function, and contains
177+
* allocated memory.
178+
* Therefore, it should be passed to rmw_names_and_types_fini() when
179+
* it is no longer needed.
180+
* Failing to do so will result in leaked memory.
181+
*
182+
* \param[in] node the handle to the node being used to query the ROS graph
183+
* \param[in] allocator allocator to be used when allocating space for strings
184+
* \param[in] node_name the name of the node to get information for
185+
* \param[in] node_namespace the namespace of the node to get information for
186+
* \param[out] topic_names_and_types list of topic names and their types the
187+
* node_name has created a service client for
188+
* \return `RMW_RET_OK` if the query was successful, or
189+
* \return `RMW_RET_INVALID_ARGUMENT` if the node is invalid, or
190+
* \return `RMW_RET_INVALID_ARGUMENT` if any arguments are invalid, or
191+
* \return `RMW_RET_BAD_ALLOC` if memory allocation fails, or
192+
* \return `RMW_RET_ERROR` if an unspecified error occurs.
193+
*/
194+
RMW_PUBLIC
195+
RMW_WARN_UNUSED
196+
rmw_ret_t
197+
rmw_get_client_names_and_types_by_node(
198+
const rmw_node_t * node,
199+
rcutils_allocator_t * allocator,
200+
const char * node_name,
201+
const char * node_namespace,
202+
rmw_names_and_types_t * service_names_and_types);
203+
169204
#ifdef __cplusplus
170205
}
171206
#endif

0 commit comments

Comments
 (0)