Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function to get publisher actual qos settings #169

Merged
merged 2 commits into from
Apr 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions rmw/include/rmw/rmw.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,32 @@ rmw_publisher_count_matched_subscriptions(
const rmw_publisher_t * publisher,
size_t * subscription_count);

/// Retrieve the actual qos settings of the publisher.
/**
* Query the underlying middleware to determine the qos settings
* of the publisher.
* The actual configuration applied when using RMW_*_SYSTEM_DEFAULT
* can only be resolved after the creation of the publisher, 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_publisher_get_actual_qos
* resolves it.
*
* \param[in] publisher the publisher 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_publisher_get_actual_qos(
const rmw_publisher_t * publisher,
rmw_qos_profile_t * qos);

/// Publish an already serialized message.
/**
* The publisher must already be registered with the correct message type
Expand Down
9 changes: 6 additions & 3 deletions rmw/include/rmw/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,21 +175,24 @@ enum RMW_PUBLIC_TYPE rmw_qos_reliability_policy_t
{
RMW_QOS_POLICY_RELIABILITY_SYSTEM_DEFAULT,
RMW_QOS_POLICY_RELIABILITY_RELIABLE,
RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT
RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT,
RMW_QOS_POLICY_RELIABILITY_UNKNOWN
};

enum RMW_PUBLIC_TYPE rmw_qos_history_policy_t
{
RMW_QOS_POLICY_HISTORY_SYSTEM_DEFAULT,
RMW_QOS_POLICY_HISTORY_KEEP_LAST,
RMW_QOS_POLICY_HISTORY_KEEP_ALL
RMW_QOS_POLICY_HISTORY_KEEP_ALL,
RMW_QOS_POLICY_HISTORY_UNKNOWN
};

enum RMW_PUBLIC_TYPE rmw_qos_durability_policy_t
{
RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT,
RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL,
RMW_QOS_POLICY_DURABILITY_VOLATILE
RMW_QOS_POLICY_DURABILITY_VOLATILE,
RMW_QOS_POLICY_DURABILITY_UNKNOWN
};

/// ROS MiddleWare quality of service profile.
Expand Down