Skip to content
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
15 changes: 15 additions & 0 deletions rmw_connextdds/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@
Changelog for package rmw_connextdds
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.11.1 (2022-04-26)
-------------------

0.11.0 (2022-04-08)
-------------------
* Exclude missing sample info fields when building rmw_connextddsmicro (`#79 <https://github.com/ros2/rmw_connextdds/issues/79>`_)
* Update launch_testing_ros output filter prefixes for Connext6 (`#80 <https://github.com/ros2/rmw_connextdds/issues/80>`_)
* Contributors: Andrea Sorbini, Ivan Santiago Paunovic

0.10.0 (2022-03-28)
-------------------
* Add support for user-specified content filters (`#68 <https://github.com/ros2/rmw_connextdds/issues/68>`_)
* add stub for content filtered topic (`#77 <https://github.com/ros2/rmw_connextdds/issues/77>`_)
* Contributors: Andrea Sorbini, Chen Lihui, Ivan Santiago Paunovic

0.9.0 (2022-03-01)
------------------
* Add rmw listener apis (`#44 <https://github.com/rticommunity/rmw_connextdds/issues/44>`_)
Expand Down
2 changes: 1 addition & 1 deletion rmw_connextdds/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ ament_package(
)

ament_index_register_resource("rmw_output_prefixes"
CONTENT "RTI Data Distribution Service\nExpires on")
CONTENT "RTI Data Distribution Service\nRTI Connext DDS\nExpires on")
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.9.0</version>
<version>0.11.1</version>
<description>A ROS2 RMW implementation built with RTI Connext DDS Professional.</description>
<maintainer email="[email protected]">Andrea Sorbini</maintainer>
<license>Apache License 2.0</license>
Expand Down
37 changes: 37 additions & 0 deletions rmw_connextdds/src/rmw_api_impl_ndds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,24 @@ rmw_subscription_get_actual_qos(
return rmw_api_connextdds_subscription_get_actual_qos(subscription, qos);
}

rmw_ret_t
rmw_subscription_set_content_filter(
rmw_subscription_t * subscription,
const rmw_subscription_content_filter_options_t * options)
{
return rmw_api_connextdds_subscription_set_content_filter(
subscription, options);
}

rmw_ret_t
rmw_subscription_get_content_filter(
const rmw_subscription_t * subscription,
rcutils_allocator_t * allocator,
rmw_subscription_content_filter_options_t * options)
{
return rmw_api_connextdds_subscription_get_content_filter(
subscription, allocator, options);
}

rmw_ret_t
rmw_destroy_subscription(
Expand Down Expand Up @@ -937,3 +955,22 @@ rmw_subscription_get_network_flow_endpoints(
allocator,
network_flow_endpoint_array);
}

/******************************************************************************
* Feature support functions
******************************************************************************/
bool
rmw_feature_supported(rmw_feature_t feature)
{
switch (feature) {
case RMW_FEATURE_MESSAGE_INFO_RECEPTION_SEQUENCE_NUMBER:
case RMW_FEATURE_MESSAGE_INFO_PUBLICATION_SEQUENCE_NUMBER:
{
return true;
}
default:
{
return false;
}
}
}
18 changes: 18 additions & 0 deletions rmw_connextdds_common/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@
Changelog for package rmw_connextdds_common
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.11.1 (2022-04-26)
-------------------
* Resolve build error with RTI Connext DDS 5.3.1 (`#82 <https://github.com/ros2/rmw_connextdds/issues/82>`_)
* Contributors: Andrea Sorbini

0.11.0 (2022-04-08)
-------------------
* Exclude missing sample info fields when building rmw_connextddsmicro (`#79 <https://github.com/ros2/rmw_connextdds/issues/79>`_)
* Properly initialize CDR stream before using it for filtering (`#81 <https://github.com/ros2/rmw_connextdds/issues/81>`_)
* Contributors: Andrea Sorbini

0.10.0 (2022-03-28)
-------------------
* Add support for user-specified content filters (`#68 <https://github.com/ros2/rmw_connextdds/issues/68>`_)
* add stub for content filtered topic (`#77 <https://github.com/ros2/rmw_connextdds/issues/77>`_)
* Add sequence numbers to message info structure (`#74 <https://github.com/ros2/rmw_connextdds/issues/74>`_)
* Contributors: Andrea Sorbini, Chen Lihui, Ivan Santiago Paunovic

0.9.0 (2022-03-01)
------------------
* Add rmw listener apis (`#44 <https://github.com/rticommunity/rmw_connextdds/issues/44>`_)
Expand Down
11 changes: 11 additions & 0 deletions rmw_connextdds_common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,19 @@ function(rtirmw_add_library)
ament_target_dependencies(${_rti_build_NAME}
${_rti_build_DEPS})

set(_extra_defines)
if("${CMAKE_BUILD_TYPE}" MATCHES "[dD]ebug")
list(APPEND _extra_defines "RMW_CONNEXT_DEBUG=1")
endif()

target_compile_definitions(${_rti_build_NAME}
PUBLIC
RMW_VERSION_MAJOR=${rmw_VERSION_MAJOR}
RMW_VERSION_MINOR=${rmw_VERSION_MINOR}
RMW_VERSION_PATCH=${rmw_VERSION_PATCH}
RMW_CONNEXT_DDS_API=RMW_CONNEXT_DDS_API_${_rti_build_API}
${_rti_build_DEFINES}
${_extra_defines}
)

set(private_defines)
Expand Down Expand Up @@ -188,6 +194,9 @@ else()
if("${CONNEXTDDS_VERSION}" VERSION_LESS "6.0.0")
list(APPEND extra_defines "RMW_CONNEXT_DDS_API_PRO_LEGACY=1")
endif()
if(CONNEXTDDS_ARCH MATCHES ".*Win.*")
list(APPEND extra_defines "RMW_CONNEXT_BUILTIN_CFT_COMPATIBILITY_MODE=1")
endif()
rtirmw_add_library(
NAME ${PROJECT_NAME}_pro
API PRO
Expand All @@ -196,8 +205,10 @@ else()
src/ndds/rmw_type_support_ndds.cpp
src/ndds/rmw_typecode.cpp
src/ndds/dds_api_ndds.cpp
src/ndds/custom_sql_filter.cpp
include/rmw_connextdds/typecode.hpp
include/rmw_connextdds/dds_api_ndds.hpp
include/rmw_connextdds/custom_sql_filter.hpp
DEPS ${RMW_CONNEXT_DEPS}
LIBRARIES RTIConnextDDS::c_api
DEFINES ${extra_defines})
Expand Down
66 changes: 66 additions & 0 deletions rmw_connextdds_common/include/rmw_connextdds/custom_sql_filter.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// Copyright 2021 Real-Time Innovations, Inc. (RTI)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef RMW_CONNEXTDDS__CUSTOM_SQL_FILTER_HPP_
#define RMW_CONNEXTDDS__CUSTOM_SQL_FILTER_HPP_

#include "rmw_connextdds/dds_api.hpp"

#if RMW_CONNEXT_DDS_API == RMW_CONNEXT_DDS_API_PRO

namespace rti_connext_dds_custom_sql_filter
{

struct CustomSqlFilterData
{
DDS_SqlFilterGeneratorQos base;

CustomSqlFilterData();

DDS_ReturnCode_t
set_memory_management_property(
const DDS_DomainParticipantQos & dp_qos);
};

RMW_CONNEXTDDS_PUBLIC
DDS_ReturnCode_t
register_content_filter(
DDS_DomainParticipant * const participant,
CustomSqlFilterData * const filter_data);

RMW_CONNEXTDDS_PUBLIC
extern const char * const PLUGIN_NAME;

} // namespace rti_connext_dds_custom_sql_filter

#if !RMW_CONNEXT_BUILTIN_CFT_COMPATIBILITY_MODE
extern "C" {
// This is an internal function from RTI Connext DDS which allows a filter to
// be registered as "built-in". We need this because we want this custom filter
// to be a replacement for the built-in SQL-like filter.
RMW_CONNEXTDDS_PUBLIC
DDS_ReturnCode_t
DDS_ContentFilter_register_filter(
DDS_DomainParticipant * participant,
const char * name,
const struct DDS_ContentFilter * filter,
const DDS_ContentFilterEvaluateFunction evaluateOnSerialized,
const DDS_ContentFilterWriterEvaluateFunction writerEvaluateOnSerialized,
const DDS_ContentFilterQueryFunction query,
DDS_Boolean isBuiltin);
}
#endif // RMW_CONNEXT_BUILTIN_CFT_COMPATIBILITY_MODE

#endif // RMW_CONNEXT_DDS_API == RMW_CONNEXT_DDS_API_PRO

#endif // RMW_CONNEXTDDS__CUSTOM_SQL_FILTER_HPP_
18 changes: 18 additions & 0 deletions rmw_connextdds_common/include/rmw_connextdds/dds_api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,19 @@ rmw_connextdds_initialize_participant_qos_impl(
rmw_context_impl_t * const ctx,
DDS_DomainParticipantQos * const dp_qos);

rmw_ret_t
rmw_connextdds_configure_participant(
rmw_context_impl_t * const ctx,
DDS_DomainParticipant * const participant);

rmw_ret_t
rmw_connextdds_create_contentfilteredtopic(
rmw_context_impl_t * const ctx,
DDS_DomainParticipant * const dp,
DDS_Topic * const base_topic,
const char * const cft_name,
const char * const cft_filter,
const rcutils_string_array_t * const cft_expression_parameters,
DDS_TopicDescription ** const cft_out);

rmw_ret_t
Expand Down Expand Up @@ -263,4 +269,16 @@ rmw_connextdds_enable_security(
DDS_SECURITY_PROPERTY_PREFIX ".logging.log_level"
#endif /* DDS_SECURITY_LOGGING_LEVEL_PROPERTY */

rmw_ret_t
rmw_connextdds_set_cft_filter_expression(
DDS_TopicDescription * const topic_desc,
const char * const cft_expression,
const rcutils_string_array_t * const cft_expression_parameters);

rmw_ret_t
rmw_connextdds_get_cft_filter_expression(
DDS_TopicDescription * const topic_desc,
rcutils_allocator_t * const allocator,
rmw_subscription_content_filter_options_t * const options);

#endif // RMW_CONNEXTDDS__DDS_API_HPP_
12 changes: 0 additions & 12 deletions rmw_connextdds_common/include/rmw_connextdds/dds_api_ndds.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,6 @@

#include "rcutils/types.h"

DDS_SEQUENCE(RMW_Connext_Uint8ArrayPtrSeq, rcutils_uint8_array_t *);

typedef RMW_Connext_Uint8ArrayPtrSeq RMW_Connext_UntypedSampleSeq;

#define RMW_Connext_UntypedSampleSeq_INITIALIZER DDS_SEQUENCE_INITIALIZER

#define DDS_UntypedSampleSeq_get_reference(seq_, i_) \
*RMW_Connext_Uint8ArrayPtrSeq_get_reference(seq_, i_)

#define DDS_UntypedSampleSeq_get_length(seq_) \
RMW_Connext_Uint8ArrayPtrSeq_get_length(seq_)

#if RMW_CONNEXT_DDS_API_PRO_LEGACY
#ifndef RTIXCdrLong_MAX
#define RTIXCdrLong_MAX 2147483647
Expand Down
21 changes: 21 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 @@ -17,6 +17,8 @@

#include "rmw_connextdds/context.hpp"

#include "rmw/features.h"

/*****************************************************************************
* Context API
*****************************************************************************/
Expand Down Expand Up @@ -481,6 +483,18 @@ rmw_api_connextdds_subscription_get_actual_qos(
const rmw_subscription_t * subscription,
rmw_qos_profile_t * qos);

RMW_CONNEXTDDS_PUBLIC
rmw_ret_t
rmw_api_connextdds_subscription_set_content_filter(
rmw_subscription_t * subscription,
const rmw_subscription_content_filter_options_t * options);

RMW_CONNEXTDDS_PUBLIC
rmw_ret_t
rmw_api_connextdds_subscription_get_content_filter(
const rmw_subscription_t * subscription,
rcutils_allocator_t * const allocator,
rmw_subscription_content_filter_options_t * options);

RMW_CONNEXTDDS_PUBLIC
rmw_ret_t
Expand Down Expand Up @@ -637,4 +651,11 @@ rmw_api_connextdds_subscription_get_network_flow_endpoints(
rcutils_allocator_t * allocator,
rmw_network_flow_endpoint_array_t * network_flow_endpoint_array);

/******************************************************************************
* Feature support functions
******************************************************************************/
RMW_CONNEXTDDS_PUBLIC
bool
rmw_api_connextdds_feature_supported(rmw_feature_t feature);

#endif // RMW_CONNEXTDDS__RMW_API_IMPL_HPP_
22 changes: 22 additions & 0 deletions rmw_connextdds_common/include/rmw_connextdds/rmw_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,15 @@ class RMW_Connext_Subscriber
rmw_message_info_t * const message_info,
bool * const taken);

rmw_ret_t
set_content_filter(
const rmw_subscription_content_filter_options_t * const options);

rmw_ret_t
get_content_filter(
rcutils_allocator_t * allocator,
rmw_subscription_content_filter_options_t * const options);

bool
has_data()
{
Expand Down Expand Up @@ -494,6 +503,17 @@ class RMW_Connext_Subscriber
return this->dds_topic;
}

static std::string get_atomic_id()
{
static std::atomic_uint64_t id;
return std::to_string(id++);
}

bool is_cft_enabled()
{
return !this->cft_expression.empty();
}

const bool internal;
const bool ignore_local;

Expand All @@ -502,6 +522,7 @@ class RMW_Connext_Subscriber
DDS_DataReader * dds_reader;
DDS_Topic * dds_topic;
DDS_TopicDescription * dds_topic_cft;
std::string cft_expression;
RMW_Connext_MessageTypeSupport * type_support;
rmw_gid_t ros_gid;
const bool created_topic;
Expand All @@ -520,6 +541,7 @@ class RMW_Connext_Subscriber
const bool ignore_local,
const bool created_topic,
DDS_TopicDescription * const dds_topic_cft,
const char * const cft_expression,
const bool internal);

friend class RMW_Connext_SubscriberStatusCondition;
Expand Down
Loading