diff --git a/patch/ros-jazzy-apriltag-detector-mit.win.patch b/patch/ros-jazzy-apriltag-detector-mit.win.patch new file mode 100644 index 00000000..0a58e0f8 --- /dev/null +++ b/patch/ros-jazzy-apriltag-detector-mit.win.patch @@ -0,0 +1,26 @@ +diff --git a/apriltag_detector_mit/CMakeLists.txt b/apriltag_detector_mit/CMakeLists.txt +index d2d0b53..c204871 100644 +--- a/apriltag_detector_mit/CMakeLists.txt ++++ b/apriltag_detector_mit/CMakeLists.txt +@@ -16,7 +16,10 @@ + cmake_minimum_required(VERSION 3.16) + project(apriltag_detector_mit) + +-add_compile_options(-Wall -Wextra -Wpedantic -Werror) ++if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") ++ add_compile_options(-Wall -Wextra -Wpedantic -Werror) ++endif() ++set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + + # find dependencies + find_package(ament_cmake REQUIRED) +@@ -62,8 +65,7 @@ ament_export_libraries(${PROJECT_NAME}) + + install( + TARGETS ${PROJECT_NAME} +- EXPORT ${PROJECT_NAME}_export +- DESTINATION lib) ++ EXPORT ${PROJECT_NAME}_export) + + if(BUILD_TESTING) + find_package(ament_cmake REQUIRED) diff --git a/patch/ros-jazzy-apriltag-detector-umich.win.patch b/patch/ros-jazzy-apriltag-detector-umich.win.patch new file mode 100644 index 00000000..ef995381 --- /dev/null +++ b/patch/ros-jazzy-apriltag-detector-umich.win.patch @@ -0,0 +1,27 @@ +diff --git a/apriltag_detector_umich/CMakeLists.txt b/apriltag_detector_umich/CMakeLists.txt +index 1899f1e..18d8fbd 100644 +--- a/apriltag_detector_umich/CMakeLists.txt ++++ b/apriltag_detector_umich/CMakeLists.txt +@@ -16,7 +16,10 @@ + cmake_minimum_required(VERSION 3.16) + project(apriltag_detector_umich) + +-add_compile_options(-Wall -Wextra -Wpedantic -Werror) ++if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") ++ add_compile_options(-Wall -Wextra -Wpedantic -Werror) ++endif() ++set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) ++add_definitions(-DNOMINMAX) + + # find dependencies + find_package(ament_cmake REQUIRED) +@@ -64,8 +67,7 @@ ament_export_libraries(${PROJECT_NAME}) + + install( + TARGETS ${PROJECT_NAME} +- EXPORT ${PROJECT_NAME}_export +- DESTINATION lib) ++ EXPORT ${PROJECT_NAME}_export) + + if(BUILD_TESTING) + find_package(ament_cmake REQUIRED) diff --git a/patch/ros-jazzy-apriltag-mit.win.patch b/patch/ros-jazzy-apriltag-mit.win.patch new file mode 100644 index 00000000..125a9f3c --- /dev/null +++ b/patch/ros-jazzy-apriltag-mit.win.patch @@ -0,0 +1,33 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 31c98e5..5ac04e1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,6 +9,10 @@ project(apriltag_mit VERSION 1.0.0 LANGUAGES CXX) + include(CMakePackageConfigHelpers) + include(GNUInstallDirs) + ++set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) ++ ++add_compile_definitions(_USE_MATH_DEFINES) ++ + # set(CMAKE_CXX_CLANG_TIDY clang-tidy) + + find_package(Eigen3 REQUIRED) +diff --git a/src/TagFamily.cc b/src/TagFamily.cc +index 023094b..0226a43 100644 +--- a/src/TagFamily.cc ++++ b/src/TagFamily.cc +@@ -102,6 +102,13 @@ code_t Rotate90DegCwise(code_t w, int d) { + return wr; + } + ++#ifdef _MSC_VER ++# include ++unsigned __builtin_popcountll( unsigned long long data){ ++ return __popcnt(data) + __popcnt(data >> 32); ++} ++#endif ++ + unsigned HammingDistance(code_t a, code_t b) { + // Because code_t is unsigned long long + return __builtin_popcountll(a ^ b); diff --git a/vinca.yaml b/vinca.yaml index 34e114e4..9a2e0c5d 100644 --- a/vinca.yaml +++ b/vinca.yaml @@ -126,6 +126,12 @@ packages_select_by_deps: - apriltag_detector + - apriltag_detector_umich + + - apriltag_detector_mit + - apriltag_draw + - apriltag_tools + - ament_cmake_black - behaviortree_cpp @@ -163,10 +169,6 @@ packages_select_by_deps: # most of the dep of grid_map work on Windows, but there are some rviz linking problems in octomap_rviz_plugins, # see https://github.com/RoboStack/ros-jazzy/pull/79#issuecomment-2993499990 - grid_map - - apriltag_draw - - apriltag_tools - - apriltag_detector_umich - - apriltag_detector_mit - dual-laser-merger - pointcloud-to-laserscan - laser-segmentation