Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Add RMW function to check QoS compatibility (#488)
Browse files Browse the repository at this point in the history
Implements ros2/rmw#299

Depends on ros2/rmw_dds_common#45

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
  • Loading branch information
jacobperron committed Mar 1, 2021
1 parent fd3e6a7 commit c78e112
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 0 deletions.
1 change: 1 addition & 0 deletions rmw_connext_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ add_library(
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
Expand Down
30 changes: 30 additions & 0 deletions rmw_connext_cpp/src/rmw_qos.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2021 Open Source Robotics Foundation, Inc.
//
// 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_connext_shared_cpp/rmw_qos.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)
{
return qos_profile_check_compatible(
publisher_profile, subscription_profile, compatibility, reason, reason_size);
}
} // extern "C"
3 changes: 3 additions & 0 deletions rmw_connext_shared_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ endif()
find_package(rcpputils REQUIRED)
find_package(rcutils REQUIRED)
find_package(rmw REQUIRED)
find_package(rmw_dds_common REQUIRED)

include_directories(include)

Expand All @@ -50,6 +51,7 @@ add_library(
src/qos.cpp
src/names_and_types_helpers.cpp
src/node_info_and_types.cpp
src/rmw_qos.cpp
src/security_logging.cpp
src/service_names_and_types.cpp
src/topic_names_and_types.cpp
Expand All @@ -63,6 +65,7 @@ ament_target_dependencies(rmw_connext_shared_cpp
"rcpputils"
"rcutils"
"rmw"
"rmw_dds_common"
"Connext")
ament_export_libraries(rmw_connext_shared_cpp)

Expand Down
31 changes: 31 additions & 0 deletions rmw_connext_shared_cpp/include/rmw_connext_shared_cpp/rmw_qos.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright 2021 Open Source Robotics Foundation, Inc.
//
// 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_CONNEXT_SHARED_CPP__RMW_QOS_HPP_
#define RMW_CONNEXT_SHARED_CPP__RMW_QOS_HPP_

#include "rmw/qos_profiles.h"

#include "rmw_connext_shared_cpp/visibility_control.h"

RMW_CONNEXT_SHARED_CPP_PUBLIC
rmw_ret_t
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);

#endif // RMW_CONNEXT_SHARED_CPP__RMW_QOS_HPP_
2 changes: 2 additions & 0 deletions rmw_connext_shared_cpp/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
<build_export_depend>connext_cmake_module</build_export_depend>
<build_export_depend>rti-connext-dds-5.3.1</build_export_depend>

<depend>rmw_dds_common</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

Expand Down
29 changes: 29 additions & 0 deletions rmw_connext_shared_cpp/src/rmw_qos.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright 2021 Open Source Robotics Foundation, Inc.
//
// 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_dds_common/qos.hpp"

#include "rmw_connext_shared_cpp/rmw_qos.hpp"

rmw_ret_t
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)
{
return rmw_dds_common::qos_profile_check_compatible(
publisher_profile, subscription_profile, compatibility, reason, reason_size);
}

0 comments on commit c78e112

Please sign in to comment.