From e808f232861fa6eeece8fee1f47b80d7ee1cd52d Mon Sep 17 00:00:00 2001 From: Ibrahim Date: Sun, 14 Jun 2026 18:57:52 +0100 Subject: [PATCH 1/6] fix: update CMake policies and improve message target linking for ROS2 --- CMakeLists.txt | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f0ef6f4c..e61e8bc5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -210,6 +210,10 @@ else(ROS_EDITION STREQUAL "ROS2") # Copyright(c) 2020 livoxtech limited. cmake_minimum_required(VERSION 3.14) + if(POLICY CMP0144) + cmake_policy(SET CMP0144 NEW) + set(CMAKE_POLICY_DEFAULT_CMP0144 NEW) + endif() project(livox_ros_driver2) # Default to C99 @@ -302,23 +306,27 @@ else(ROS_EDITION STREQUAL "ROS2") target_include_directories(${PROJECT_NAME} PRIVATE ${livox_sdk_INCLUDE_DIRS}) - # get include directories of custom msg headers - if(HUMBLE_ROS STREQUAL "humble") - rosidl_get_typesupport_target(cpp_typesupport_target - ${LIVOX_INTERFACES} "rosidl_typesupport_cpp") - target_link_libraries(${PROJECT_NAME} "${cpp_typesupport_target}") + # Link the generated custom message target. The generated target carries the + # include directories for livox_ros_driver2/msg/*.hpp on ROS 2 distros such as + # Humble and Jazzy, so do not read INTERFACE_INCLUDE_DIRECTORIES directly. + if(COMMAND rosidl_get_typesupport_target) + rosidl_get_typesupport_target(LIVOX_INTERFACE_TARGET + ${LIVOX_INTERFACES} "rosidl_typesupport_cpp") else() set(LIVOX_INTERFACE_TARGET "${LIVOX_INTERFACES}__rosidl_typesupport_cpp") - add_dependencies(${PROJECT_NAME} ${LIVOX_INTERFACES}) - get_target_property(LIVOX_INTERFACES_INCLUDE_DIRECTORIES ${LIVOX_INTERFACE_TARGET} INTERFACE_INCLUDE_DIRECTORIES) endif() + if(NOT LIVOX_INTERFACE_TARGET OR NOT TARGET ${LIVOX_INTERFACE_TARGET}) + message(FATAL_ERROR "Failed to resolve ${LIVOX_INTERFACES} C++ typesupport target") + endif() + + add_dependencies(${PROJECT_NAME} ${LIVOX_INTERFACES}) + # include file direcotry target_include_directories(${PROJECT_NAME} PUBLIC ${PCL_INCLUDE_DIRS} ${APR_INCLUDE_DIRS} ${LIVOX_LIDAR_SDK_INCLUDE_DIR} - ${LIVOX_INTERFACES_INCLUDE_DIRECTORIES} # for custom msgs 3rdparty src ) @@ -367,4 +375,4 @@ else(ROS_EDITION STREQUAL "ROS2") launch ) -endif() \ No newline at end of file +endif() From 46e69f5e3ff3cc21d53e7e34840f1b8a4b706025 Mon Sep 17 00:00:00 2001 From: Marc Hanheide Date: Sun, 14 Jun 2026 21:11:59 +0100 Subject: [PATCH 2/6] Update ROS distribution to include 'jazzy' --- .github/workflows/ros-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ros-ci.yml b/.github/workflows/ros-ci.yml index c9d9d9f8..ea86d5af 100644 --- a/.github/workflows/ros-ci.yml +++ b/.github/workflows/ros-ci.yml @@ -16,7 +16,7 @@ jobs: ros_distribution: # - noetic - humble - # - iron + - jazzy # Define the Docker image(s) associated with each ROS distribution. # The include syntax allows additional variables to be defined, like @@ -38,9 +38,9 @@ jobs: ros_version: 2 # Iron Irwini (May 2023 - November 2024) - # - docker_image: ubuntu:jammy - # ros_distribution: iron - # ros_version: 2 + - docker_image: ubuntu:jammy + ros_distribution: jazzy + ros_version: 2 # # Rolling Ridley (No End-Of-Life) # - docker_image: ubuntu:jammy From 2306d7448c45a02aeaba508cd5e393508ece11e7 Mon Sep 17 00:00:00 2001 From: Marc Hanheide Date: Sun, 14 Jun 2026 21:17:48 +0100 Subject: [PATCH 3/6] Update Docker image from 'jammy' to 'noble' --- .github/workflows/ros-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ros-ci.yml b/.github/workflows/ros-ci.yml index ea86d5af..62fa15ae 100644 --- a/.github/workflows/ros-ci.yml +++ b/.github/workflows/ros-ci.yml @@ -38,7 +38,7 @@ jobs: ros_version: 2 # Iron Irwini (May 2023 - November 2024) - - docker_image: ubuntu:jammy + - docker_image: ubuntu:noble ros_distribution: jazzy ros_version: 2 From a1e7ed20d3c6dd1060e00e139f4df6a4d5bfb56a Mon Sep 17 00:00:00 2001 From: Ibrahim Hroob <47870260+ibrahimhroob@users.noreply.github.com> Date: Mon, 15 Jun 2026 08:11:00 +0100 Subject: [PATCH 4/6] Fix comment: update ROS distribution from Iron Irwini to Jazzy Jalisco --- .github/workflows/ros-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ros-ci.yml b/.github/workflows/ros-ci.yml index 62fa15ae..8d06799c 100644 --- a/.github/workflows/ros-ci.yml +++ b/.github/workflows/ros-ci.yml @@ -37,7 +37,7 @@ jobs: ros_distribution: humble ros_version: 2 - # Iron Irwini (May 2023 - November 2024) + # Jazzy Jalisco (May 2024 - May 2029) - docker_image: ubuntu:noble ros_distribution: jazzy ros_version: 2 From 1a814680f698819a87769254dd579cebf39ed574 Mon Sep 17 00:00:00 2001 From: Ibrahim Hroob <47870260+ibrahimhroob@users.noreply.github.com> Date: Mon, 15 Jun 2026 08:12:55 +0100 Subject: [PATCH 5/6] Add C++ flags to CMake command in CI workflow --- .github/workflows/ros-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ros-ci.yml b/.github/workflows/ros-ci.yml index 8d06799c..6b635d7a 100644 --- a/.github/workflows/ros-ci.yml +++ b/.github/workflows/ros-ci.yml @@ -66,7 +66,7 @@ jobs: git clone --branch v1.2.5 --depth 1 https://github.com/Livox-SDK/Livox-SDK2.git "$REPO_DIR/Livox-SDK2" cd "$REPO_DIR/Livox-SDK2" mkdir -p build && cd build - cmake .. + cmake -DCMAKE_CXX_FLAGS="-include cstdint" .. make -j$(nproc) make install ldconfig From 142a09de15e3019adc8eb548405d984e2c85a3b7 Mon Sep 17 00:00:00 2001 From: Marc Hanheide Date: Mon, 15 Jun 2026 08:16:45 +0100 Subject: [PATCH 6/6] Update ros-ci.yml --- .github/workflows/ros-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ros-ci.yml b/.github/workflows/ros-ci.yml index 6b635d7a..d04c1798 100644 --- a/.github/workflows/ros-ci.yml +++ b/.github/workflows/ros-ci.yml @@ -63,7 +63,7 @@ jobs: run: | REPO_DIR="/tmp/livox_sdk2_repo" mkdir -p "$REPO_DIR" - git clone --branch v1.2.5 --depth 1 https://github.com/Livox-SDK/Livox-SDK2.git "$REPO_DIR/Livox-SDK2" + git clone --branch v0.0.1 --depth 1 https://github.com/LCAS/Livox-SDK2.git "$REPO_DIR/Livox-SDK2" cd "$REPO_DIR/Livox-SDK2" mkdir -p build && cd build cmake -DCMAKE_CXX_FLAGS="-include cstdint" ..