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..42e2f19 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 + 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 diff --git a/iceoryx_ros2_bridge/src/generic_subscription.cpp b/iceoryx_ros2_bridge/src/generic_subscription.cpp index 614cae7..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. @@ -88,6 +89,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..b1f2dd7 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. @@ -80,6 +81,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); + void handle_loaned_message( void * loaned_message, const rclcpp::MessageInfo & message_info) override; 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/include/rmw_iceoryx_cpp/iceoryx_type_info_introspection.hpp b/rmw_iceoryx_cpp/include/rmw_iceoryx_cpp/iceoryx_type_info_introspection.hpp index d9dc1ad..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 @@ -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. @@ -16,12 +17,24 @@ #define RMW_ICEORYX_CPP__ICEORYX_TYPE_INFO_INTROSPECTION_HPP_ #include +#include 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..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. @@ -20,7 +21,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 +37,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..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. @@ -22,7 +23,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 +39,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..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,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. @@ -16,6 +17,7 @@ #include #include #include +#include #include "rosidl_typesupport_cpp/message_type_support.hpp" @@ -27,6 +29,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 +129,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 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_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); 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"