From 2250b3eee645d90f9e9d6c96d71ce3aada9944f3 Mon Sep 17 00:00:00 2001 From: "M. M" Date: Wed, 12 Jun 2019 08:50:55 -0700 Subject: [PATCH] add get_actual_qos() feature to subscriptions (#177) Signed-off-by: Miaofei --- rmw/include/rmw/rmw.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/rmw/include/rmw/rmw.h b/rmw/include/rmw/rmw.h index 22480511..3b0826fe 100644 --- a/rmw/include/rmw/rmw.h +++ b/rmw/include/rmw/rmw.h @@ -539,6 +539,32 @@ rmw_subscription_count_matched_publishers( const rmw_subscription_t * subscription, size_t * publisher_count); +/// Retrieve the actual qos settings of the subscription. +/** + * Query the underlying middleware to determine the qos settings + * of the subscription. + * The actual configuration applied when using RMW_*_SYSTEM_DEFAULT + * can only be resolved after the creation of the subscription, and it + * depends on the underlying rmw implementation. + * If the underlying setting in use can't be represented in ROS terms, + * it will be set to RMW_*_UNKNOWN. + * The value of avoid_ros_namespace_conventions field is not resolved + * with this function. The rcl function rcl_subscription_get_actual_qos + * resolves it. + * + * \param[in] subscription the subscription object to inspect + * \param[out] qos the actual qos settings + * \return `RMW_RET_OK` if successful, or + * \return `RMW_RET_INVALID_ARGUMENT` if either argument is null, or + * \return `RMW_RET_ERROR` if an unexpected error occurs. + */ +RMW_PUBLIC +RMW_WARN_UNUSED +rmw_ret_t +rmw_subscription_get_actual_qos( + const rmw_subscription_t * subscription, + rmw_qos_profile_t * qos); + /// Take an incoming message from a subscription. /** * Take an incoming ROS message from a given subscription.