Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/ros-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -37,10 +37,10 @@ jobs:
ros_distribution: humble
ros_version: 2

# Iron Irwini (May 2023 - November 2024)
# - docker_image: ubuntu:jammy
# ros_distribution: iron
# ros_version: 2
# Jazzy Jalisco (May 2024 - May 2029)
- docker_image: ubuntu:noble
ros_distribution: jazzy
ros_version: 2

# # Rolling Ridley (No End-Of-Life)
# - docker_image: ubuntu:jammy
Expand All @@ -63,10 +63,10 @@ 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 ..
cmake -DCMAKE_CXX_FLAGS="-include cstdint" ..
make -j$(nproc)
make install
ldconfig
Expand Down
26 changes: 17 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
)
Expand Down Expand Up @@ -367,4 +375,4 @@ else(ROS_EDITION STREQUAL "ROS2")
launch
)

endif()
endif()
Loading