Skip to content

feat: add livox ros driver2 #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 14, 2025
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
11 changes: 11 additions & 0 deletions .github/workflows/testpr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,21 @@ jobs:
include:
- os: ubuntu-latest
platform: linux-64
additional_recipes:
- "ros-jazzy-livox-ros-driver2"
- os: ubuntu-24.04-arm
platform: linux-aarch64
additional_recipes:
- "ros-jazzy-livox-ros-driver2"
- os: macos-13
platform: osx-64
additional_recipes: []
- os: macos-14
platform: osx-arm64
additional_recipes: []
- os: windows-2019
platform: win-64
additional_recipes: []

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -105,6 +112,10 @@ jobs:
mkdir -p recipes
$HOME/.pixi/bin/pixi run -e beta -v vinca --platform win-64 -m -n
ls -la recipes
- name: Copy additional recipes which have been changed into recipes
shell: bash -l {0}
run: |
echo '${{ toJson(matrix.additional_recipes) }}' | jq -r ".[]" | xargs -I@ cp -r additional_recipes/@ recipes/
- name: Check if there are packages to be built
id: newrecipecheck
shell: bash -l {0}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
From 318d447b347d87ce2087c40dd6ad169643fc32d9 Mon Sep 17 00:00:00 2001
From: wep21 <[email protected]>
Date: Tue, 22 Apr 2025 21:53:53 +0900
Subject: [PATCH] add package.xml

Signed-off-by: wep21 <[email protected]>
---
package.xml | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
create mode 100644 package.xml

diff --git a/package.xml b/package.xml
new file mode 100644
index 0000000..96f5762
--- /dev/null
+++ b/package.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
+<package format="3">
+ <name>livox_ros_driver2</name>
+ <version>1.0.0</version>
+ <description>The ROS device driver for Livox 3D LiDARs, for ROS2</description>
+ <maintainer email="[email protected]">feng</maintainer>
+ <license>MIT</license>
+
+ <buildtool_depend>ament_cmake_auto</buildtool_depend>
+ <build_depend>rosidl_default_generators</build_depend>
+ <member_of_group>rosidl_interface_packages</member_of_group>
+
+ <depend>rclcpp</depend>
+ <depend>rclcpp_components</depend>
+ <depend>std_msgs</depend>
+ <depend>sensor_msgs</depend>
+ <depend>rcutils</depend>
+ <depend>pcl_conversions</depend>
+ <depend>rcl_interfaces</depend>
+ <depend>libpcl-all-dev</depend>
+
+ <exec_depend>rosbag2</exec_depend>
+ <exec_depend>rosidl_default_runtime</exec_depend>
+
+ <test_depend>ament_lint_auto</test_depend>
+ <test_depend>ament_lint_common</test_depend>
+
+ <depend>git</depend>
+ <depend>apr</depend>
+
+ <export>
+ <build_type>ament_cmake</build_type>
+ </export>
+</package>
--
2.39.5 (Apple Git-154)

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
From f7f4c8b08fc51cb087722894f48165e3c5b57eb4 Mon Sep 17 00:00:00 2001
From: wep21 <[email protected]>
Date: Wed, 23 Apr 2025 00:33:32 +0900
Subject: [PATCH] fix livox interfaces target

---
CMakeLists.txt | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 99a8ccc..ae9c928 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -282,15 +282,9 @@ 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
+ rosidl_get_typesupport_target(cpp_typesupport_target
${LIVOX_INTERFACES} "rosidl_typesupport_cpp")
- target_link_libraries(${PROJECT_NAME} "${cpp_typesupport_target}")
- 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()
+ target_link_libraries(${PROJECT_NAME} "${cpp_typesupport_target}")

# include file direcotry
target_include_directories(${PROJECT_NAME} PUBLIC
@@ -333,4 +327,4 @@ else(ROS_EDITION STREQUAL "ROS2")
launch_ROS2
)

-endif()
\ No newline at end of file
+endif()
--
2.43.0

120 changes: 120 additions & 0 deletions additional_recipes/ros-jazzy-livox-ros-driver2/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
package:
name: ros-jazzy-livox-ros-driver2
version: 1.2.4

source:
git: https://github.com/Livox-SDK/livox_ros_driver2.git
tag: 1.2.4
target_directory: ros-jazzy-livox-ros-driver2/src/work
patches:
- add_package_xml.patch
- fix_livox_interfaces.patch

build:
script: ${{ '$RECIPE_DIR/build_ament_cmake.sh' if unix else '%RECIPE_DIR%\\bld_ament_cmake.bat' }}
number: 6
post_process:
- files:
- '*.pc'
regex: (?:-L|-I)?"?([^;\s]+/sysroot/)
replacement: $$(CONDA_BUILD_SYSROOT_S)
- files:
- '*.cmake'
regex: ([^;\s"]+/sysroot)
replacement: $$ENV{CONDA_BUILD_SYSROOT}
- files:
- '*.cmake'
regex: ([^;\s"]+/MacOSX\d*\.?\d*\.sdk)
replacement: $$ENV{CONDA_BUILD_SYSROOT}

about:
homepage: https://github.com/Livox-SDK/livox_ros_driver2
license: MIT
summary: |
Livox device driver under Ros(Compatible with ros and ros2), support Lidar HAP and Mid-360.

extra:
recipe-maintainers:
- ros-forge

requirements:
build:
- ${{ compiler('cxx') }}
- ${{ compiler('c') }}
- ${{ stdlib('c') }}
- ninja
- python
- setuptools
- git
- if: unix
then:
- patch
- make
- coreutils
- if: win
then:
- m2-patch
- if: osx
then:
- tapi
- if: build_platform != target_platform
then:
- pkg-config
- cmake
- cython
- if: build_platform != target_platform
then:
- python
- cross-python_${{ target_platform }}
- numpy
host:
- if: build_platform == target_platform
then:
- pkg-config
- eigen
- libboost-devel
- livox-sdk2
- numpy
- pcl
- pip
- python
- ros-jazzy-ament-cmake
- ros-jazzy-ament-cmake-auto
- ros-jazzy-ament-lint-auto
- ros-jazzy-ament-lint-common
- ros-jazzy-pcl-conversions
- ros-jazzy-rclcpp
- ros-jazzy-rclcpp-components
- ros-jazzy-ros-environment
- ros-jazzy-ros-workspace
- ros-jazzy-rosidl-default-generators
- ros-jazzy-sensor-msgs
- ros2-distro-mutex 0.8.* jazzy_*
- vtk-base
- if: linux
then:
- libgl-devel
- libopengl-devel
- if: unix
then:
- xorg-libx11
- xorg-libxext
run:
- eigen
- libboost-devel
- pcl
- python
- ros-jazzy-pcl-conversions
- ros-jazzy-rclcpp
- ros-jazzy-rclcpp-components
- ros-jazzy-ros-workspace
- ros-jazzy-sensor-msgs
- ros2-distro-mutex 0.8.* jazzy_*
- vtk-base
- if: osx and x86_64
then:
- __osx >=${{ MACOSX_DEPLOYMENT_TARGET|default('10.14') }}
- if: unix
then:
- xorg-libx11
- xorg-libxext
2 changes: 1 addition & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ vinca = { git ="https://github.com/RoboStack/vinca.git", rev = "cbb8eba834ce3834
[feature.beta.tasks]
generate-recipes = { cmd = "vinca -m", depends-on = ["rename-file"] }
remove-file = { cmd = "rm vinca.yaml; rm -rf recipes" }
build_additional_recipes = { cmd = "rattler-build build --recipe-dir ./additional_recipes -m ./conda_build_config.yaml --skip-existing" }
build_additional_recipes = { cmd = "rattler-build build --recipe-dir ./additional_recipes -m ./conda_build_config.yaml --skip-existing -c robostack-jazzy -c https://repo.prefix.dev/conda-forge" }
build = { cmd = "rattler-build build --recipe-dir ./recipes -m ./conda_build_config.yaml -c robostack-jazzy -c https://repo.prefix.dev/conda-forge --skip-existing", depends-on = ["build_additional_recipes", "generate-recipes"] }
build_one_package = { cmd = "cp ./patch/$PACKAGE.*patch ./recipes/$PACKAGE/patch/; rattler-build build --recipe ./recipes/$PACKAGE/recipe.yaml -m ./conda_build_config.yaml -c robostack-jazzy -c https://repo.prefix.dev/conda-forge", env = { PACKAGE = "ros-jazzy-ros-workspace" } }
create_snapshot = { cmd = "vinca-snapshot -d jazzy -o rosdistro_snapshot.yaml" }
Expand Down
Loading