Skip to content

Commit

Permalink
Merge branch 'iron' into build/cmake_version
Browse files Browse the repository at this point in the history
  • Loading branch information
roncapat authored Sep 12, 2024
2 parents 89122d1 + cc859a9 commit 684ac61
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 29 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/humble.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -34,4 +34,4 @@ jobs:
with:
name: colcon-logs
path: ros_ws/log
if: always()
if: failure()
10 changes: 5 additions & 5 deletions .github/workflows/iron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -37,4 +37,4 @@ jobs:
with:
name: colcon-logs
path: ros_ws/log
if: always()
if: failure()
17 changes: 7 additions & 10 deletions .github/workflows/rolling.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Ubuntu 22.04 Rolling Build
name: Ubuntu 24.04 Rolling Build

on:
pull_request:
Expand All @@ -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 }}
Expand All @@ -37,4 +34,4 @@ jobs:
with:
name: colcon-logs
path: ros_ws/log
if: always()
if: failure()
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -67,7 +69,7 @@ target_link_libraries(cv_adapters
${nav_msgs_TARGETS}
${dem_msgs_TARGETS}
${cv_bridge_TARGETS}
${OpenCV_LIBS}
opencv_core
)

install(
Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<depend>nav_msgs</depend>
<depend>dem_msgs</depend>
<depend>libopencv-dev</depend>
<depend>libpcl-common</depend>
<depend>libpcl-all-dev</depend>
<depend>pcl_conversions</depend>
<depend>cv_bridge</depend>

Expand Down
6 changes: 4 additions & 2 deletions src/NavMsgOccupancyGrid_CvMat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ void rclcpp::TypeAdapter<StampedOccupancyGrid_CV,
destination.data.resize(source.mat.rows * source.mat.cols);
for (int y = 0; y < source.mat.rows; ++y) {
for (int x = 0; x < source.mat.cols; ++x) {
destination.data[y * source.mat.cols + x] = source.mat.at<uint8_t>(y, x) - 1;
destination.data[y * source.mat.cols + x] =
static_cast<int8_t>(source.mat.at<uint8_t>(y, x) - 1);
}
}
destination.header = source.header;
Expand All @@ -67,7 +68,8 @@ void rclcpp::TypeAdapter<StampedOccupancyGrid_CV, nav_msgs::msg::OccupancyGrid>:
cv::Mat(source.info.height, source.info.width, CV_MAKETYPE(cv::DataType<uint8_t>::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<uint8_t>(y, x) = source.data[y * source.info.width + x] + 1;
destination.mat.at<uint8_t>(y, x) =
static_cast<uint8_t>(source.data[y * source.info.width + x] + 1);
}
}
destination.header = source.header;
Expand Down
8 changes: 4 additions & 4 deletions src/SensorMsgPointCloud2_PCLPointCloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<decltype(cloud)>::PointType;
[](auto && _cloud) {
using T = typename std::decay_t<decltype(_cloud)>::PointType;
return pcl::traits::has_color_v<T>;
}, cloud);
}
Expand Down

0 comments on commit 684ac61

Please sign in to comment.