rmw
master
C API providing a middleware abstraction layer which is used to implement the rest of ROS.
|
Go to the source code of this file.
Functions | |
rmw_ret_t | rmw_get_publishers_info_by_topic (const rmw_node_t *node, rcutils_allocator_t *allocator, const char *topic_name, bool no_mangle, rmw_topic_endpoint_info_array_t *publishers_info) |
Retrieve the information for all publishers to a given topic. More... | |
rmw_ret_t | rmw_get_subscriptions_info_by_topic (const rmw_node_t *node, rcutils_allocator_t *allocator, const char *topic_name, bool no_mangle, rmw_topic_endpoint_info_array_t *subscriptions_info) |
Retrieve the information for all subscriptions to a given topic. More... | |
rmw_ret_t rmw_get_publishers_info_by_topic | ( | const rmw_node_t * | node, |
rcutils_allocator_t * | allocator, | ||
const char * | topic_name, | ||
bool | no_mangle, | ||
rmw_topic_endpoint_info_array_t * | publishers_info | ||
) |
Retrieve the information for all publishers to a given topic.
The retrieved information will contain the publisher's node name, node namespace, associated topic type, publisher gid and qos profile.
The node parameter must not be NULL
and must point to a valid node.
The topic_name parameter must not be NULL
and must follow the topic naming rules mentioned at http://design.ros2.org/articles/topic_and_service_names.html Names of non-existent topics are allowed. In that case, this function will return an empty array.
It is the responsibility of the caller to ensure that publishers_info
parameter points to a valid struct of type rmw_topic_endpoint_info_array_t. The rmw_topic_endpoint_info_array_t struct must be zero initialized.
The allocator
will be used to allocate memory to the info_array
member inside of publishers_info
. Moreover, every const char *
member inside of rmw_topic_endpoint_info_t will be assigned a copied value on allocated memory.
publishers_info
to avoid leaking memory. [in] | node | the handle to the node being used to query the ROS graph. |
[in] | allocator | the allocator to be used when allocating space for the array. |
[in] | topic_name | the name of the topic for which the list of publishers will be retrieved. |
[in] | no_mangle | if true, the topic name will not be mangled. |
[out] | publishers_info | an array of rmw_topic_endpoint_info_t. |
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_ret_t rmw_get_subscriptions_info_by_topic | ( | const rmw_node_t * | node, |
rcutils_allocator_t * | allocator, | ||
const char * | topic_name, | ||
bool | no_mangle, | ||
rmw_topic_endpoint_info_array_t * | subscriptions_info | ||
) |
Retrieve the information for all subscriptions to a given topic.
The retrieved information will contain the subscriptions's node name, node namespace, associated topic type, subscription gid and qos profile.
The node parameter must not be NULL
and must point to a valid node.
The topic_name parameter must not be NULL
and must follow the topic naming rules mentioned at http://design.ros2.org/articles/topic_and_service_names.html Names of non-existent topics are allowed. They will return an empty array.
It is the responsibility of the caller to ensure that subscriptions_info
parameter points to a valid struct of type rmw_topic_endpoint_info_array_t. The rmw_topic_endpoint_info_array_t struct must be zero initialized.
The allocator
will be used to allocate memory to the info_array
member inside of publishers_info
. Moreover, every const char *
member inside of rmw_topic_endpoint_info_t will be assigned a copied value on allocated memory.
publishers_info
to avoid leaking memory. [in] | node | the handle to the node being used to query the ROS graph. |
[in] | allocator | the allocator to be used when allocating space for the array. |
[in] | topic_name | the name of the topic for which the list of subscriptions will be retrieved. |
[in] | no_mangle | if true, the topic name will not be mangled. |
[out] | subscriptions_info | an array of rmw_topic_endpoint_info_t.. |
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.