diff --git a/.github/workflows/humble.yml b/.github/workflows/humble.yml
index ec17a05..fbac52d 100644
--- a/.github/workflows/humble.yml
+++ b/.github/workflows/humble.yml
@@ -14,16 +14,16 @@ jobs:
steps:
- name: Update
- run: apt update
+ run: apt-get update
- name: Install PIP
- run: apt install -y python3-pip lcov
+ run: apt-get install -y python3-pip lcov
- name: Install colcon tools
run: python3 -m pip install colcon-lcov-result colcon-coveragepy-result
- name: Run Tests
- uses: ros-tooling/action-ros-ci@0.3.5
+ uses: ros-tooling/action-ros-ci@0.3.6
with:
ref: humble
target-ros2-distro: humble
@@ -34,4 +34,4 @@ jobs:
with:
name: colcon-logs
path: ros_ws/log
- if: always()
+ if: failure()
diff --git a/.github/workflows/iron.yml b/.github/workflows/iron.yml
index 23b4bcb..079b8e7 100644
--- a/.github/workflows/iron.yml
+++ b/.github/workflows/iron.yml
@@ -14,19 +14,19 @@ jobs:
steps:
- name: Update
- run: apt update
+ run: apt-get update
- name: Install PIP
- run: apt install -y python3-pip lcov
+ run: apt-get install -y python3-pip lcov
- name: Install colcon tools
run: python3 -m pip install colcon-lcov-result colcon-coveragepy-result
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
- name: Run Tests
- uses: ros-tooling/action-ros-ci@0.3.5
+ uses: ros-tooling/action-ros-ci@0.3.6
with:
target-ros2-distro: iron
import-token: ${{ secrets.GITHUB_TOKEN }}
@@ -37,4 +37,4 @@ jobs:
with:
name: colcon-logs
path: ros_ws/log
- if: always()
+ if: failure()
diff --git a/.github/workflows/rolling.yml b/.github/workflows/rolling.yml
index b56161d..3fcc6f8 100644
--- a/.github/workflows/rolling.yml
+++ b/.github/workflows/rolling.yml
@@ -1,4 +1,4 @@
-name: Ubuntu 22.04 Rolling Build
+name: Ubuntu 24.04 Rolling Build
on:
pull_request:
@@ -10,23 +10,20 @@ jobs:
Build:
runs-on: self-hosted
container:
- image: osrf/ros:rolling-desktop-full-jammy
+ image: osrf/ros:rolling-desktop-full
steps:
- name: Update
- run: apt update
+ run: apt-get update
- name: Install PIP
- run: apt install -y python3-pip lcov
-
- - name: Install colcon tools
- run: python3 -m pip install colcon-lcov-result colcon-coveragepy-result
+ run: apt-get install -y python3-pip lcov python3-colcon-lcov-result python3-colcon-coveragepy-result
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
- name: Run Tests
- uses: ros-tooling/action-ros-ci@0.3.5
+ uses: ros-tooling/action-ros-ci@0.3.13
with:
target-ros2-distro: rolling
import-token: ${{ secrets.GITHUB_TOKEN }}
@@ -37,4 +34,4 @@ jobs:
with:
name: colcon-logs
path: ros_ws/log
- if: always()
+ if: failure()
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d93bc1c..883a0d3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,12 +3,14 @@ project(native_adapters)
set(CMAKE_CXX_STANDARD 17)
+add_compile_options(-Wall -Wextra -Wpedantic -Wconversion -Wdouble-promotion -Wfloat-equal -Wshadow)
+
find_package(std_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
-find_package(OpenCV REQUIRED)
+find_package(OpenCV REQUIRED COMPONENTS core)
find_package(PCL 1.12 REQUIRED COMPONENTS common)
find_package(pcl_conversions REQUIRED)
find_package(cv_bridge REQUIRED)
@@ -42,7 +44,7 @@ target_link_libraries(pcl_adapters
rclcpp::rclcpp
${std_msgs_TARGETS}
${sensor_msgs_TARGETS}
- ${PCL_LIBRARIES}
+ pcl_common
)
add_library(cv_adapters SHARED
@@ -67,7 +69,7 @@ target_link_libraries(cv_adapters
${nav_msgs_TARGETS}
${dem_msgs_TARGETS}
${cv_bridge_TARGETS}
- ${OpenCV_LIBS}
+ opencv_core
)
install(
diff --git a/package.xml b/package.xml
index 9923e78..e2f07a0 100644
--- a/package.xml
+++ b/package.xml
@@ -17,7 +17,7 @@
nav_msgs
dem_msgs
libopencv-dev
- libpcl-common
+ libpcl-all-dev
pcl_conversions
cv_bridge
diff --git a/src/NavMsgOccupancyGrid_CvMat.cpp b/src/NavMsgOccupancyGrid_CvMat.cpp
index e7ce6ce..0a7105f 100644
--- a/src/NavMsgOccupancyGrid_CvMat.cpp
+++ b/src/NavMsgOccupancyGrid_CvMat.cpp
@@ -50,7 +50,8 @@ void rclcpp::TypeAdapter(y, x) - 1;
+ destination.data[y * source.mat.cols + x] =
+ static_cast(source.mat.at(y, x) - 1);
}
}
destination.header = source.header;
@@ -67,7 +68,8 @@ void rclcpp::TypeAdapter:
cv::Mat(source.info.height, source.info.width, CV_MAKETYPE(cv::DataType::type, 1));
for (unsigned int y = 0; y < source.info.height; ++y) {
for (unsigned int x = 0; x < source.info.width; ++x) {
- destination.mat.at(y, x) = source.data[y * source.info.width + x] + 1;
+ destination.mat.at(y, x) =
+ static_cast(source.data[y * source.info.width + x] + 1);
}
}
destination.header = source.header;
diff --git a/src/SensorMsgPointCloud2_PCLPointCloud.cpp b/src/SensorMsgPointCloud2_PCLPointCloud.cpp
index 900239a..3560abf 100644
--- a/src/SensorMsgPointCloud2_PCLPointCloud.cpp
+++ b/src/SensorMsgPointCloud2_PCLPointCloud.cpp
@@ -35,20 +35,20 @@ StampedPointCloud_PCL & StampedPointCloud_PCL::operator=(const StampedPointCloud
uint32_t StampedPointCloud_PCL::width() const
{
- return std::visit([](auto && cloud) {return cloud.width;}, cloud);
+ return std::visit([](auto && _cloud) {return _cloud.width;}, cloud);
}
uint32_t StampedPointCloud_PCL::height() const
{
- return std::visit([](auto && cloud) {return cloud.height;}, cloud);
+ return std::visit([](auto && _cloud) {return _cloud.height;}, cloud);
}
bool StampedPointCloud_PCL::has_colors() const
{
return std::visit(
- [](auto && cloud) {
- using T = typename std::decay_t::PointType;
+ [](auto && _cloud) {
+ using T = typename std::decay_t::PointType;
return pcl::traits::has_color_v;
}, cloud);
}