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 apis to retrieve service/client QoS #26

Open
wants to merge 1 commit into
base: irobot/add-events-executor
Choose a base branch
from
Open
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
76 changes: 76 additions & 0 deletions rmw/include/rmw/rmw.h
Original file line number Diff line number Diff line change
Expand Up @@ -2020,6 +2020,44 @@ rmw_take_response(
void * ros_response,
bool * taken);

/// Retrieve the actual qos settings of the client.
/**
* Query the underlying middleware to determine the qos settings
* of the client.
* The actual configuration applied when using RMW_*_SYSTEM_DEFAULT
* can only be resolved after the creation of the client, 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.
*
* \note The value of avoid_ros_namespace_conventions field is not resolved
* with this function. The rcl function `rcl_client_get_actual_qos()`
* resolves it.
*
* <hr>
* Attribute | Adherence
* ------------------ | -------------
* Allocates Memory | Maybe [1]
* Thread-Safe | No
* Uses Atomics | Maybe [1]
* Lock-Free | Maybe [1]
* <i>[1] rmw implementation defined, check the implementation documentation</i>
*
* \param[in] client the client 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_INCORRECT_RMW_IMPLEMENTATION` if client
* implementation identifier does not match, or
* \return `RMW_RET_ERROR` if an unexpected error occurs.
*/
RMW_PUBLIC
RMW_WARN_UNUSED
rmw_ret_t
rmw_client_get_actual_qos(
const rmw_client_t * client,
rmw_qos_profile_t * qos);

/// Create a service server that can receive requests from and send replies to a service client.
/**
* This function can fail, and therefore return `NULL`, if:
Expand Down Expand Up @@ -2250,6 +2288,44 @@ rmw_send_response(
rmw_request_id_t * request_header,
void * ros_response);

/// Retrieve the actual qos settings of the service.
/**
* Query the underlying middleware to determine the qos settings
* of the service.
* The actual configuration applied when using RMW_*_SYSTEM_DEFAULT
* can only be resolved after the creation of the service, 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.
*
* \note The value of avoid_ros_namespace_conventions field is not resolved
* with this function. The rcl function `rcl_service_get_actual_qos()`
* resolves it.
*
* <hr>
* Attribute | Adherence
* ------------------ | -------------
* Allocates Memory | Maybe [1]
* Thread-Safe | No
* Uses Atomics | Maybe [1]
* Lock-Free | Maybe [1]
* <i>[1] rmw implementation defined, check the implementation documentation</i>
*
* \param[in] service the service 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_INCORRECT_RMW_IMPLEMENTATION` if service
* implementation identifier does not match, or
* \return `RMW_RET_ERROR` if an unexpected error occurs.
*/
RMW_PUBLIC
RMW_WARN_UNUSED
rmw_ret_t
rmw_service_get_actual_qos(
const rmw_service_t * service,
rmw_qos_profile_t * qos);

// TODO(wjwwood): refactor this API to return a return code when updated to use an allocator
/// Create a guard condition and return a handle to that guard condition.
/**
Expand Down