From 614b36d7f499229dd0fcaf6c512ab63e468892bb Mon Sep 17 00:00:00 2001 From: Bernd Pfrommer Date: Thu, 8 Jan 2026 14:46:55 -0500 Subject: [PATCH 1/5] better reference to vcs file --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ff914be..c1af903 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,4 +16,4 @@ jobs: uses: ros-misc-utilities/ros_build_scripts/.github/workflows/ros2_since_jazzy.yml@master with: repo: ${{ github.event.repository.name }} - vcs_url: https://raw.githubusercontent.com/${{ github.repository }}/ros2/${{ github.event.repository.name }}.repos + vcs_url: ${{ github.event.repository.name }}.repos From 1f900443c72e4b2882900fcb38aaa8ab5eb06646 Mon Sep 17 00:00:00 2001 From: Bernd Pfrommer Date: Thu, 8 Jan 2026 16:37:22 -0500 Subject: [PATCH 2/5] avoid ament_target_dependencies --- CMakeLists.txt | 80 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 53 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3fa569d..a55618f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,51 +30,84 @@ find_package(yaml-cpp REQUIRED) find_package(Boost REQUIRED COMPONENTS graph) find_package(GTSAM REQUIRED) -set(tagslam_ament_dependencies +set(tagslam_packages "apriltag_msgs" "cv_bridge" + "flex_sync" "geometry_msgs" "image_transport" - "flex_sync" "nav_msgs" "rclcpp" "rclcpp_components" "rosbag2_cpp" "rosbag2_transport" + "rosgraph_msgs" "sensor_msgs" + "std_srvs" "tf2_ros" "tf2_msgs" - "tf2" - "rosgraph_msgs" - "std_srvs") + "tf2") -set(sync_and_detect_ament_dependencies +set(sync_and_detect_packages "apriltag_msgs" "apriltag_detector" "cv_bridge" "flex_sync" "image_transport" - "pluginlib" "nav_msgs" + "pluginlib" "rclcpp" "sensor_msgs") -set(all_ament_dependencies - ${tagslam_ament_dependencies} - ${sync_and_detect_ament_dependencies}) +set(all_packages ${tagslam_packages} ${sync_and_detect_packages}) -foreach(pkg ${all_ament_dependencies}) + foreach(pkg ${all_packages}) find_package(${pkg} REQUIRED) endforeach() -if(${cv_bridge_VERSION} GREATER "3.3.0") - add_definitions(-DUSE_CV_BRIDGE_HPP) +set(sync_and_detect_dependencies + ${apriltag_msgs_TARGETS} + apriltag_detector::apriltag_detector + cv_bridge::cv_bridge + flex_sync::flex_sync + image_transport::image_transport + ${nav_msgs_TARGETS} + pluginlib::pluginlib + rclcpp::rclcpp + ${sensor_msgs_TARGETS}) + +set(tagslam_dependencies + ${apriltag_msgs_TARGETS} + cv_bridge::cv_bridge + flex_sync::flex_sync + ${geometry_msgs_TARGETS} + gtsam + image_transport::image_transport + ${nav_msgs_TARGETS} + opencv_core + opencv_imgproc + opencv_calib3d + yaml-cpp + rclcpp::rclcpp + rclcpp_components::component + rosbag2_cpp::rosbag2_cpp + rosbag2_transport::rosbag2_transport + ${rosgraph_msgs_TARGETS} + ${sensor_msgs_TARGETS} + ${std_srvs_TARGETS} + tf2_ros::tf2_ros + ${tf2_msgs_TARGETS} + tf2::tf2) + + + if(${image_transport_VERSION} VERSION_GREATER_EQUAL "6.3.0") + add_definitions(-DIMAGE_TRANSPORT_USE_QOS) endif() - -if(${image_transport_VERSION} VERSION_GREATER_EQUAL "6.3.0") - add_definitions(-DIMAGE_TRANSPORT_USE_QOS) +if(${image_transport_VERSION} VERSION_GREATER_EQUAL "6.4.0") + add_definitions(-DIMAGE_TRANSPORT_USE_NODEINTERFACE) endif() + # # --------- library # @@ -120,8 +153,7 @@ add_library(${PROJECT_NAME} SHARED src/yaml.cpp ) -ament_target_dependencies(${PROJECT_NAME} ${tagslam_ament_dependencies}) -target_link_libraries(${PROJECT_NAME} opencv_core opencv_imgproc opencv_calib3d yaml-cpp gtsam) +target_link_libraries(${PROJECT_NAME} PUBLIC ${tagslam_dependencies}) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) target_include_directories( @@ -136,7 +168,6 @@ rclcpp_components_register_nodes(${PROJECT_NAME} "${PROJECT_NAME}::TagSLAM") # -------- node # add_executable(${PROJECT_NAME}_node src/tagslam_node.cpp) -# ament_target_dependencies(${PROJECT_NAME}_node ${tagslam_ament_dependencies}) target_link_libraries(${PROJECT_NAME}_node ${PROJECT_NAME}) target_include_directories(${PROJECT_NAME}_node PRIVATE include) target_compile_features(${PROJECT_NAME}_node PRIVATE cxx_std_17) @@ -147,8 +178,7 @@ target_compile_features(${PROJECT_NAME}_node PRIVATE cxx_std_17) add_library(sync_and_detect SHARED src/sync_and_detect.cpp ) -ament_target_dependencies(sync_and_detect ${sync_and_detect_ament_dependencies}) -target_link_libraries(sync_and_detect yaml-cpp) +target_link_libraries(sync_and_detect yaml-cpp ${sync_and_detect_dependencies}) target_compile_features(sync_and_detect PRIVATE cxx_std_17) target_include_directories( @@ -165,10 +195,7 @@ rclcpp_components_register_nodes(sync_and_detect "${PROJECT_NAME}::SyncAndDetect add_executable(${PROJECT_NAME}_from_bag src/${PROJECT_NAME}_from_bag.cpp src/enhanced_player.cpp) -ament_target_dependencies(${PROJECT_NAME}_from_bag - ${tagslam_ament_dependencies} - rosbag2_transport) -target_link_libraries(${PROJECT_NAME}_from_bag ${PROJECT_NAME} sync_and_detect) +target_link_libraries(${PROJECT_NAME}_from_bag ${PROJECT_NAME} sync_and_detect ${tagslam_dependencies}) target_include_directories(${PROJECT_NAME}_from_bag PRIVATE include) target_compile_features(${PROJECT_NAME}_from_bag PRIVATE cxx_std_17) @@ -179,8 +206,7 @@ target_compile_features(${PROJECT_NAME}_from_bag PRIVATE cxx_std_17) add_executable(sync_and_detect_from_bag src/sync_and_detect_from_bag.cpp src/enhanced_player.cpp) -ament_target_dependencies(sync_and_detect_from_bag rosbag2_transport) -target_link_libraries(sync_and_detect_from_bag sync_and_detect yaml-cpp) +target_link_libraries(sync_and_detect_from_bag sync_and_detect yaml-cpp rosbag2_transport::rosbag2_transport) target_include_directories(sync_and_detect_from_bag PRIVATE include) target_compile_features(sync_and_detect_from_bag PRIVATE cxx_std_17) From 96b2d9f536700243f5627a35164e5eb2e4ae5886 Mon Sep 17 00:00:00 2001 From: Bernd Pfrommer Date: Thu, 8 Jan 2026 16:39:59 -0500 Subject: [PATCH 3/5] handle cv_bridge file variations --- src/sync_and_detect.cpp | 2 +- src/tagslam.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sync_and_detect.cpp b/src/sync_and_detect.cpp index 2d4f21f..5bade43 100644 --- a/src/sync_and_detect.cpp +++ b/src/sync_and_detect.cpp @@ -14,7 +14,7 @@ // limitations under the License. #include -#ifdef USE_CV_BRIDGE_HPP +#if __has_include() #include #else #include diff --git a/src/tagslam.cpp b/src/tagslam.cpp index 91c6ab0..cbc0c95 100644 --- a/src/tagslam.cpp +++ b/src/tagslam.cpp @@ -13,12 +13,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef USE_CV_BRIDGE_HPP +#if __has_include() #include #else #include #endif - #include #include From 06984b0552121c0d11bf9b57bd55d1b5cc6c7d2b Mon Sep 17 00:00:00 2001 From: Bernd Pfrommer Date: Thu, 8 Jan 2026 16:40:13 -0500 Subject: [PATCH 4/5] adapt to new image transport interface --- include/tagslam/sync_and_detect.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/tagslam/sync_and_detect.hpp b/include/tagslam/sync_and_detect.hpp index bca84ea..a387598 100644 --- a/include/tagslam/sync_and_detect.hpp +++ b/include/tagslam/sync_and_detect.hpp @@ -51,7 +51,12 @@ class Subscriber const std::string param_name = topic + ".image_transport"; sub_ = std::make_shared( image_transport::create_subscription( - node, topic, +#ifdef IMAGE_TRANSPORT_USE_NODEINTERFACE + *node, +#else + node, +#endif + topic, std::bind( &Subscriber::callback, this, std::placeholders::_1), node->get_parameter_or(param_name, "raw"), From 64265688f5019e884ef6ad730d0b0182f5854fe5 Mon Sep 17 00:00:00 2001 From: Bernd Pfrommer Date: Thu, 8 Jan 2026 17:50:32 -0500 Subject: [PATCH 5/5] fix linter errors --- CMakeLists.txt | 70 +++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a55618f..3014458 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,47 +61,47 @@ set(sync_and_detect_packages set(all_packages ${tagslam_packages} ${sync_and_detect_packages}) - foreach(pkg ${all_packages}) +foreach(pkg ${all_packages}) find_package(${pkg} REQUIRED) endforeach() set(sync_and_detect_dependencies - ${apriltag_msgs_TARGETS} - apriltag_detector::apriltag_detector - cv_bridge::cv_bridge - flex_sync::flex_sync - image_transport::image_transport - ${nav_msgs_TARGETS} - pluginlib::pluginlib - rclcpp::rclcpp - ${sensor_msgs_TARGETS}) + ${apriltag_msgs_TARGETS} + apriltag_detector::apriltag_detector + cv_bridge::cv_bridge + flex_sync::flex_sync + image_transport::image_transport + ${nav_msgs_TARGETS} + pluginlib::pluginlib + rclcpp::rclcpp + ${sensor_msgs_TARGETS}) set(tagslam_dependencies - ${apriltag_msgs_TARGETS} - cv_bridge::cv_bridge - flex_sync::flex_sync - ${geometry_msgs_TARGETS} - gtsam - image_transport::image_transport - ${nav_msgs_TARGETS} - opencv_core - opencv_imgproc - opencv_calib3d - yaml-cpp - rclcpp::rclcpp - rclcpp_components::component - rosbag2_cpp::rosbag2_cpp - rosbag2_transport::rosbag2_transport - ${rosgraph_msgs_TARGETS} - ${sensor_msgs_TARGETS} - ${std_srvs_TARGETS} - tf2_ros::tf2_ros - ${tf2_msgs_TARGETS} - tf2::tf2) - - - if(${image_transport_VERSION} VERSION_GREATER_EQUAL "6.3.0") - add_definitions(-DIMAGE_TRANSPORT_USE_QOS) + ${apriltag_msgs_TARGETS} + cv_bridge::cv_bridge + flex_sync::flex_sync + ${geometry_msgs_TARGETS} + gtsam + image_transport::image_transport + ${nav_msgs_TARGETS} + opencv_core + opencv_imgproc + opencv_calib3d + yaml-cpp + rclcpp::rclcpp + rclcpp_components::component + rosbag2_cpp::rosbag2_cpp + rosbag2_transport::rosbag2_transport + ${rosgraph_msgs_TARGETS} + ${sensor_msgs_TARGETS} + ${std_srvs_TARGETS} + tf2_ros::tf2_ros + ${tf2_msgs_TARGETS} + tf2::tf2) + + +if(${image_transport_VERSION} VERSION_GREATER_EQUAL "6.3.0") + add_definitions(-DIMAGE_TRANSPORT_USE_QOS) endif() if(${image_transport_VERSION} VERSION_GREATER_EQUAL "6.4.0") add_definitions(-DIMAGE_TRANSPORT_USE_NODEINTERFACE)