Skip to content

Commit dce0e8d

Browse files
committed
Resolve runtime failures to load introspection type support
Signed-off-by: Andrea Sorbini <[email protected]>
1 parent 7f34843 commit dce0e8d

File tree

4 files changed

+71
-3
lines changed

4 files changed

+71
-3
lines changed

rmw_dds_common/rmw_dds_common/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ament_export_dependencies(ament_cmake_core)
2121
ament_export_dependencies(rcpputils)
2222
ament_export_dependencies(rcutils)
2323
ament_export_dependencies(rmw)
24-
ament_export_dependencies(rosidl_default_runtime)
24+
ament_export_dependencies(rmw_dds_common_typesupports)
2525

2626
rosidl_generate_interfaces(
2727
${PROJECT_NAME}
@@ -39,7 +39,7 @@ ament_target_dependencies(${PROJECT_NAME}_library
3939
"rcpputils"
4040
"rcutils"
4141
"rmw"
42-
"rosidl_runtime_cpp")
42+
"rmw_dds_common_typesupports")
4343
add_dependencies(${PROJECT_NAME}_library
4444
${PROJECT_NAME})
4545
target_include_directories(${PROJECT_NAME}_library

rmw_dds_common/rmw_dds_common/package.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<depend>rcutils</depend>
1717
<depend>rcpputils</depend>
1818
<depend>rmw</depend>
19-
<depend>rosidl_runtime_cpp</depend>
19+
<depend>rmw_dds_common_typesupports</depend>
2020

2121
<test_depend>ament_cmake_gmock</test_depend>
2222
<test_depend>ament_lint_auto</test_depend>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
project(rmw_dds_common_typesupports)
3+
4+
# Default to C99
5+
if(NOT CMAKE_C_STANDARD)
6+
set(CMAKE_C_STANDARD 99)
7+
endif()
8+
9+
# Default to C++14
10+
if(NOT CMAKE_CXX_STANDARD)
11+
set(CMAKE_CXX_STANDARD 14)
12+
endif()
13+
14+
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
15+
add_compile_options(-Wall -Wextra -Wpedantic)
16+
endif()
17+
18+
# find dependencies
19+
find_package(ament_cmake REQUIRED)
20+
21+
# Load type support packages to make sure that they are installed
22+
find_package(rosidl_typesupport_fastrtps_c REQUIRED)
23+
find_package(rosidl_typesupport_fastrtps_cpp REQUIRED)
24+
find_package(rosidl_typesupport_introspection_c REQUIRED)
25+
find_package(rosidl_typesupport_introspection_cpp REQUIRED)
26+
27+
# This is an hack to have the `rosidl_generate_interfaces()` function consider
28+
# all the type supports required by `rmw_connextdds` even though that RMW
29+
# implementation has not yet been registered.
30+
ament_index_register_resource(rmw_typesupport CONTENT
31+
"rosidl_typesupport_c;rosidl_typesupport_fastrtps_c;rosidl_typesupport_introspection_c;rosidl_typesupport_cpp;rosidl_typesupport_fastrtps_cpp;rosidl_typesupport_introspection_cpp")
32+
33+
34+
if(BUILD_TESTING)
35+
find_package(ament_lint_auto REQUIRED)
36+
# the following line skips the linter which checks for copyrights
37+
# uncomment the line when a copyright and license is not present in all source files
38+
#set(ament_cmake_copyright_FOUND TRUE)
39+
# the following line skips cpplint (only works in a git repo)
40+
# uncomment the line when this package is not in a git repo
41+
#set(ament_cmake_cpplint_FOUND TRUE)
42+
ament_lint_auto_find_test_dependencies()
43+
endif()
44+
45+
ament_package()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0"?>
2+
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
3+
<package format="3">
4+
<name>rmw_dds_common_typesupports</name>
5+
<version>0.1.0</version>
6+
<description>A meta-package to hack type support generation for backported rmw_dds_common</description>
7+
<maintainer email="[email protected]">Andrea Sorbini</maintainer>
8+
<license>Apache 2.0</license>
9+
10+
<buildtool_depend>ament_cmake</buildtool_depend>
11+
12+
<depend>rosidl_typesupport_fastrtps_c</depend>
13+
<depend>rosidl_typesupport_fastrtps_cpp</depend>
14+
<depend>rosidl_typesupport_introspection_c</depend>
15+
<depend>rosidl_typesupport_introspection_cpp</depend>
16+
17+
<test_depend>ament_lint_auto</test_depend>
18+
<test_depend>ament_lint_common</test_depend>
19+
20+
<export>
21+
<build_type>ament_cmake</build_type>
22+
</export>
23+
</package>

0 commit comments

Comments
 (0)