diff --git a/.github/workflows/ros2.yaml b/.github/workflows/ros2.yaml index e5695f7..0727ef8 100644 --- a/.github/workflows/ros2.yaml +++ b/.github/workflows/ros2.yaml @@ -7,8 +7,12 @@ on: jobs: build_and_test: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ROS_DISTRO: [jazzy, kilted, lyrical, rolling] steps: - uses: actions/checkout@v4 - uses: ros-industrial/industrial_ci@master env: - ROS_DISTRO: jazzy + ROS_DISTRO: ${{ matrix.ROS_DISTRO }} diff --git a/posedetection_msgs/include/posedetection_msgs/feature0d_to_image.h b/posedetection_msgs/include/posedetection_msgs/feature0d_to_image.h index 7377b2a..9ec29d3 100644 --- a/posedetection_msgs/include/posedetection_msgs/feature0d_to_image.h +++ b/posedetection_msgs/include/posedetection_msgs/feature0d_to_image.h @@ -58,6 +58,7 @@ #include #else #include +#include #include #include @@ -70,10 +71,17 @@ #include #endif +#if ROS_VERSION_MAJOR == 1 #include #include #include #include +#else +#include +#include +#include +#include +#endif #if ROS_VERSION_MAJOR == 1 #if BOOST_VERSION < 106000 // since 1.60.0, boost uses placeholders namesapce for _1,_2... diff --git a/posedetection_msgs/src/feature0d_to_image.cpp b/posedetection_msgs/src/feature0d_to_image.cpp index da1f2df..3ef9142 100644 --- a/posedetection_msgs/src/feature0d_to_image.cpp +++ b/posedetection_msgs/src/feature0d_to_image.cpp @@ -13,27 +13,11 @@ // limitations under the License. #include "posedetection_msgs/feature0d_to_image.h" -#if ROS_VERSION_MAJOR == 1 -#include -#include -#include -#else -#include -#include -#include -#endif - -#include -#if ROS_VERSION_MAJOR == 1 -#include -#endif - #if ROS_VERSION_MAJOR == 1 #include #else #include #endif -#include namespace posedetection_msgs { @@ -58,8 +42,15 @@ namespace posedetection_msgs using std::placeholders::_1; using std::placeholders::_2; _pub = _node->create_publisher("~/output", 1); +#if !RCLCPP_VERSION_GTE(29, 0, 0) + // Jazzy and earlier: need to convert QoS to rmw_qos_profile _sub_image.subscribe(_node.get(), "image", rclcpp::QoS(1).get_rmw_qos_profile()); _sub_feature.subscribe(_node.get(), "Feature0D", rclcpp::QoS(1).get_rmw_qos_profile()); +#else + // Kilted and later: QoS object directly + _sub_image.subscribe(_node.get(), "image", rclcpp::QoS(1)); + _sub_feature.subscribe(_node.get(), "Feature0D", rclcpp::QoS(1)); +#endif _sync = std::make_shared>(100); _sync->connectInput(_sub_image, _sub_feature); _sync->registerCallback(std::bind(