From 35682ee63f79c2a3a6a22c3befcf4b727a74900e Mon Sep 17 00:00:00 2001 From: Simon Hoinkis Date: Tue, 27 Jul 2021 15:44:19 +0200 Subject: [PATCH 1/9] #48 Remove additional repos file as iceoryx is now available in upstream ROS 2 Signed-off-by: Simon Hoinkis --- .github/workflows/additional_repos.repos | 5 ----- .github/workflows/main.yml | 10 ++++------ README.md | 4 ++-- 3 files changed, 6 insertions(+), 13 deletions(-) delete mode 100644 .github/workflows/additional_repos.repos diff --git a/.github/workflows/additional_repos.repos b/.github/workflows/additional_repos.repos deleted file mode 100644 index c7c8519..0000000 --- a/.github/workflows/additional_repos.repos +++ /dev/null @@ -1,5 +0,0 @@ -repositories: - eclipse/iceoryx: - type: git - url: https://github.com/eclipse-iceoryx/iceoryx.git - version: v1.0.1 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3a2e412..348dfdf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: Integration build rmw_iceoryx on: push: branches: - - foxy + - galactic pull_request: jobs: @@ -18,13 +18,11 @@ jobs: - name: Setup ROS uses: ros-tooling/setup-ros@master with: - required-ros-distributions: foxy + required-ros-distributions: galactic - name: Install Iceoryx Dependencies run: sudo apt-get update && sudo apt-get install -y cmake libacl1-dev libncurses5-dev pkg-config - name: Build & Test uses: ros-tooling/action-ros-ci@master with: - package-name: rmw_iceoryx_cpp iceoryx_ros2_bridge - target-ros2-distro: foxy - vcs-repo-file-url: | - ./.github/workflows/additional_repos.repos + package-name: iceoryx_utils iceoryx_posh rmw_iceoryx_cpp iceoryx_ros2_bridge + target-ros2-distro: galactic diff --git a/README.md b/README.md index 66c175e..02777b8 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,12 @@ git clone https://github.com/ros2/rmw_iceoryx.git ``` For alternative installation instructions and more details about iceoryx's internals, please see [iceoryx's GitHub repo](https://github.com/eclipse/iceoryx). -rmw_iceoryx is compatible with ROS 2 Foxy. +rmw_iceoryx is compatible with ROS 2 Galactic. Assuming you have ROS2 installed correctly, you can compile the iceoryx workspace with colcon: ``` cd ~/iceoryx_ws/ -source /opt/ros/foxy/setup.bash # alternatively source your own ROS 2 workspace +source /opt/ros/galactic/setup.bash # alternatively source your own ROS 2 workspace colcon build # or with more options colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF From a4f94299cffdc8e44753c55c85b1950df7841423 Mon Sep 17 00:00:00 2001 From: Simon Hoinkis Date: Tue, 27 Jul 2021 16:46:39 +0200 Subject: [PATCH 2/9] #48 Adhere rmw_iceoryx to galactic APIs Signed-off-by: Simon Hoinkis --- iceoryx_ros2_bridge/src/generic_subscription.cpp | 8 ++++++++ iceoryx_ros2_bridge/src/generic_subscription.hpp | 4 ++++ rmw_iceoryx_cpp/src/rmw_node.cpp | 7 +------ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/iceoryx_ros2_bridge/src/generic_subscription.cpp b/iceoryx_ros2_bridge/src/generic_subscription.cpp index 614cae7..9a4dae9 100644 --- a/iceoryx_ros2_bridge/src/generic_subscription.cpp +++ b/iceoryx_ros2_bridge/src/generic_subscription.cpp @@ -88,6 +88,14 @@ void GenericSubscription::return_serialized_message( message.reset(); } +void GenericSubscription::handle_serialized_message( + const std::shared_ptr & serialized_message, + const rclcpp::MessageInfo & message_info) +{ + (void) serialized_message; + (void) message_info; +} + void GenericSubscription::handle_loaned_message( void * loaned_message, const rclcpp::MessageInfo & message_info) diff --git a/iceoryx_ros2_bridge/src/generic_subscription.hpp b/iceoryx_ros2_bridge/src/generic_subscription.hpp index 794086e..7e790fe 100644 --- a/iceoryx_ros2_bridge/src/generic_subscription.hpp +++ b/iceoryx_ros2_bridge/src/generic_subscription.hpp @@ -80,6 +80,10 @@ class GenericSubscription : public rclcpp::SubscriptionBase void return_serialized_message(std::shared_ptr & message) override; + void handle_serialized_message( + const std::shared_ptr & serialized_message, + const rclcpp::MessageInfo & message_info) override; + void handle_loaned_message( void * loaned_message, const rclcpp::MessageInfo & message_info) override; diff --git a/rmw_iceoryx_cpp/src/rmw_node.cpp b/rmw_iceoryx_cpp/src/rmw_node.cpp index eeca4b8..d36a396 100644 --- a/rmw_iceoryx_cpp/src/rmw_node.cpp +++ b/rmw_iceoryx_cpp/src/rmw_node.cpp @@ -27,13 +27,8 @@ rmw_node_t * rmw_create_node( rmw_context_t * context, const char * name, - const char * namespace_, - size_t domain_id, - bool localhost_only) + const char * namespace_) { - (void)domain_id; - (void)localhost_only; // funny ;) - RCUTILS_CHECK_ARGUMENT_FOR_NULL(context, nullptr); RCUTILS_CHECK_ARGUMENT_FOR_NULL(name, nullptr); RCUTILS_CHECK_ARGUMENT_FOR_NULL(namespace_, nullptr); From 7048292e1cad8f1ebe677f3f8d7e40117f3f8262 Mon Sep 17 00:00:00 2001 From: Simon Hoinkis Date: Tue, 27 Jul 2021 17:42:57 +0200 Subject: [PATCH 3/9] #48 Remove iceoryx packages from CI build and let colcon find the dependecy Signed-off-by: Simon Hoinkis --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 348dfdf..42e2f19 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,5 +24,5 @@ jobs: - name: Build & Test uses: ros-tooling/action-ros-ci@master with: - package-name: iceoryx_utils iceoryx_posh rmw_iceoryx_cpp iceoryx_ros2_bridge + package-name: rmw_iceoryx_cpp iceoryx_ros2_bridge target-ros2-distro: galactic From b73c4b88263e184603cb07e0c7218af1c1a6dcfd Mon Sep 17 00:00:00 2001 From: Simon Hoinkis Date: Thu, 29 Jul 2021 15:17:52 +0200 Subject: [PATCH 4/9] #48 Wrap get_message_typesupport_handle(), remove duplicate error handling and reset error Signed-off-by: Simon Hoinkis --- .../iceoryx_type_info_introspection.hpp | 11 ++ .../src/internal/iceoryx_deserialize.cpp | 31 ++- .../src/internal/iceoryx_serialize.cpp | 23 +-- .../iceoryx_type_info_introspection.cpp | 177 ++++++++---------- 4 files changed, 116 insertions(+), 126 deletions(-) diff --git a/rmw_iceoryx_cpp/include/rmw_iceoryx_cpp/iceoryx_type_info_introspection.hpp b/rmw_iceoryx_cpp/include/rmw_iceoryx_cpp/iceoryx_type_info_introspection.hpp index d9dc1ad..a0ad57b 100644 --- a/rmw_iceoryx_cpp/include/rmw_iceoryx_cpp/iceoryx_type_info_introspection.hpp +++ b/rmw_iceoryx_cpp/include/rmw_iceoryx_cpp/iceoryx_type_info_introspection.hpp @@ -22,6 +22,17 @@ struct rosidl_message_type_support_t; namespace rmw_iceoryx_cpp { +enum class TypeSupportLanguage +{ + CPP, + C +}; + +/// @brief Wraps get_message_typesupport_handle() and does error handling +/// @return std::pair containing enum TypeSupportLanguage and handle to the type support +const std::pair get_type_support( + const rosidl_message_type_support_t * type_supports); + bool iceoryx_is_fixed_size(const rosidl_message_type_support_t * type_supports); bool iceoryx_is_valid_type_support(const rosidl_message_type_support_t * type_supports); diff --git a/rmw_iceoryx_cpp/src/internal/iceoryx_deserialize.cpp b/rmw_iceoryx_cpp/src/internal/iceoryx_deserialize.cpp index 226f0ee..d738339 100644 --- a/rmw_iceoryx_cpp/src/internal/iceoryx_deserialize.cpp +++ b/rmw_iceoryx_cpp/src/internal/iceoryx_deserialize.cpp @@ -20,7 +20,10 @@ #include "rosidl_typesupport_introspection_cpp/identifier.hpp" #include "rosidl_typesupport_introspection_cpp/message_introspection.hpp" +#include "rcutils/error_handling.h" + #include "rmw_iceoryx_cpp/iceoryx_deserialize.hpp" +#include "rmw_iceoryx_cpp/iceoryx_type_info_introspection.hpp" #include "./iceoryx_deserialize_typesupport_c.hpp" #include "./iceoryx_deserialize_typesupport_cpp.hpp" @@ -33,24 +36,16 @@ void deserialize( const rosidl_message_type_support_t * type_supports, void * ros_message) { - // serialize with cpp typesupport - auto ts_cpp = get_message_typesupport_handle( - type_supports, - rosidl_typesupport_introspection_cpp::typesupport_identifier); - if (ts_cpp != nullptr) { - auto members = - static_cast(ts_cpp->data); - rmw_iceoryx_cpp::details_cpp::deserialize(serialized_msg, members, ros_message); - } - - // serialize with c typesupport - auto ts_c = get_message_typesupport_handle( - type_supports, - rosidl_typesupport_introspection_c__identifier); - if (ts_c != nullptr) { - auto members = - static_cast(ts_c->data); - rmw_iceoryx_cpp::details_c::deserialize(serialized_msg, members, ros_message); + auto ts = get_type_support(type_supports); + + if (ts.first == TypeSupportLanguage::CPP) { + auto members_cpp = + static_cast(ts.second->data); + rmw_iceoryx_cpp::details_cpp::deserialize(serialized_msg, members_cpp, ros_message); + } else if (ts.first == TypeSupportLanguage::C) { + auto members_c = + static_cast(ts.second->data); + rmw_iceoryx_cpp::details_c::deserialize(serialized_msg, members_c, ros_message); } } diff --git a/rmw_iceoryx_cpp/src/internal/iceoryx_serialize.cpp b/rmw_iceoryx_cpp/src/internal/iceoryx_serialize.cpp index 5e8ec70..25fce24 100644 --- a/rmw_iceoryx_cpp/src/internal/iceoryx_serialize.cpp +++ b/rmw_iceoryx_cpp/src/internal/iceoryx_serialize.cpp @@ -22,7 +22,10 @@ #include "rosidl_typesupport_introspection_cpp/identifier.hpp" #include "rosidl_typesupport_introspection_cpp/message_introspection.hpp" +#include "rcutils/error_handling.h" + #include "rmw_iceoryx_cpp/iceoryx_serialize.hpp" +#include "rmw_iceoryx_cpp/iceoryx_type_info_introspection.hpp" #include "./iceoryx_serialize_typesupport_c.hpp" #include "./iceoryx_serialize_typesupport_cpp.hpp" @@ -35,23 +38,15 @@ void serialize( const rosidl_message_type_support_t * type_supports, std::vector & payload_vector) { - // serialize with cpp typesupport - auto ts_cpp = get_message_typesupport_handle( - type_supports, - rosidl_typesupport_introspection_cpp::typesupport_identifier); - if (ts_cpp != nullptr) { + auto ts = get_type_support(type_supports); + + if (ts.first == TypeSupportLanguage::CPP) { auto members = - static_cast(ts_cpp->data); + static_cast(ts.second->data); rmw_iceoryx_cpp::details_cpp::serialize(ros_message, members, payload_vector); - } - - // serialize with c typesupport - auto ts_c = get_message_typesupport_handle( - type_supports, - rosidl_typesupport_introspection_c__identifier); - if (ts_c != nullptr) { + } else if (ts.first == TypeSupportLanguage::C) { auto members = - static_cast(ts_c->data); + static_cast(ts.second->data); rmw_iceoryx_cpp::details_c::serialize(ros_message, members, payload_vector); } } diff --git a/rmw_iceoryx_cpp/src/internal/iceoryx_type_info_introspection.cpp b/rmw_iceoryx_cpp/src/internal/iceoryx_type_info_introspection.cpp index 417acd2..b5b4a62 100644 --- a/rmw_iceoryx_cpp/src/internal/iceoryx_type_info_introspection.cpp +++ b/rmw_iceoryx_cpp/src/internal/iceoryx_type_info_introspection.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include "rosidl_typesupport_cpp/message_type_support.hpp" @@ -27,6 +28,8 @@ #include "rosidl_typesupport_introspection_cpp/identifier.hpp" #include "rosidl_typesupport_introspection_cpp/message_introspection.hpp" +#include "rcutils/error_handling.h" + #include "rmw_iceoryx_cpp/iceoryx_type_info_introspection.hpp" namespace details_cpp @@ -125,172 +128,158 @@ bool is_fixed_size(const rosidl_typesupport_introspection_c__MessageMembers * me namespace rmw_iceoryx_cpp { - -bool iceoryx_is_fixed_size(const rosidl_message_type_support_t * type_supports) +const std::pair get_type_support( + const rosidl_message_type_support_t * type_supports) { + rcutils_error_string_t cpp_error_string; + rcutils_error_string_t c_error_string; + // first, try to extract cpp type support auto ts_cpp = get_message_typesupport_handle( type_supports, rosidl_typesupport_introspection_cpp::typesupport_identifier); if (ts_cpp != nullptr) { - auto members = - static_cast(ts_cpp->data); - return details_cpp::is_fixed_size(members); + return std::make_pair(rmw_iceoryx_cpp::TypeSupportLanguage::CPP, ts_cpp); + } else { + /// @todo Reset error string since this is not yet an error + /// https://github.com/ros2/rosidl_typesupport/pull/102 + cpp_error_string = rcutils_get_error_string(); + rcutils_reset_error(); } // second, try to extract c type support auto ts_c = get_message_typesupport_handle( type_supports, rosidl_typesupport_introspection_c__identifier); if (ts_c != nullptr) { - auto members = - static_cast(ts_c->data); - return details_c::is_fixed_size(members); + return std::make_pair(rmw_iceoryx_cpp::TypeSupportLanguage::C, ts_c); + } else { + /// @todo https://github.com/ros2/rosidl_typesupport/pull/102 + c_error_string = rcutils_get_error_string(); + rcutils_reset_error(); } // still here? Then something's wrong - throw std::runtime_error("no suitable type support given"); + std::stringstream error_string; + error_string << "No suitable type support given! "; + error_string << "cpp error: " << cpp_error_string.str; + error_string << "c error: " << c_error_string.str; + throw std::runtime_error(error_string.str()); } -size_t iceoryx_get_message_size(const rosidl_message_type_support_t * type_supports) +bool iceoryx_is_fixed_size(const rosidl_message_type_support_t * type_supports) { - // first, try to extract cpp type support - auto ts_cpp = get_message_typesupport_handle( - type_supports, rosidl_typesupport_introspection_cpp::typesupport_identifier); - if (ts_cpp != nullptr) { + auto ts = get_type_support(type_supports); + + if (ts.first == TypeSupportLanguage::CPP) { auto members = - static_cast(ts_cpp->data); - return members->size_of_; + static_cast(ts.second->data); + return details_cpp::is_fixed_size(members); + } else if (ts.first == TypeSupportLanguage::C) { + auto members = + static_cast(ts.second->data); + return details_c::is_fixed_size(members); } + // Something went wrong + return false; +} - // second, try to extract c type support - auto ts_c = get_message_typesupport_handle( - type_supports, rosidl_typesupport_introspection_c__identifier); - if (ts_c != nullptr) { +size_t iceoryx_get_message_size(const rosidl_message_type_support_t * type_supports) +{ + auto ts = get_type_support(type_supports); + + if (ts.first == TypeSupportLanguage::CPP) { auto members = - static_cast(ts_c->data); + static_cast(ts.second->data); + return members->size_of_; + } else if (ts.first == TypeSupportLanguage::C) { + auto members = + static_cast(ts.second->data); return members->size_of_; } - - // still here? Then something's wrong - throw std::runtime_error("no suitable type support given"); + // Something went wrong + return 0; } std::string iceoryx_get_message_name(const rosidl_message_type_support_t * type_supports) { - // first, try to extract cpp type support - auto ts_cpp = get_message_typesupport_handle( - type_supports, rosidl_typesupport_introspection_cpp::typesupport_identifier); - if (ts_cpp != nullptr) { + auto ts = get_type_support(type_supports); + + if (ts.first == TypeSupportLanguage::CPP) { auto members = - static_cast(ts_cpp->data); + static_cast(ts.second->data); return members->message_name_; - } - - // second, try to extract c type support - auto ts_c = get_message_typesupport_handle( - type_supports, rosidl_typesupport_introspection_c__identifier); - if (ts_c != nullptr) { + } else if (ts.first != TypeSupportLanguage::C) { auto members = - static_cast(ts_c->data); + static_cast(ts.second->data); return members->message_name_; } - - // still here? Then something's wrong - throw std::runtime_error("no suitable type support given"); + // Something went wrong + return ""; } std::string iceoryx_get_message_namespace(const rosidl_message_type_support_t * type_supports) { - // first, try to extract cpp type support - auto ts_cpp = get_message_typesupport_handle( - type_supports, rosidl_typesupport_introspection_cpp::typesupport_identifier); - if (ts_cpp != nullptr) { + auto ts = get_type_support(type_supports); + + if (ts.first == TypeSupportLanguage::CPP) { auto members = - static_cast(ts_cpp->data); + static_cast(ts.second->data); return members->message_namespace_; - } - - // second, try to extract c type support - auto ts_c = get_message_typesupport_handle( - type_supports, rosidl_typesupport_introspection_c__identifier); - if (ts_c != nullptr) { + } else if (ts.first == TypeSupportLanguage::C) { auto members = - static_cast(ts_c->data); + static_cast(ts.second->data); return members->message_namespace_; } - - // still here? Then something's wrong - throw std::runtime_error("no suitable type support given"); + // Something went wrong + return ""; } bool iceoryx_is_valid_type_support(const rosidl_message_type_support_t * type_supports) { - if (get_message_typesupport_handle( - type_supports, rosidl_typesupport_introspection_cpp::typesupport_identifier)) - { - return true; + try { + get_type_support(type_supports); + } catch (...) { + return false; } - if (get_message_typesupport_handle( - type_supports, rosidl_typesupport_introspection_c__identifier)) - { - return true; - } - return false; + + return true; } void iceoryx_init_message( const rosidl_message_type_support_t * type_supports, void * message) { - // first, try to extract cpp type support - auto ts_cpp = get_message_typesupport_handle( - type_supports, rosidl_typesupport_introspection_cpp::typesupport_identifier); - if (ts_cpp != nullptr) { + auto ts = get_type_support(type_supports); + + if (ts.first == TypeSupportLanguage::CPP) { auto members = - static_cast(ts_cpp->data); + static_cast(ts.second->data); members->init_function(message, rosidl_runtime_cpp::MessageInitialization::ALL); return; - } - - // second, try to extract c type support - auto ts_c = get_message_typesupport_handle( - type_supports, rosidl_typesupport_introspection_c__identifier); - if (ts_c != nullptr) { + } else if (ts.first == TypeSupportLanguage::C) { auto members = - static_cast(ts_c->data); + static_cast(ts.second->data); members->init_function(message, ROSIDL_RUNTIME_C_MSG_INIT_ALL); return; } - - // still here? Then something's wrong - throw std::runtime_error("no suitable type support given"); } void iceoryx_fini_message( const rosidl_message_type_support_t * type_supports, void * message) { - // first, try to extract cpp type support - auto ts_cpp = get_message_typesupport_handle( - type_supports, rosidl_typesupport_introspection_cpp::typesupport_identifier); - if (ts_cpp != nullptr) { + auto ts = get_type_support(type_supports); + if (ts.first == TypeSupportLanguage::CPP) { auto members = - static_cast(ts_cpp->data); + static_cast(ts.second->data); members->fini_function(message); return; - } - - // second, try to extract c type support - auto ts_c = get_message_typesupport_handle( - type_supports, rosidl_typesupport_introspection_c__identifier); - if (ts_c != nullptr) { + } else if (ts.first == TypeSupportLanguage::C) { auto members = - static_cast(ts_c->data); + static_cast(ts.second->data); members->fini_function(message); return; } - - // still here? Then something's wrong - throw std::runtime_error("no suitable type support given"); } } // namespace rmw_iceoryx_cpp From a52c36b4cde4fe9cd256786dcef1ff4ca2964347 Mon Sep 17 00:00:00 2001 From: Simon Hoinkis Date: Thu, 29 Jul 2021 16:01:54 +0200 Subject: [PATCH 5/9] #48 Add empty implementations for new rmw galactic API calls Signed-off-by: Simon Hoinkis --- rmw_iceoryx_cpp/CMakeLists.txt | 2 + .../src/rmw_network_flow_endpoint.cpp | 48 +++++++++++++++++++ rmw_iceoryx_cpp/src/rmw_publisher.cpp | 10 ++++ rmw_iceoryx_cpp/src/rmw_qos.cpp | 38 +++++++++++++++ 4 files changed, 98 insertions(+) create mode 100644 rmw_iceoryx_cpp/src/rmw_network_flow_endpoint.cpp create mode 100644 rmw_iceoryx_cpp/src/rmw_qos.cpp diff --git a/rmw_iceoryx_cpp/CMakeLists.txt b/rmw_iceoryx_cpp/CMakeLists.txt index 36eec3c..666ccf6 100644 --- a/rmw_iceoryx_cpp/CMakeLists.txt +++ b/rmw_iceoryx_cpp/CMakeLists.txt @@ -87,11 +87,13 @@ add_library(rmw_iceoryx_cpp SHARED src/rmw_guard_condition.cpp src/rmw_init.cpp src/rmw_logging.cpp + src/rmw_network_flow_endpoint.cpp src/rmw_node.cpp src/rmw_node_info_and_types.cpp src/rmw_node_names.cpp src/rmw_publish.cpp src/rmw_publisher.cpp + src/rmw_qos.cpp src/rmw_request.cpp src/rmw_response.cpp src/rmw_serialize.cpp diff --git a/rmw_iceoryx_cpp/src/rmw_network_flow_endpoint.cpp b/rmw_iceoryx_cpp/src/rmw_network_flow_endpoint.cpp new file mode 100644 index 0000000..2d15c6f --- /dev/null +++ b/rmw_iceoryx_cpp/src/rmw_network_flow_endpoint.cpp @@ -0,0 +1,48 @@ +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. +// +// 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. + +#include "rmw/get_network_flow_endpoints.h" +#include "rcutils/error_handling.h" +#include "rmw/impl/cpp/macros.hpp" + +extern "C" +{ +rmw_ret_t +rmw_publisher_get_network_flow_endpoints( + const rmw_publisher_t * publisher, + rcutils_allocator_t * allocator, + rmw_network_flow_endpoint_array_t * network_flow_endpoint_array) +{ + RCUTILS_CHECK_ARGUMENT_FOR_NULL(publisher, RMW_RET_ERROR); + RCUTILS_CHECK_ARGUMENT_FOR_NULL(allocator, RMW_RET_ERROR); + RCUTILS_CHECK_ARGUMENT_FOR_NULL(network_flow_endpoint_array, RMW_RET_ERROR); + + RMW_SET_ERROR_MSG("rmw_iceoryx_cpp does not support get network flow endpoints."); + return RMW_RET_UNSUPPORTED; +} + +rmw_ret_t +rmw_subscription_get_network_flow_endpoints( + const rmw_subscription_t * subscription, + rcutils_allocator_t * allocator, + rmw_network_flow_endpoint_array_t * network_flow_endpoint_array) +{ + RCUTILS_CHECK_ARGUMENT_FOR_NULL(subscription, RMW_RET_ERROR); + RCUTILS_CHECK_ARGUMENT_FOR_NULL(allocator, RMW_RET_ERROR); + RCUTILS_CHECK_ARGUMENT_FOR_NULL(network_flow_endpoint_array, RMW_RET_ERROR); + + RMW_SET_ERROR_MSG("rmw_iceoryx_cpp does not support get network flow endpoints."); + return RMW_RET_UNSUPPORTED; +} +} // extern "C" diff --git a/rmw_iceoryx_cpp/src/rmw_publisher.cpp b/rmw_iceoryx_cpp/src/rmw_publisher.cpp index f8f1574..591806c 100644 --- a/rmw_iceoryx_cpp/src/rmw_publisher.cpp +++ b/rmw_iceoryx_cpp/src/rmw_publisher.cpp @@ -157,6 +157,16 @@ rmw_publisher_assert_liveliness(const rmw_publisher_t * publisher) return RMW_RET_UNSUPPORTED; } +rmw_ret_t +rmw_publisher_wait_for_all_acked(const rmw_publisher_t * publisher, rmw_time_t wait_timeout) +{ + RCUTILS_CHECK_ARGUMENT_FOR_NULL(publisher, RMW_RET_ERROR); + (void)wait_timeout; + + RMW_SET_ERROR_MSG("rmw_iceoryx_cpp does not support wait for all acked."); + return RMW_RET_UNSUPPORTED; +} + rmw_ret_t rmw_publisher_get_actual_qos(const rmw_publisher_t * publisher, rmw_qos_profile_t * qos) { diff --git a/rmw_iceoryx_cpp/src/rmw_qos.cpp b/rmw_iceoryx_cpp/src/rmw_qos.cpp new file mode 100644 index 0000000..544d6aa --- /dev/null +++ b/rmw_iceoryx_cpp/src/rmw_qos.cpp @@ -0,0 +1,38 @@ +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. +// +// 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. + +#include "rmw/qos_profiles.h" +#include "rcutils/error_handling.h" +#include "rmw/impl/cpp/macros.hpp" + +extern "C" +{ +rmw_ret_t +rmw_qos_profile_check_compatible( + const rmw_qos_profile_t publisher_profile, + const rmw_qos_profile_t subscription_profile, + rmw_qos_compatibility_type_t * compatibility, + char * reason, + size_t reason_size) +{ + RCUTILS_CHECK_ARGUMENT_FOR_NULL(compatibility, RMW_RET_ERROR); + RCUTILS_CHECK_ARGUMENT_FOR_NULL(reason, RMW_RET_ERROR); + (void)publisher_profile; + (void)subscription_profile; + (void)reason_size; + + RMW_SET_ERROR_MSG("rmw_iceoryx_cpp does not support QoS profile check compatible"); + return RMW_RET_UNSUPPORTED; +} +} // extern "C" From 70a4db546aea44d942901677304a7567c80905f8 Mon Sep 17 00:00:00 2001 From: Simon Hoinkis Date: Thu, 29 Jul 2021 16:10:32 +0200 Subject: [PATCH 6/9] #48 Update copyright info in headers Signed-off-by: Simon Hoinkis --- iceoryx_ros2_bridge/src/generic_subscription.cpp | 1 + iceoryx_ros2_bridge/src/generic_subscription.hpp | 1 + .../include/rmw_iceoryx_cpp/iceoryx_type_info_introspection.hpp | 1 + rmw_iceoryx_cpp/src/internal/iceoryx_deserialize.cpp | 1 + rmw_iceoryx_cpp/src/internal/iceoryx_serialize.cpp | 1 + .../src/internal/iceoryx_type_info_introspection.cpp | 2 ++ 6 files changed, 7 insertions(+) diff --git a/iceoryx_ros2_bridge/src/generic_subscription.cpp b/iceoryx_ros2_bridge/src/generic_subscription.cpp index 9a4dae9..b125897 100644 --- a/iceoryx_ros2_bridge/src/generic_subscription.cpp +++ b/iceoryx_ros2_bridge/src/generic_subscription.cpp @@ -1,4 +1,5 @@ // Copyright 2018, Bosch Software Innovations GmbH. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/iceoryx_ros2_bridge/src/generic_subscription.hpp b/iceoryx_ros2_bridge/src/generic_subscription.hpp index 7e790fe..6d363d6 100644 --- a/iceoryx_ros2_bridge/src/generic_subscription.hpp +++ b/iceoryx_ros2_bridge/src/generic_subscription.hpp @@ -1,4 +1,5 @@ // Copyright 2018, Bosch Software Innovations GmbH. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/rmw_iceoryx_cpp/include/rmw_iceoryx_cpp/iceoryx_type_info_introspection.hpp b/rmw_iceoryx_cpp/include/rmw_iceoryx_cpp/iceoryx_type_info_introspection.hpp index a0ad57b..5c66da1 100644 --- a/rmw_iceoryx_cpp/include/rmw_iceoryx_cpp/iceoryx_type_info_introspection.hpp +++ b/rmw_iceoryx_cpp/include/rmw_iceoryx_cpp/iceoryx_type_info_introspection.hpp @@ -1,4 +1,5 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/rmw_iceoryx_cpp/src/internal/iceoryx_deserialize.cpp b/rmw_iceoryx_cpp/src/internal/iceoryx_deserialize.cpp index d738339..934d99f 100644 --- a/rmw_iceoryx_cpp/src/internal/iceoryx_deserialize.cpp +++ b/rmw_iceoryx_cpp/src/internal/iceoryx_deserialize.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/rmw_iceoryx_cpp/src/internal/iceoryx_serialize.cpp b/rmw_iceoryx_cpp/src/internal/iceoryx_serialize.cpp index 25fce24..c2fbc68 100644 --- a/rmw_iceoryx_cpp/src/internal/iceoryx_serialize.cpp +++ b/rmw_iceoryx_cpp/src/internal/iceoryx_serialize.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/rmw_iceoryx_cpp/src/internal/iceoryx_type_info_introspection.cpp b/rmw_iceoryx_cpp/src/internal/iceoryx_type_info_introspection.cpp index b5b4a62..f37a503 100644 --- a/rmw_iceoryx_cpp/src/internal/iceoryx_type_info_introspection.cpp +++ b/rmw_iceoryx_cpp/src/internal/iceoryx_type_info_introspection.cpp @@ -1,4 +1,6 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. + // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From d71e51197c2a3cc1297f090aff4ef13a310ebf63 Mon Sep 17 00:00:00 2001 From: Simon Hoinkis Date: Thu, 29 Jul 2021 16:23:26 +0200 Subject: [PATCH 7/9] #48 Try to fix CI build Signed-off-by: Simon Hoinkis --- iceoryx_ros2_bridge/src/generic_subscription.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iceoryx_ros2_bridge/src/generic_subscription.hpp b/iceoryx_ros2_bridge/src/generic_subscription.hpp index 6d363d6..b1f2dd7 100644 --- a/iceoryx_ros2_bridge/src/generic_subscription.hpp +++ b/iceoryx_ros2_bridge/src/generic_subscription.hpp @@ -83,7 +83,7 @@ class GenericSubscription : public rclcpp::SubscriptionBase void handle_serialized_message( const std::shared_ptr & serialized_message, - const rclcpp::MessageInfo & message_info) override; + const rclcpp::MessageInfo & message_info); void handle_loaned_message( void * loaned_message, const rclcpp::MessageInfo & message_info) override; From c8858178c917d9876bb63df84403f5ddacfa0c43 Mon Sep 17 00:00:00 2001 From: Simon Hoinkis Date: Thu, 29 Jul 2021 16:27:47 +0200 Subject: [PATCH 8/9] #48 Remove empty line in license header Signed-off-by: Simon Hoinkis --- rmw_iceoryx_cpp/src/internal/iceoryx_type_info_introspection.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/rmw_iceoryx_cpp/src/internal/iceoryx_type_info_introspection.cpp b/rmw_iceoryx_cpp/src/internal/iceoryx_type_info_introspection.cpp index f37a503..5bf6bd4 100644 --- a/rmw_iceoryx_cpp/src/internal/iceoryx_type_info_introspection.cpp +++ b/rmw_iceoryx_cpp/src/internal/iceoryx_type_info_introspection.cpp @@ -1,6 +1,5 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. // Copyright (c) 2021 by Apex.AI Inc. All rights reserved. - // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 72c572a420038babddea697cfb49ba784c8fc62e Mon Sep 17 00:00:00 2001 From: Simon Hoinkis Date: Thu, 29 Jul 2021 16:38:01 +0200 Subject: [PATCH 9/9] #48 Add missing include for std::pair Signed-off-by: Simon Hoinkis --- .../include/rmw_iceoryx_cpp/iceoryx_type_info_introspection.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/rmw_iceoryx_cpp/include/rmw_iceoryx_cpp/iceoryx_type_info_introspection.hpp b/rmw_iceoryx_cpp/include/rmw_iceoryx_cpp/iceoryx_type_info_introspection.hpp index 5c66da1..f9b2fae 100644 --- a/rmw_iceoryx_cpp/include/rmw_iceoryx_cpp/iceoryx_type_info_introspection.hpp +++ b/rmw_iceoryx_cpp/include/rmw_iceoryx_cpp/iceoryx_type_info_introspection.hpp @@ -17,6 +17,7 @@ #define RMW_ICEORYX_CPP__ICEORYX_TYPE_INFO_INTROSPECTION_HPP_ #include +#include struct rosidl_message_type_support_t;