Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into irobot/add-rmw-li…
Browse files Browse the repository at this point in the history
…stener-apis
  • Loading branch information
Alberto Soragna committed Feb 9, 2022
2 parents 3bbdf0b + 95053f3 commit b56702c
Show file tree
Hide file tree
Showing 24 changed files with 807 additions and 292 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ variables.
- [RMW_CONNEXT_ENDPOINT_QOS_OVERRIDE_POLICY](#RMW_CONNEXT_ENDPOINT_QOS_OVERRIDE_POLICY)
- [RMW_CONNEXT_INITIAL_PEERS](#RMW_CONNEXT_INITIAL_PEERS)
- [RMW_CONNEXT_LEGACY_RMW_COMPATIBILITY_MODE](#RMW_CONNEXT_LEGACY_RMW_COMPATIBILITY_MODE)
- [RMW_CONNEXT_PARTICIPANT_QOS_OVERRIDE_POLICY](#RMW_CONNEXT_PARTICIPANT_QOS_OVERRIDE_POLICY)
- [RMW_CONNEXT_REQUEST_REPLY_MAPPING](#RMW_CONNEXT_REQUEST_REPLY_MAPPING)
- [RMW_CONNEXT_UDP_INTERFACE](#RMW_CONNEXT_UDP_INTERFACE)
- [RMW_CONNEXT_USE_DEFAULT_PUBLISH_MODE](#RMW_CONNEXT_USE_DEFAULT_PUBLISH_MODE)
Expand Down Expand Up @@ -276,6 +277,26 @@ In particular, when this mode is enabled, `rmw_connextdds` will revert to adding
a suffix (`_`) to the end of the names of the attributes of the ROS2 data types
propagated via DDS discovery.

### RMW_CONNEXT_PARTICIPANT_QOS_OVERRIDE_POLICY

Control how `rmw_connextdds` will override the default DomainParticipantQos obtained
from Connext.

If this variable is unspecified, or set to `all`, then `rmw_connextdds` will modify
the default DomainParticipantQos with settings derived from ROS 2 options (e.g.
"localhost only", or "node enclave"), and some additional optimizations meant to
improve the out of the box experiene (e.g. speed up endpoint discovery, and increase
the size of type information shared via discovery).

If the variable is set to `basic`, then only those settings associated with ROS 2
options will be modified.

If the variable is set to `never`, then no settings will be modified and the
DomainParticipantQos will be used as is.

Note that values `basic` and `never` will disable the same endpoint discovery
optimizations controlled by [RMW_CONNEXT_DISABLE_FAST_ENDPOINT_DISCOVERY](#RMW_CONNEXT_DISABLE_FAST_ENDPOINT_DISCOVERY).

### RMW_CONNEXT_REQUEST_REPLY_MAPPING

The [DDS-RPC specification](https://www.omg.org/spec/DDS-RPC/About-DDS-RPC/)
Expand Down
19 changes: 19 additions & 0 deletions rmw_connextdds/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@
Changelog for package rmw_connextdds
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.8.2 (2022-01-14)
------------------

0.8.1 (2021-11-19)
------------------
* Add client/service QoS getters. (`#67 <https://github.com/rticommunity/rmw_connextdds/issues/67>`_)
* Contributors: mauropasse

0.8.0 (2021-09-15)
------------------

0.7.0 (2021-06-04)
------------------
* Add rmw_publisher_wait_for_all_acked support. (`#20 <https://github.com/rticommunity/rmw_connextdds/issues/20>`_)
* Contributors: Barry Xu

0.6.1 (2021-04-26)
------------------

0.6.0 (2021-04-11)
------------------
* Use rmw_qos_profile_unknown when adding entity to graph (`#28 <https://github.com/rticommunity/rmw_connextdds/issues/28>`_)
Expand Down
2 changes: 1 addition & 1 deletion rmw_connextdds/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>rmw_connextdds</name>
<version>0.6.0</version>
<version>0.8.2</version>
<description>A ROS2 RMW implementation built with RTI Connext DDS Professional.</description>
<maintainer email="asorbini@rti.com">Andrea Sorbini</maintainer>
<license>Apache License 2.0</license>
Expand Down
51 changes: 51 additions & 0 deletions rmw_connextdds/src/rmw_api_impl_ndds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,17 @@ rmw_publisher_assert_liveliness(
}


rmw_ret_t
rmw_publisher_wait_for_all_acked(
const rmw_publisher_t * publisher,
rmw_time_t wait_timeout
)
{
return rmw_api_connextdds_publisher_wait_for_all_acked(
publisher, wait_timeout);
}


rmw_ret_t
rmw_publisher_get_actual_qos(
const rmw_publisher_t * publisher,
Expand Down Expand Up @@ -563,6 +574,26 @@ rmw_create_client(
}


rmw_ret_t
rmw_client_request_publisher_get_actual_qos(
const rmw_client_t * client,
rmw_qos_profile_t * qos)
{
return rmw_api_connextdds_client_request_publisher_get_actual_qos(
client, qos);
}


rmw_ret_t
rmw_client_response_subscription_get_actual_qos(
const rmw_client_t * client,
rmw_qos_profile_t * qos)
{
return rmw_api_connextdds_client_response_subscription_get_actual_qos(
client, qos);
}


rmw_ret_t
rmw_destroy_client(
rmw_node_t * node,
Expand All @@ -584,6 +615,26 @@ rmw_create_service(
}


rmw_ret_t
rmw_service_response_publisher_get_actual_qos(
const rmw_service_t * service,
rmw_qos_profile_t * qos)
{
return rmw_api_connextdds_service_response_publisher_get_actual_qos(
service, qos);
}


rmw_ret_t
rmw_service_request_subscription_get_actual_qos(
const rmw_service_t * service,
rmw_qos_profile_t * qos)
{
return rmw_api_connextdds_service_request_subscription_get_actual_qos(
service, qos);
}


rmw_ret_t
rmw_destroy_service(
rmw_node_t * node,
Expand Down
32 changes: 32 additions & 0 deletions rmw_connextdds_common/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,38 @@
Changelog for package rmw_connextdds_common
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.8.2 (2022-01-14)
------------------
* Fix cpplint errors (`#69 <https://github.com/ros2/rmw_connextdds/issues/69>`_)
* Contributors: Jacob Perron

0.8.1 (2021-11-19)
------------------
* Add client/service QoS getters. (`#67 <https://github.com/rticommunity/rmw_connextdds/issues/67>`_)
* Contributors: mauropasse

0.8.0 (2021-09-15)
------------------
* Update rmw_context_impl_t definition (`#65 <https://github.com/ros2/rmw_connextdds/issues/65>`_)
* Use the new rmw_dds_common::get_security_files API (`#61 <https://github.com/ros2/rmw_connextdds/issues/61>`_)
* Contributors: Chris Lalancette, Michel Hidalgo

0.7.0 (2021-06-04)
------------------
* Add rmw_publisher_wait_for_all_acked support. (`#20 <https://github.com/rticommunity/rmw_connextdds/issues/20>`_)
* Support extended signature for `message_type_support_callbacks_t::max_serialized_size()` from `rosidl_typesupport_fastrtps_cpp`. (`#14 <https://github.com/rticommunity/rmw_connextdds/issues/14>`_)
* Update includes after rcutils/get_env.h deprecation. (`#55 <https://github.com/rticommunity/rmw_connextdds/issues/55>`_)
* Always modify UserObjectQosPolicy regardless of override policy. (`#53 <https://github.com/rticommunity/rmw_connextdds/issues/53>`_)
* Improved conversion of time values between ROS and DDS formats. (`#43 <https://github.com/rticommunity/rmw_connextdds/issues/43>`_)
* Allow sharing DomainParticipant with C++ applications. (`#25 <https://github.com/rticommunity/rmw_connextdds/issues/25>`_)
* Add environment variable to control override of DomainParticipantQos. (`#41 <https://github.com/rticommunity/rmw_connextdds/issues/41>`_)
* Contributors: Andrea Sorbini, Barry Xu, Christophe Bedard, Miguel Company

0.6.1 (2021-04-26)
------------------
* Correctly detect empty messages (`#33 <https://github.com/rticommunity/rmw_connextdds/issues/33>`_)
* Contributors: Andrea Sorbini

0.6.0 (2021-04-11)
------------------
* Use rmw_qos_profile_unknown when adding entity to graph (`#28 <https://github.com/rticommunity/rmw_connextdds/issues/28>`_)
Expand Down
28 changes: 25 additions & 3 deletions rmw_connextdds_common/include/rmw_connextdds/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ enum class RMW_Connext_RequestReplyMapping
Extended
};

struct rmw_context_impl_t
// Definition of struct rmw_context_impl_s as declared in rmw/init.h
struct rmw_context_impl_s
{
rmw_dds_common::Context common;
rmw_context_t * base;
Expand Down Expand Up @@ -96,6 +97,25 @@ struct rmw_context_impl_t
bool optimize_large_data{true};
#endif /* RMW_CONNEXT_DEFAULT_LARGE_DATA_OPTIMIZATIONS */

enum class participant_qos_override_policy_t
{
// Always override the default DomainParticipantQoS obtained at runtime from
// Connext with RMW-specific configuration. This will include settings derived
// from ROS 2 configuration parameters (e.g. "localhost_only", or "enclave"),
// but also some additional configurations that the RMW performs arbitrarly
// to improve the out of the box experience. Note that some of these customizations
// can also be disabled individually (e.g. fast endpoint discovery).
All,
// Only perform basic modifications on the default DomainParticipantQos value
// based on ROS 2 configuration parameters (e.g. "localhost only", and "enclave").
// All other RMW-specific customizations will not be applied.
Basic,
// Use the default DomainParticipantQoS returned by Connext without any modification.
Never,
};

participant_qos_override_policy_t participant_qos_override_policy;

enum class endpoint_qos_override_policy_t
{
// Use default QoS policy got from the DDS qos profile file applying topic filters
Expand All @@ -113,6 +133,8 @@ struct rmw_context_impl_t
endpoint_qos_override_policy_t endpoint_qos_override_policy;
std::regex endpoint_qos_override_policy_topics_regex;

struct DDS_StringSeq initial_peers = DDS_SEQUENCE_INITIALIZER;

/* Participant reference count*/
size_t node_count{0};
std::mutex initialization_mutex;
Expand All @@ -127,7 +149,7 @@ struct rmw_context_impl_t
std::map<std::string, RMW_Connext_MessageTypeSupport *> registered_types;
std::mutex endpoint_mutex;

explicit rmw_context_impl_t(rmw_context_t * const base)
explicit rmw_context_impl_s(rmw_context_t * const base)
: common(),
base(base),
factory(nullptr),
Expand All @@ -147,7 +169,7 @@ struct rmw_context_impl_t
common.sub = nullptr;
}

~rmw_context_impl_t()
~rmw_context_impl_s()
{
if (0u != this->node_count) {
RMW_CONNEXT_LOG_ERROR_A("not all nodes finalized: %lu", this->node_count)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef RMW_CONNEXTDDS__DDS_API_RTIME_HPP_
#define RMW_CONNEXTDDS__DDS_API_RTIME_HPP_

#include "rti_me_c.h" // NOLINT(build/include)
#include "rti_me_c.h" // NOLINT(build/include_subdir)
#include "disc_dpde/disc_dpde_discovery_plugin.h"
#include "wh_sm/wh_sm_history.h"
#include "rh_sm/rh_sm_history.h"
Expand Down Expand Up @@ -70,4 +70,7 @@ struct DDS_LifespanQosPolicy;
#define DDS_InstanceHandle_compare_prefix(ih_a_, ih_b_) \
memcmp((ih_a_)->octet, (ih_b_)->octet, 12)

// Not available function
#define DDS_DataWriter_wait_for_acknowledgments(writer_, timeout_) DDS_RETCODE_UNSUPPORTED

#endif // RMW_CONNEXTDDS__DDS_API_RTIME_HPP_
30 changes: 30 additions & 0 deletions rmw_connextdds_common/include/rmw_connextdds/rmw_api_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,12 @@ rmw_ret_t
rmw_api_connextdds_publisher_assert_liveliness(
const rmw_publisher_t * publisher);

RMW_CONNEXTDDS_PUBLIC
rmw_ret_t
rmw_api_connextdds_publisher_wait_for_all_acked(
const rmw_publisher_t * publisher,
rmw_time_t wait_timeout);

RMW_CONNEXTDDS_PUBLIC
rmw_ret_t
rmw_api_connextdds_publisher_get_actual_qos(
Expand Down Expand Up @@ -381,6 +387,18 @@ rmw_api_connextdds_create_client(
const char * service_name,
const rmw_qos_profile_t * qos_policies);

RMW_CONNEXTDDS_PUBLIC
rmw_ret_t
rmw_api_connextdds_client_request_publisher_get_actual_qos(
const rmw_client_t * client,
rmw_qos_profile_t * qos);

RMW_CONNEXTDDS_PUBLIC
rmw_ret_t
rmw_api_connextdds_client_response_subscription_get_actual_qos(
const rmw_client_t * client,
rmw_qos_profile_t * qos);

RMW_CONNEXTDDS_PUBLIC
rmw_ret_t
rmw_api_connextdds_destroy_client(
Expand All @@ -395,6 +413,18 @@ rmw_api_connextdds_create_service(
const char * service_name,
const rmw_qos_profile_t * qos_policies);

RMW_CONNEXTDDS_PUBLIC
rmw_ret_t
rmw_api_connextdds_service_response_publisher_get_actual_qos(
const rmw_service_t * service,
rmw_qos_profile_t * qos);

RMW_CONNEXTDDS_PUBLIC
rmw_ret_t
rmw_api_connextdds_service_request_subscription_get_actual_qos(
const rmw_service_t * service,
rmw_qos_profile_t * qos);

RMW_CONNEXTDDS_PUBLIC
rmw_ret_t
rmw_api_connextdds_destroy_service(
Expand Down
18 changes: 18 additions & 0 deletions rmw_connextdds_common/include/rmw_connextdds/rmw_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ bool rmw_connextdds_find_string_in_list(
const DDS_StringSeq * const values,
const char * const value);

DDS_Duration_t rmw_connextdds_duration_from_ros_time(
const rmw_time_t * const ros_time);

/******************************************************************************
* WaitSet wrapper
******************************************************************************/
Expand Down Expand Up @@ -197,6 +200,9 @@ class RMW_Connext_Publisher
rmw_ret_t
assert_liveliness();

rmw_ret_t
wait_for_all_acked(rmw_time_t wait_timeout);

rmw_ret_t
qos(rmw_qos_profile_t * const qos);

Expand Down Expand Up @@ -576,6 +582,12 @@ class RMW_Connext_Client

rmw_ret_t
enable();

rmw_ret_t
request_publisher_qos(rmw_qos_profile_t * const qos);

rmw_ret_t
response_subscription_qos(rmw_qos_profile_t * const qos);
};

class RMW_Connext_Service
Expand Down Expand Up @@ -623,6 +635,12 @@ class RMW_Connext_Service

rmw_ret_t
enable();

rmw_ret_t
response_publisher_qos(rmw_qos_profile_t * const qos);

rmw_ret_t
request_subscription_qos(rmw_qos_profile_t * const qos);
};

/******************************************************************************
Expand Down
14 changes: 13 additions & 1 deletion rmw_connextdds_common/include/rmw_connextdds/static_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,12 @@

#ifndef RMW_CONNEXT_ENV_ENDPOINT_QOS_OVERRIDE_POLICY
#define RMW_CONNEXT_ENV_ENDPOINT_QOS_OVERRIDE_POLICY "RMW_CONNEXT_ENDPOINT_QOS_OVERRIDE_POLICY"
#endif /* RMW_CONNEXT_ENV_ALLOW_TOPIC_QOS_PROFILES */
#endif /* RMW_CONNEXT_ENV_ENDPOINT_QOS_OVERRIDE_POLICY */

#ifndef RMW_CONNEXT_ENV_PARTICIPANT_QOS_OVERRIDE_POLICY
#define RMW_CONNEXT_ENV_PARTICIPANT_QOS_OVERRIDE_POLICY \
"RMW_CONNEXT_PARTICIPANT_QOS_OVERRIDE_POLICY"
#endif /* RMW_CONNEXT_ENV_PARTICIPANT_QOS_OVERRIDE_POLICY */

/******************************************************************************
* DDS Implementation
Expand Down Expand Up @@ -280,6 +284,14 @@
#define RMW_CONNEXT_FAST_ENDPOINT_DISCOVERY 1
#endif /* RMW_CONNEXT_FAST_ENDPOINT_DISCOVERY */

/******************************************************************************
* Modify DomainParticipantQos to allow sharing of DDS entities created with
* the Connext C API with applications using the C++11 API.
******************************************************************************/
#ifndef RMW_CONNEXT_SHARE_DDS_ENTITIES_WITH_CPP
#define RMW_CONNEXT_SHARE_DDS_ENTITIES_WITH_CPP 1
#endif /* RMW_CONNEXT_SHARE_DDS_ENTITIES_WITH_CPP */

/******************************************************************************
* Override dds.transport.UDPv4.builtin.ignore_loopback_interface in
* DomainParticipantQos to force communication over loopback (in addition to
Expand Down
2 changes: 1 addition & 1 deletion rmw_connextdds_common/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>rmw_connextdds_common</name>
<version>0.6.0</version>
<version>0.8.2</version>
<description>Common source for RMW implementations built with RTI Connext DDS Professional and RTI Connext DDS Micro.</description>
<maintainer email="asorbini@rti.com">Andrea Sorbini</maintainer>
<license>Apache License 2.0</license>
Expand Down
Loading

0 comments on commit b56702c

Please sign in to comment.