rmw  master
C API providing a middleware abstraction layer which is used to implement the rest of ROS.
Functions
get_node_info_and_types.h File Reference
#include "rmw/macros.h"
#include "rmw/names_and_types.h"
#include "rmw/types.h"
#include "rmw/visibility_control.h"
Include dependency graph for get_node_info_and_types.h:

Go to the source code of this file.

Functions

rmw_ret_t rmw_get_subscriber_names_and_types_by_node (const rmw_node_t *node, rcutils_allocator_t *allocator, const char *node_name, const char *node_namespace, bool demangle, rmw_names_and_types_t *topics_names_and_types)
 Return a list of subscribed topic names and their types. More...
 
rmw_ret_t rmw_get_publisher_names_and_types_by_node (const rmw_node_t *node, rcutils_allocator_t *allocator, const char *node_name, const char *node_namespace, bool demangle, rmw_names_and_types_t *topic_names_and_types)
 Return a list of published topic names and their types. More...
 
rmw_ret_t rmw_get_service_names_and_types_by_node (const rmw_node_t *node, rcutils_allocator_t *allocator, const char *node_name, const char *node_namespace, rmw_names_and_types_t *service_names_and_types)
 Return a list of service topic names and their types. More...
 

Function Documentation

◆ rmw_get_subscriber_names_and_types_by_node()

rmw_ret_t rmw_get_subscriber_names_and_types_by_node ( const rmw_node_t node,
rcutils_allocator_t allocator,
const char *  node_name,
const char *  node_namespace,
bool  demangle,
rmw_names_and_types_t topics_names_and_types 
)

Return a list of subscribed topic names and their types.

This function returns a list of subscribed topic names and their types.

The node parameter must not be NULL, and must point to a valid node.

The topic_names_and_types parameter must be allocated and zero initialized. The topic_names_and_types is the output for this function, and contains allocated memory. Therefore, it should be passed to rmw_names_and_types_fini() when it is no longer needed. Failing to do so will result in leaked memory.

Parameters
[in]nodethe handle to the node being used to query the ROS graph
[in]allocatorallocator to be used when allocating space for strings
[in]node_namethe name of the node to get information for
[in]node_namespacethe namespace of the node to get information for
[in]no_demangleif true, list all topics without any demangling
[out]topic_names_and_typeslist of topic names and their types the node_name is subscribed to
Returns
RMW_RET_OK if the query was successful, or
RMW_RET_INVALID_ARGUMENT if the node is invalid, or
RMW_RET_INVALID_ARGUMENT if any arguments are invalid, or
RMW_RET_BAD_ALLOC if memory allocation fails, or
RMW_RET_ERROR if an unspecified error occurs.

◆ rmw_get_publisher_names_and_types_by_node()

rmw_ret_t rmw_get_publisher_names_and_types_by_node ( const rmw_node_t node,
rcutils_allocator_t allocator,
const char *  node_name,
const char *  node_namespace,
bool  demangle,
rmw_names_and_types_t topic_names_and_types 
)

Return a list of published topic names and their types.

This function returns a list of published topic names and their types.

The node parameter must not be NULL, and must point to a valid node.

The topic_names_and_types parameter must be allocated and zero initialized. The topic_names_and_types is the output for this function, and contains allocated memory. Therefore, it should be passed to rmw_names_and_types_fini() when it is no longer needed. Failing to do so will result in leaked memory.

Parameters
[in]nodethe handle to the node being used to query the ROS graph
[in]allocatorallocator to be used when allocating space for strings
[in]node_namethe name of the node to get information for
[in]node_namespacethe namespace of the node to get information for
[in]no_demangleif true, list all topics without any demangling
[out]topic_names_and_typeslist of topic names and their types the node_name is publishing
Returns
RMW_RET_OK if the query was successful, or
RMW_RET_INVALID_ARGUMENT if the node is invalid, or
RMW_RET_INVALID_ARGUMENT if any arguments are invalid, or
RMW_RET_BAD_ALLOC if memory allocation fails, or
RMW_RET_ERROR if an unspecified error occurs.

◆ rmw_get_service_names_and_types_by_node()

rmw_ret_t rmw_get_service_names_and_types_by_node ( const rmw_node_t node,
rcutils_allocator_t allocator,
const char *  node_name,
const char *  node_namespace,
rmw_names_and_types_t service_names_and_types 
)

Return a list of service topic names and their types.

This function returns a list of service topic names and their types.

The node parameter must not be NULL, and must point to a valid node.

The topic_names_and_types parameter must be allocated and zero initialized. The topic_names_and_types is the output for this function, and contains allocated memory. Therefore, it should be passed to rmw_names_and_types_fini() when it is no longer needed. Failing to do so will result in leaked memory.

Parameters
[in]nodethe handle to the node being used to query the ROS graph
[in]allocatorallocator to be used when allocating space for strings
[in]node_namethe name of the node to get information for
[in]node_namespacethe namespace of the node to get information for
[out]topic_names_and_typeslist of topic names and their types the node_name has created a service for
Returns
RMW_RET_OK if the query was successful, or
RMW_RET_INVALID_ARGUMENT if the node is invalid, or
RMW_RET_INVALID_ARGUMENT if any arguments are invalid, or
RMW_RET_BAD_ALLOC if memory allocation fails, or
RMW_RET_ERROR if an unspecified error occurs.