From 45676cf6833d2e436e169fbfd06fc152448179e5 Mon Sep 17 00:00:00 2001 From: Lucas Colley Date: Tue, 17 Nov 2026 23:58:47 +0000 Subject: [PATCH 1/3] Build apriltag_ros on macOS apriltag_ros was Linux-only ("earlier macOS and Windows builds failed"). The macOS build only needs -Werror and the GNU-only linker flags (-Wl,-z,relro,-z,now,-z,defs) left out, which humble's and lyrical's patches (and rolling's .osx.patch) already did; jazzy's patch didn't. - Every distribution builds the same apriltag_ros 3.4.0, so replace the four distribution patches and rolling's .osx.patch with one shared/patch/ros2-apriltag-ros.patch (OpenCV 5 calib/geometry split + macOS). - Select apriltag_ros on `not win` instead of `linux`. - Exclude camera_ros on non-Linux platforms: it needs libcamera (Linux-only), and apriltag_ros only uses it (exec_depend) for its camera launch file. apriltag_ros is the only package depending on it. Verified on osx-arm64: apriltag_ros builds for every distribution, the jazzy build's apriltag_node starts, and no camera_ros/libcamera recipes are generated on macOS. --- distros/jazzy/patch/ros2-apriltag-ros.patch | 30 ------------- distros/lyrical/patch/ros2-apriltag-ros.patch | 43 ------------------- .../rolling/patch/ros2-apriltag-ros.osx.patch | 17 -------- distros/rolling/patch/ros2-apriltag-ros.patch | 30 ------------- .../patch/ros2-apriltag-ros.patch | 0 shared/vinca.yaml | 3 +- 6 files changed, 2 insertions(+), 121 deletions(-) delete mode 100644 distros/jazzy/patch/ros2-apriltag-ros.patch delete mode 100644 distros/lyrical/patch/ros2-apriltag-ros.patch delete mode 100644 distros/rolling/patch/ros2-apriltag-ros.osx.patch delete mode 100644 distros/rolling/patch/ros2-apriltag-ros.patch rename {distros/humble => shared}/patch/ros2-apriltag-ros.patch (100%) diff --git a/distros/jazzy/patch/ros2-apriltag-ros.patch b/distros/jazzy/patch/ros2-apriltag-ros.patch deleted file mode 100644 index 60b9af822..000000000 --- a/distros/jazzy/patch/ros2-apriltag-ros.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 75d5822..8eb328e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -41,7 +41,15 @@ find_package(image_transport REQUIRED) - find_package(cv_bridge REQUIRED) - find_package(Eigen3 REQUIRED NO_MODULE) - find_package(Threads REQUIRED) --find_package(OpenCV REQUIRED COMPONENTS core calib3d) -+find_package(OpenCV REQUIRED COMPONENTS core) -+if(OpenCV_VERSION_MAJOR GREATER 4) -+ # calib3d was split into "calib" + "geometry" in OpenCV 5. -+ find_package(OpenCV REQUIRED COMPONENTS calib geometry) -+ set(APRILTAG_ROS_OPENCV_CALIB_LIBS opencv_calib opencv_geometry) -+else() -+ find_package(OpenCV REQUIRED COMPONENTS calib3d) -+ set(APRILTAG_ROS_OPENCV_CALIB_LIBS opencv_calib3d) -+endif() - find_package(apriltag 3.2 REQUIRED) - - if(cv_bridge_VERSION VERSION_GREATER_EQUAL 3.3.0) -@@ -98,7 +106,7 @@ target_link_libraries(pose_estimation - PUBLIC - apriltag::apriltag - Eigen3::Eigen -- opencv_calib3d -+ ${APRILTAG_ROS_OPENCV_CALIB_LIBS} - conversion - ${geometry_msgs_TARGETS} - tf2::tf2 diff --git a/distros/lyrical/patch/ros2-apriltag-ros.patch b/distros/lyrical/patch/ros2-apriltag-ros.patch deleted file mode 100644 index 45c4480c9..000000000 --- a/distros/lyrical/patch/ros2-apriltag-ros.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 75d5822..cbb5971 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -5,8 +5,10 @@ project(apriltag_ros) - set(CMAKE_CXX_STANDARD 14) - - if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") -- add_compile_options(-Werror -Wall -Wextra -Wpedantic) -- add_link_options("-Wl,-z,relro,-z,now,-z,defs") -+ if(NOT APPLE) -+ add_compile_options(-Werror -Wall -Wextra -Wpedantic) -+ add_link_options("-Wl,-z,relro,-z,now,-z,defs") -+ endif() - endif() - - option(ASAN "use AddressSanitizer to detect memory issues" OFF) -@@ -41,7 +43,15 @@ find_package(image_transport REQUIRED) - find_package(cv_bridge REQUIRED) - find_package(Eigen3 REQUIRED NO_MODULE) - find_package(Threads REQUIRED) --find_package(OpenCV REQUIRED COMPONENTS core calib3d) -+find_package(OpenCV REQUIRED COMPONENTS core) -+if(OpenCV_VERSION_MAJOR GREATER 4) -+ # calib3d was split into "calib" + "geometry" in OpenCV 5. -+ find_package(OpenCV REQUIRED COMPONENTS calib geometry) -+ set(APRILTAG_ROS_OPENCV_CALIB_LIBS opencv_calib opencv_geometry) -+else() -+ find_package(OpenCV REQUIRED COMPONENTS calib3d) -+ set(APRILTAG_ROS_OPENCV_CALIB_LIBS opencv_calib3d) -+endif() - find_package(apriltag 3.2 REQUIRED) - - if(cv_bridge_VERSION VERSION_GREATER_EQUAL 3.3.0) -@@ -98,7 +108,7 @@ target_link_libraries(pose_estimation - PUBLIC - apriltag::apriltag - Eigen3::Eigen -- opencv_calib3d -+ ${APRILTAG_ROS_OPENCV_CALIB_LIBS} - conversion - ${geometry_msgs_TARGETS} - tf2::tf2 diff --git a/distros/rolling/patch/ros2-apriltag-ros.osx.patch b/distros/rolling/patch/ros2-apriltag-ros.osx.patch deleted file mode 100644 index fbf5a199c..000000000 --- a/distros/rolling/patch/ros2-apriltag-ros.osx.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 20bdedf..4e9d53d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -5,8 +5,10 @@ project(apriltag_ros) - set(CMAKE_CXX_STANDARD 14) - - if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") -- add_compile_options(-Werror -Wall -Wextra -Wpedantic) -- add_link_options("-Wl,-z,relro,-z,now,-z,defs") -+ if(NOT APPLE) -+ add_compile_options(-Werror -Wall -Wextra -Wpedantic) -+ add_link_options("-Wl,-z,relro,-z,now,-z,defs") -+ endif() - endif() - - option(ASAN "use AddressSanitizer to detect memory issues" OFF) diff --git a/distros/rolling/patch/ros2-apriltag-ros.patch b/distros/rolling/patch/ros2-apriltag-ros.patch deleted file mode 100644 index 60b9af822..000000000 --- a/distros/rolling/patch/ros2-apriltag-ros.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 75d5822..8eb328e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -41,7 +41,15 @@ find_package(image_transport REQUIRED) - find_package(cv_bridge REQUIRED) - find_package(Eigen3 REQUIRED NO_MODULE) - find_package(Threads REQUIRED) --find_package(OpenCV REQUIRED COMPONENTS core calib3d) -+find_package(OpenCV REQUIRED COMPONENTS core) -+if(OpenCV_VERSION_MAJOR GREATER 4) -+ # calib3d was split into "calib" + "geometry" in OpenCV 5. -+ find_package(OpenCV REQUIRED COMPONENTS calib geometry) -+ set(APRILTAG_ROS_OPENCV_CALIB_LIBS opencv_calib opencv_geometry) -+else() -+ find_package(OpenCV REQUIRED COMPONENTS calib3d) -+ set(APRILTAG_ROS_OPENCV_CALIB_LIBS opencv_calib3d) -+endif() - find_package(apriltag 3.2 REQUIRED) - - if(cv_bridge_VERSION VERSION_GREATER_EQUAL 3.3.0) -@@ -98,7 +106,7 @@ target_link_libraries(pose_estimation - PUBLIC - apriltag::apriltag - Eigen3::Eigen -- opencv_calib3d -+ ${APRILTAG_ROS_OPENCV_CALIB_LIBS} - conversion - ${geometry_msgs_TARGETS} - tf2::tf2 diff --git a/distros/humble/patch/ros2-apriltag-ros.patch b/shared/patch/ros2-apriltag-ros.patch similarity index 100% rename from distros/humble/patch/ros2-apriltag-ros.patch rename to shared/patch/ros2-apriltag-ros.patch diff --git a/shared/vinca.yaml b/shared/vinca.yaml index 2587f04db..028df7f32 100644 --- a/shared/vinca.yaml +++ b/shared/vinca.yaml @@ -399,7 +399,6 @@ packages_select_by_deps: then: - aerostack2 - apex_containers - - apriltag_ros # earlier macOS and Windows builds failed - avt_vimba_camera # ships some Linux .so in the repo, so it only supports linux - camera_ros # Depends on libcamera, only available on linux - can_dbc_parser @@ -542,6 +541,7 @@ packages_select_by_deps: - if: not win then: + - apriltag_ros # macOS needs no -Werror and no GNU linker flags (patch); Windows builds failed - as2_cli - as2_msgs - automatika_embodied_agents @@ -642,6 +642,7 @@ packages_exclude: - if: not linux then: + - camera_ros # libcamera is Linux-only; also dropped from apriltag_ros (only its camera launch file uses it) - pendulum_control - rttest - tlsf From 7f35f159e5f026a460e403c2d156a2e9b6861028 Mon Sep 17 00:00:00 2001 From: Lucas Colley Date: Fri, 20 Nov 2026 11:32:13 +0000 Subject: [PATCH 2/3] vinca.yaml: drop the solved macOS note from apriltag_ros --- shared/vinca.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/vinca.yaml b/shared/vinca.yaml index 028df7f32..d9fecc576 100644 --- a/shared/vinca.yaml +++ b/shared/vinca.yaml @@ -541,7 +541,7 @@ packages_select_by_deps: - if: not win then: - - apriltag_ros # macOS needs no -Werror and no GNU linker flags (patch); Windows builds failed + - apriltag_ros # Windows builds failed - as2_cli - as2_msgs - automatika_embodied_agents From 1dff312c17a85520a88767a3a2cc684fb0a7651d Mon Sep 17 00:00:00 2001 From: Lucas Colley Date: Fri, 20 Nov 2026 11:32:14 +0000 Subject: [PATCH 3/3] vinca.yaml: clarify why camera_ros is excluded off Linux --- shared/vinca.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/vinca.yaml b/shared/vinca.yaml index d9fecc576..ab5b5bab7 100644 --- a/shared/vinca.yaml +++ b/shared/vinca.yaml @@ -642,7 +642,7 @@ packages_exclude: - if: not linux then: - - camera_ros # libcamera is Linux-only; also dropped from apriltag_ros (only its camera launch file uses it) + - camera_ros # libcamera is Linux-only; also removed from the dependencies of the packages that use it - pendulum_control - rttest - tlsf