Skip to content

Commit 47ca620

Browse files
committed
Patched rmw_fastrtps so string comparison is correct
1 parent 905f04c commit 47ca620

File tree

5 files changed

+25
-70
lines changed

5 files changed

+25
-70
lines changed

.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ build:clang --linkopt="-fuse-ld=lld"
3232

3333
# CycloneDDS is used as DDS vendor in the ROS Middleware by default in this repo.
3434
# To use FastDDS, invoke Bazel with `--config=fastdds`.
35-
build:fastdds --//ros2:dds_vendor=fastdds
35+
build:fastdds --@com_github_mvukov_rules_ros2//ros2:dds_vendor=fastdds
3636

3737
# Load any settings specific to the current user.
3838
# user.bazelrc should appear in .gitignore so that settings are not shared with

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Available features:
2222
- Defining ROS 2 deployments with `ros2_launch` Bazel macro.
2323
- Defining ROS 2 tests with `ros2_test` Bazel macro.
2424
- Defining ROS 2 plugins with `ros2_plugin` Bazel macro.
25-
- Only CycloneDDS middleware can be used at the moment.
25+
- CycloneDDS (default) and FastDDS middleware are supported.
2626
- Zero copy transport via shared memory backend ([iceoryx](https://github.com/eclipse-iceoryx/iceoryx)) for CycloneDDS.
2727
- Utilities:
2828
- [`foxglove_bridge`](https://github.com/foxglove/ros-foxglove-bridge) for visualization and debugging
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
diff --git a/rmw_fastrtps_dynamic_cpp/src/type_support_common.cpp b/rmw_fastrtps_dynamic_cpp/src/type_support_common.cpp
2+
index d602069..62e4362 100644
3+
--- a/rmw_fastrtps_dynamic_cpp/src/type_support_common.cpp
4+
+++ b/rmw_fastrtps_dynamic_cpp/src/type_support_common.cpp
5+
@@ -25,12 +25,13 @@
6+
bool
7+
using_introspection_c_typesupport(const char * typesupport_identifier)
8+
{
9+
- return typesupport_identifier == rosidl_typesupport_introspection_c__identifier;
10+
+ return !std::string(typesupport_identifier)
11+
+ .compare(rosidl_typesupport_introspection_c__identifier);
12+
}
13+
14+
bool
15+
using_introspection_cpp_typesupport(const char * typesupport_identifier)
16+
{
17+
- return typesupport_identifier ==
18+
- rosidl_typesupport_introspection_cpp::typesupport_identifier;
19+
+ return !std::string(typesupport_identifier)
20+
+ .compare(rosidl_typesupport_introspection_cpp::typesupport_identifier);
21+
}

repositories/ros2_repositories_impl.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ def ros2_repositories_impl():
275275
http_archive,
276276
name = "ros2_rmw_fastrtps",
277277
build_file = "@com_github_mvukov_rules_ros2//repositories:rmw_fastrtps.BUILD.bazel",
278+
patch_args = ["-p1"],
279+
patches = ["@com_github_mvukov_rules_ros2//repositories/patches:rmw_fastrtps-fix-typesupport-conditions-bug.patch"],
278280
sha256 = "a0145b414207a2528fd56e98a56bd6d4c3f0353dcd58f4b3a65224af8bd52284",
279281
strip_prefix = "rmw_fastrtps-6.2.3",
280282
url = "https://github.com/ros2/rmw_fastrtps/archive/refs/tags/6.2.3.tar.gz",

repositories/rosidl_typesupport_fastrtps.BUILD.bazel

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -41,71 +41,3 @@ ros2_cpp_library(
4141
"@ros2_rosidl//:rosidl_runtime_c",
4242
],
4343
)
44-
45-
py_library(
46-
name = "rosidl_typesupport_fastrtps_generator_c_lib",
47-
srcs = ["rosidl_typesupport_fastrtps_c/rosidl_typesupport_fastrtps_c/__init__.py"],
48-
imports = ["rosidl_typesupport_fastrtps_c"],
49-
visibility = ["//visibility:public"],
50-
deps = [
51-
"@ros2_rosidl//:rosidl_cmake",
52-
"@ros2_rosidl//:rosidl_parser",
53-
],
54-
)
55-
56-
_ROSIDL_TYPESUPPORT_FASTRTPS_GENERATOR_C_APP_PY = "rosidl_typesupport_fastrtps_generator_c_app.py"
57-
58-
copy_file(
59-
name = "rosidl_typesupport_fastrtps_generator_c_copy",
60-
src = "rosidl_typesupport_fastrtps_c/bin/rosidl_typesupport_fastrtps_c",
61-
out = _ROSIDL_TYPESUPPORT_FASTRTPS_GENERATOR_C_APP_PY,
62-
)
63-
64-
py_binary(
65-
name = "rosidl_typesupport_fastrtps_generator_c_app",
66-
srcs = [_ROSIDL_TYPESUPPORT_FASTRTPS_GENERATOR_C_APP_PY],
67-
legacy_create_init = False,
68-
main = _ROSIDL_TYPESUPPORT_FASTRTPS_GENERATOR_C_APP_PY,
69-
visibility = ["//visibility:public"],
70-
deps = [":rosidl_typesupport_fastrtps_generator_c_lib"],
71-
)
72-
73-
filegroup(
74-
name = "rosidl_typesupport_fastrtps_generator_c_templates",
75-
srcs = glob(["rosidl_typesupport_fastrtps_c/resource/*.em"]),
76-
visibility = ["//visibility:public"],
77-
)
78-
79-
py_library(
80-
name = "rosidl_typesupport_fastrtps_generator_cpp_lib",
81-
srcs = ["rosidl_typesupport_fastrtps_cpp/rosidl_typesupport_fastrtps_cpp/__init__.py"],
82-
imports = ["rosidl_typesupport_fastrtps_cpp"],
83-
visibility = ["//visibility:public"],
84-
deps = [
85-
"@ros2_rosidl//:rosidl_cmake",
86-
"@ros2_rosidl//:rosidl_parser",
87-
],
88-
)
89-
90-
_ROSIDL_TYPESUPPORT_FASTRTPS_GENERATOR_CPP_APP_PY = "rosidl_typesupport_fastrtps_generator_cpp_app.py"
91-
92-
copy_file(
93-
name = "rosidl_typesupport_fastrtps_generator_cpp_copy",
94-
src = "rosidl_typesupport_fastrtps_cpp/bin/rosidl_typesupport_fastrtps_cpp",
95-
out = _ROSIDL_TYPESUPPORT_FASTRTPS_GENERATOR_CPP_APP_PY,
96-
)
97-
98-
py_binary(
99-
name = "rosidl_typesupport_fastrtps_generator_cpp_app",
100-
srcs = [_ROSIDL_TYPESUPPORT_FASTRTPS_GENERATOR_CPP_APP_PY],
101-
legacy_create_init = False,
102-
main = _ROSIDL_TYPESUPPORT_FASTRTPS_GENERATOR_CPP_APP_PY,
103-
visibility = ["//visibility:public"],
104-
deps = [":rosidl_typesupport_fastrtps_generator_cpp_lib"],
105-
)
106-
107-
filegroup(
108-
name = "rosidl_typesupport_fastrtps_generator_cpp_templates",
109-
srcs = glob(["rosidl_typesupport_fastrtps_cpp/resource/*.em"]),
110-
visibility = ["//visibility:public"],
111-
)

0 commit comments

Comments
 (0)