Skip to content

Commit cce22d3

Browse files
humble: refresh foxglove_bridge (3.5.0, SDK 0.27.0), motion_capture_tracking and sick_safetyscanners_base Windows patches
- foxglove_bridge 3.5.0 uses the SDK's CMake package like jazzy's 3.6.0: take jazzy's patch (macOS/Windows SDK downloads, <map>, no /WX), with the SDK 0.27.0 hashes (checked against upstream's linux-aarch64 one) - motion_capture_tracking 1.0.9 / sick_safetyscanners_base 1.0.4: same Windows changes, new context Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent e4e8b69 commit cce22d3

4 files changed

Lines changed: 35 additions & 189 deletions

File tree

‎distros/humble/patch/ros2-foxglove-bridge.patch‎

Lines changed: 11 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,28 @@
11
diff --git a/CMakeLists.txt b/CMakeLists.txt
2-
index 71deedd..0d1e717 100644
2+
index 9123e37..099e067 100644
33
--- a/CMakeLists.txt
44
+++ b/CMakeLists.txt
5-
@@ -23,9 +23,9 @@ option(FOXGLOVE_BRIDGE_REMOTE_ACCESS "Build with remote access gateway support"
6-
7-
macro(enable_strict_compiler_warnings target)
8-
if (MSVC)
9-
- target_compile_options(${target} PRIVATE /WX /W4)
10-
+ target_compile_options(${target} PRIVATE /W4)
11-
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
12-
- target_compile_options(${target} PRIVATE -Wall -Wextra -Wpedantic -Werror -Wold-style-cast -Wfloat-equal -Wmost -Wunused-exception-parameter)
13-
+ target_compile_options(${target} PRIVATE -Wall -Wextra -Wpedantic -Werror -Wold-style-cast -Wfloat-equal -Wmost -Wunused-exception-parameter -Wno-error=format)
14-
else()
15-
target_compile_options(${target} PRIVATE -Wall -Wextra -Wpedantic -Werror -Wold-style-cast -Wfloat-equal)
16-
endif()
17-
@@ -63,6 +63,15 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarc
5+
@@ -97,6 +97,18 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarc
186
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
197
set(FOXGLOVE_SDK_PLATFORM "x86_64-unknown-linux-gnu")
20-
set(FOXGLOVE_SDK_SHA "b949295e80eb1a9bb356e657b9c2579c886717fac290c4e48a5e9846063bf2e8")
8+
set(FOXGLOVE_SDK_SHA "4790dad26adaced1a5f81530ed406bab7b60aa202a868eb78cfc04976b9ce6d7")
219
+elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
2210
+ set(FOXGLOVE_SDK_PLATFORM "aarch64-apple-darwin")
23-
+ set(FOXGLOVE_SDK_SHA "1c6a32fc25c3a29eb9f3c5156f9c82970a8714523ffc3893ea4e852b977ee1e5")
11+
+ set(FOXGLOVE_SDK_SHA "70c6e59cf757ac0480912c13cb2c630a3839de34eba428ef717411dae6b1688e")
2412
+elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
2513
+ set(FOXGLOVE_SDK_PLATFORM "x86_64-apple-darwin")
26-
+ set(FOXGLOVE_SDK_SHA "12249d4b2f16c3ff661f21d19603fb33a82888f0391576269f31f9cc1a4cb7a8")
27-
+elseif(WIN32 AND CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64")
14+
+ set(FOXGLOVE_SDK_SHA "c6092c615523d462a9d3779313b8c033cf923ce30a43dc5305d48fe4f6d26988")
15+
+elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64")
16+
+ set(FOXGLOVE_SDK_PLATFORM "aarch64-pc-windows-msvc")
17+
+ set(FOXGLOVE_SDK_SHA "b88abb1bc2c5e230db65cd3d608174f005b3b4563b1c0b2e33db05bc3a2b528b")
18+
+elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64")
2819
+ set(FOXGLOVE_SDK_PLATFORM "x86_64-pc-windows-msvc")
29-
+ set(FOXGLOVE_SDK_SHA "58c3c5e945623bc02b596f748c82e1c8b82daef7871f11f600ff1a606ac9295d")
20+
+ set(FOXGLOVE_SDK_SHA "ae4ac0f4ab9eb998542a5626cd7870ba011824499fe33fa86936e82ed6502185")
3021
else()
3122
message(FATAL_ERROR "Unsupported platform/architecture combination: ${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_SYSTEM_NAME}")
3223
endif()
33-
@@ -84,14 +93,30 @@ target_include_directories(foxglove_cpp_shared SYSTEM
34-
$<INSTALL_INTERFACE:include>
35-
)
36-
target_sources(foxglove_cpp_shared PRIVATE ${FOXGLOVE_SDK_SOURCES})
37-
+# $ORIGIN is ELF-only; macOS' equivalent is @loader_path
38-
+if(APPLE)
39-
+ set(FOXGLOVE_BRIDGE_RPATH "@loader_path")
40-
+else()
41-
+ set(FOXGLOVE_BRIDGE_RPATH "$ORIGIN")
42-
+endif()
43-
# Import the prebuilt C shared library from the fetched SDK
44-
add_library(foxglove-shared SHARED IMPORTED)
45-
-set_target_properties(foxglove-shared PROPERTIES
46-
- IMPORTED_LOCATION ${foxglove_sdk_SOURCE_DIR}/lib/libfoxglove.so
47-
-)
48-
+if(WIN32)
49-
+ # the Windows SDK ships foxglove.dll with the import library foxglove.dll.lib
50-
+ set_target_properties(foxglove-shared PROPERTIES
51-
+ IMPORTED_LOCATION ${foxglove_sdk_SOURCE_DIR}/lib/foxglove.dll
52-
+ IMPORTED_IMPLIB ${foxglove_sdk_SOURCE_DIR}/lib/foxglove.dll.lib
53-
+ )
54-
+ # the C++ wrapper has no dllexport annotations
55-
+ set_target_properties(foxglove_cpp_shared PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
56-
+else()
57-
+ set_target_properties(foxglove-shared PROPERTIES
58-
+ IMPORTED_LOCATION ${foxglove_sdk_SOURCE_DIR}/lib/libfoxglove${CMAKE_SHARED_LIBRARY_SUFFIX}
59-
+ )
60-
+endif()
61-
target_link_libraries(foxglove_cpp_shared PRIVATE foxglove-shared)
62-
set_target_properties(foxglove_cpp_shared PROPERTIES
63-
- INSTALL_RPATH "$ORIGIN"
64-
+ INSTALL_RPATH "${FOXGLOVE_BRIDGE_RPATH}"
65-
BUILD_WITH_INSTALL_RPATH TRUE
66-
)
67-
68-
@@ -168,7 +193,7 @@ target_link_libraries(foxglove_bridge_component
69-
rclcpp_components_register_nodes(foxglove_bridge_component "foxglove_bridge::FoxgloveBridge")
70-
enable_strict_compiler_warnings(foxglove_bridge_component)
71-
set_target_properties(foxglove_bridge_component PROPERTIES
72-
- INSTALL_RPATH "$ORIGIN"
73-
+ INSTALL_RPATH "${FOXGLOVE_BRIDGE_RPATH}"
74-
BUILD_WITH_INSTALL_RPATH TRUE
75-
)
76-
77-
@@ -219,8 +244,14 @@ install(TARGETS foxglove_bridge_component
78-
)
79-
# Install the SDK shared libraries alongside the bridge component library so
80-
# the runtime linker can find them via RPATH ($ORIGIN).
81-
-install(FILES $<TARGET_FILE:foxglove_cpp_shared> DESTINATION lib)
82-
-install(FILES $<TARGET_FILE:foxglove-shared> DESTINATION lib)
83-
+if(WIN32)
84-
+ # DLLs are found through PATH (bin), import libraries in lib
85-
+ install(FILES $<TARGET_FILE:foxglove_cpp_shared> $<TARGET_FILE:foxglove-shared> DESTINATION bin)
86-
+ install(FILES $<TARGET_LINKER_FILE:foxglove_cpp_shared> DESTINATION lib)
87-
+else()
88-
+ install(FILES $<TARGET_FILE:foxglove_cpp_shared> DESTINATION lib)
89-
+ install(FILES $<TARGET_FILE:foxglove-shared> DESTINATION lib)
90-
+endif()
91-
install(TARGETS foxglove_bridge
92-
DESTINATION lib/${PROJECT_NAME}
93-
)
9424
diff --git a/src/message_definition_cache.cpp b/src/message_definition_cache.cpp
95-
index ef72c9c..ed85745 100644
25+
index cf2864e..9124c80 100644
9626
--- a/src/message_definition_cache.cpp
9727
+++ b/src/message_definition_cache.cpp
9828
@@ -3,6 +3,7 @@
Lines changed: 13 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,13 @@
1-
diff --git a/include/foxglove_bridge/generic_client.hpp b/include/foxglove_bridge/generic_client.hpp
2-
index 9478fae..ff1f017 100644
3-
--- a/include/foxglove_bridge/generic_client.hpp
4-
+++ b/include/foxglove_bridge/generic_client.hpp
5-
@@ -23,7 +23,7 @@ public:
6-
7-
std::shared_ptr<void> create_response() override;
8-
std::shared_ptr<rmw_request_id_t> create_request_header() override;
9-
-#if RCLCPP_VERSION_GTE(31, 0, 0)
10-
+#if (RCLCPP_VERSION_MAJOR > 31 || (RCLCPP_VERSION_MAJOR == 31 && (RCLCPP_VERSION_MINOR > 0 || (RCLCPP_VERSION_MINOR == 0 && RCLCPP_VERSION_PATCH >= 0))))
11-
void handle_response(const std::shared_ptr<rmw_request_id_t>& request_header,
12-
const std::shared_ptr<void>& response) override;
13-
#else
14-
diff --git a/src/generic_client.cpp b/src/generic_client.cpp
15-
index 51ed180..a78c3c1 100644
16-
--- a/src/generic_client.cpp
17-
+++ b/src/generic_client.cpp
18-
@@ -70,7 +70,7 @@ std::string getTypeIntrospectionSymbolName(const std::string& serviceType) {
19-
20-
const rosidl_service_type_support_t* GenericClient::getServiceTypeSupportHandle(
21-
const std::string& serviceType) {
22-
-#if RCLCPP_VERSION_GTE(25, 0, 0)
23-
+#if (RCLCPP_VERSION_MAJOR > 25 || (RCLCPP_VERSION_MAJOR == 25 && (RCLCPP_VERSION_MINOR > 0 || (RCLCPP_VERSION_MINOR == 0 && RCLCPP_VERSION_PATCH >= 0))))
24-
// Jazzy and newer can use the built-in rclcpp call.
25-
return rclcpp::get_service_typesupport_handle(serviceType, TYPESUPPORT_LIB_NAME,
26-
*_typeSupportLib);
27-
@@ -120,7 +120,7 @@ GenericClient::GenericClient(rclcpp::node_interfaces::NodeBaseInterface* nodeBas
28-
29-
// get_typesupport_handle is deprecated since rclcpp 25.0.0
30-
// (https://github.com/ros2/rclcpp/pull/2209)
31-
-#if RCLCPP_VERSION_GTE(25, 0, 0)
32-
+#if (RCLCPP_VERSION_MAJOR > 25 || (RCLCPP_VERSION_MAJOR == 25 && (RCLCPP_VERSION_MINOR > 0 || (RCLCPP_VERSION_MINOR == 0 && RCLCPP_VERSION_PATCH >= 0))))
33-
_requestTypeSupportHdl =
34-
rclcpp::get_message_typesupport_handle(requestTypeName, TYPESUPPORT_LIB_NAME, *_typeSupportLib);
35-
_responseTypeSupportHdl = rclcpp::get_message_typesupport_handle(
36-
@@ -155,7 +155,7 @@ std::shared_ptr<rmw_request_id_t> GenericClient::create_request_header() {
37-
return std::shared_ptr<rmw_request_id_t>(new rmw_request_id_t);
38-
}
39-
40-
-#if RCLCPP_VERSION_GTE(31, 0, 0)
41-
+#if (RCLCPP_VERSION_MAJOR > 31 || (RCLCPP_VERSION_MAJOR == 31 && (RCLCPP_VERSION_MINOR > 0 || (RCLCPP_VERSION_MINOR == 0 && RCLCPP_VERSION_PATCH >= 0))))
42-
void GenericClient::handle_response(const std::shared_ptr<rmw_request_id_t>& request_header,
43-
const std::shared_ptr<void>& response) {
44-
#else
45-
diff --git a/src/message_definition_cache.cpp b/src/message_definition_cache.cpp
46-
index ed85745..212e5df 100644
47-
--- a/src/message_definition_cache.cpp
48-
+++ b/src/message_definition_cache.cpp
49-
@@ -12,7 +12,7 @@
50-
#include <utility>
51-
52-
#include <ament_index_cpp/version.h>
53-
-#if AMENT_INDEX_CPP_VERSION_GTE(1, 13, 2)
54-
+#if (AMENT_INDEX_CPP_VERSION_MAJOR > 1 || (AMENT_INDEX_CPP_VERSION_MAJOR == 1 && (AMENT_INDEX_CPP_VERSION_MINOR > 13 || (AMENT_INDEX_CPP_VERSION_MINOR == 13 && AMENT_INDEX_CPP_VERSION_PATCH >= 2))))
55-
#include <ament_index_cpp/get_package_share_path.hpp>
56-
#else
57-
#include <ament_index_cpp/get_package_share_directory.hpp>
58-
@@ -221,7 +221,7 @@ const MessageSpec& MessageDefinitionCache::load_message_spec(
59-
60-
// Get the package share directory, or throw a PackageNotFoundError
61-
std::filesystem::path share_dir;
62-
-#if AMENT_INDEX_CPP_VERSION_GTE(1, 13, 2)
63-
+#if (AMENT_INDEX_CPP_VERSION_MAJOR > 1 || (AMENT_INDEX_CPP_VERSION_MAJOR == 1 && (AMENT_INDEX_CPP_VERSION_MINOR > 13 || (AMENT_INDEX_CPP_VERSION_MINOR == 13 && AMENT_INDEX_CPP_VERSION_PATCH >= 2))))
64-
share_dir = ament_index_cpp::get_package_share_path(package);
65-
#else
66-
share_dir = ament_index_cpp::get_package_share_directory(package);
67-
@@ -229,7 +229,7 @@ const MessageSpec& MessageDefinitionCache::load_message_spec(
68-
69-
// Get the rosidl_interfaces index contents for this package
70-
std::string index_contents;
71-
-#if AMENT_INDEX_CPP_VERSION_GTE(1, 13, 0)
72-
+#if (AMENT_INDEX_CPP_VERSION_MAJOR > 1 || (AMENT_INDEX_CPP_VERSION_MAJOR == 1 && (AMENT_INDEX_CPP_VERSION_MINOR > 13 || (AMENT_INDEX_CPP_VERSION_MINOR == 13 && AMENT_INDEX_CPP_VERSION_PATCH >= 0))))
73-
ament_index_cpp::PathWithResource path_with_resource =
74-
ament_index_cpp::get_resource("rosidl_interfaces", package);
75-
if (path_with_resource.resourcePath == std::nullopt) {
76-
diff --git a/src/ros2_foxglove_bridge.cpp b/src/ros2_foxglove_bridge.cpp
77-
index 2229aad..73d3d3e 100644
78-
--- a/src/ros2_foxglove_bridge.cpp
79-
+++ b/src/ros2_foxglove_bridge.cpp
80-
@@ -59,7 +59,7 @@ inline std::vector<std::byte> readFile(const std::string& filepath) {
81-
return buffer;
82-
}
83-
84-
-#if !RCLCPP_VERSION_GTE(28, 0, 0)
85-
+#if !(RCLCPP_VERSION_MAJOR > 28 || (RCLCPP_VERSION_MAJOR == 28 && (RCLCPP_VERSION_MINOR > 0 || (RCLCPP_VERSION_MINOR == 0 && RCLCPP_VERSION_PATCH >= 0))))
86-
// Prior to Jazzy, GenericSubscription drops MessageInfo from the callback.
87-
// This subclass overrides handle_serialized_message to forward it.
88-
class GenericSubscriptionWithMessageInfo : public rclcpp::GenericSubscription {
89-
@@ -833,7 +833,7 @@ Subscription FoxgloveBridge::createRosSubscription(ChannelId channelId, const st
90-
subscriptionOptions.event_callbacks = eventCallbacks;
91-
subscriptionOptions.callback_group = _subscriptionCallbackGroup;
92-
93-
-#if RCLCPP_VERSION_GTE(28, 0, 0)
94-
+#if (RCLCPP_VERSION_MAJOR > 28 || (RCLCPP_VERSION_MAJOR == 28 && (RCLCPP_VERSION_MINOR > 0 || (RCLCPP_VERSION_MINOR == 0 && RCLCPP_VERSION_PATCH >= 0))))
95-
return this->create_generic_subscription(
96-
topic, datatype, qos,
97-
[this, channelId](std::shared_ptr<const rclcpp::SerializedMessage> msg,
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 9123e37..2232b91 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -61,7 +61,7 @@ endif()
6+
7+
macro(enable_strict_compiler_warnings target)
8+
if (MSVC)
9+
- target_compile_options(${target} PRIVATE /WX /W4)
10+
+ target_compile_options(${target} PRIVATE /W4)
11+
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
12+
target_compile_options(${target} PRIVATE -Wall -Wextra -Wpedantic -Werror -Wold-style-cast -Wfloat-equal -Wmost -Wunused-exception-parameter)
13+
else()
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/CMakeLists.txt b/CMakeLists.txt
2-
index 6fb3e04..179d621 100644
2+
index 300f534..35e1093 100644
33
--- a/CMakeLists.txt
44
+++ b/CMakeLists.txt
55
@@ -1,6 +1,9 @@
@@ -13,13 +13,13 @@ index 6fb3e04..179d621 100644
1313
add_compile_options(-Wall -Wextra -Wpedantic)
1414
endif()
1515
diff --git a/deps/libmotioncapture/CMakeLists.txt b/deps/libmotioncapture/CMakeLists.txt
16-
index 8ae21e2..371278f 100644
16+
index 61a4af9..6cf2a5d 100644
1717
--- a/deps/libmotioncapture/CMakeLists.txt
1818
+++ b/deps/libmotioncapture/CMakeLists.txt
19-
@@ -19,6 +19,11 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
20-
set(CMAKE_CXX_EXTENSIONS OFF)
19+
@@ -20,6 +20,11 @@ set(CMAKE_CXX_EXTENSIONS OFF)
2120

22-
find_package(Boost 1.5 REQUIRED) # for optitrack (system component is header-only in Boost 1.70+)
21+
find_package(Threads REQUIRED)
22+
find_package(Boost) # for optitrack
2323
+if(WIN32)
2424
+ # Boost's auto-linking asks MSVC for an unqualified boost_filesystem.lib (LNK1104):
2525
+ # link Boost::filesystem's imported target, which knows the actual library path
@@ -28,13 +28,13 @@ index 8ae21e2..371278f 100644
2828
add_definitions(
2929
-DBOOST_DATE_TIME_NO_LIB
3030
-DBOOST_REGEX_NO_LIB
31-
@@ -233,6 +238,9 @@ add_library(libmotioncapture
31+
@@ -239,6 +244,9 @@ add_library(libmotioncapture
3232
target_link_directories(libmotioncapture PUBLIC
3333
${my_link_directories}
3434
)
3535
+if(WIN32)
3636
+ target_link_libraries(libmotioncapture Boost::filesystem)
3737
+endif()
3838
target_link_libraries(libmotioncapture
39+
Eigen3::Eigen
3940
${my_libraries}
40-
)
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/CMakeLists.txt b/CMakeLists.txt
2-
index 8bf0f32..9ff3fc6 100644
2+
index 15a6663..cf811fe 100644
33
--- a/CMakeLists.txt
44
+++ b/CMakeLists.txt
55
@@ -1,6 +1,9 @@
@@ -9,6 +9,6 @@ index 8bf0f32..9ff3fc6 100644
99
+# no dllexport annotations: export everything so MSVC writes the import library (LNK1181)
1010
+set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
1111
+
12-
## Use C++11
13-
#add_definitions(-std=c++11 -Wall)
14-
## By adding -Wall and -Werror, the compiler does not ignore warnings anymore,
12+
## Find system libraries
13+
find_package(Boost REQUIRED COMPONENTS thread chrono)
14+

0 commit comments

Comments
 (0)