Fix upstream versions to enable patches to always apply

This commit is contained in:
Matt Spencer
2026-07-31 17:49:20 +00:00
parent 93e9291e19
commit 44e039beac
4 changed files with 91 additions and 95 deletions
+22 -47
View File
@@ -1,49 +1,24 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt diff --git a/package.xml b/package.xml
index 05f84c5..4fb6f31 100644 new file mode 100644
--- a/CMakeLists.txt index 0000000..ffdf3ce
+++ b/CMakeLists.txt --- /dev/null
@@ -1,7 +1,9 @@ +++ b/package.xml
-cmake_minimum_required(VERSION 3.0) @@ -0,0 +1,18 @@
+cmake_minimum_required(VERSION 3.5) +<?xml version="1.0"?>
+<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
project(livox_sdk2) +<package format="3">
+ <name>livox_sdk2</name>
+find_package(ament_cmake REQUIRED) + <version>1.3.1</version>
+ <description>
+ Livox SDK2: official C++ library for Livox LiDAR sensors.
+ Provides the livox_sdk2 ament target consumed by livox_ros_driver2.
+ </description>
+ <maintainer email="sdk@livoxtech.com">Livox</maintainer>
+ <license>Apache-2.0</license>
+ +
set(CMAKE_CXX_STANDARD 11) + <buildtool_depend>ament_cmake</buildtool_depend>
message(STATUS "main project dir: " ${PROJECT_SOURCE_DIR})
@@ -18,3 +20,9 @@ endif(UNIX)
add_subdirectory(sdk_core)
add_subdirectory(samples)
+ +
+# Export the installed headers/libraries so ament packages (e.g. livox_ros_driver2) + <export>
+# find the SDK from the colcon install space via CMAKE_PREFIX_PATH. + <build_type>ament_cmake</build_type>
+ament_export_include_directories(include) + </export>
+ament_export_libraries(livox_lidar_sdk_shared) +</package>
+ament_package()
diff --git a/sdk_core/comm/define.h b/sdk_core/comm/define.h
index 0872328..28d989b 100644
--- a/sdk_core/comm/define.h
+++ b/sdk_core/comm/define.h
@@ -31,6 +31,7 @@
#include <functional>
#include <vector>
#include <atomic>
+#include <cstdint>
#include "livox_lidar_def.h"
diff --git a/sdk_core/logger_handler/file_manager.h b/sdk_core/logger_handler/file_manager.h
index 242a431..14cd76a 100644
--- a/sdk_core/logger_handler/file_manager.h
+++ b/sdk_core/logger_handler/file_manager.h
@@ -28,6 +28,7 @@
#include <string>
#include <vector>
#include <map>
+#include <cstdint>
namespace livox {
namespace lidar {
+25 -40
View File
@@ -1,3 +1,6 @@
diff --git a/unitree_lidar_ros/src/unitree_lidar_ros/COLCON_IGNORE b/unitree_lidar_ros/src/unitree_lidar_ros/COLCON_IGNORE
new file mode 100644
index 0000000..e69de29
diff --git a/unitree_lidar_ros2/src/unitree_lidar_ros2/CMakeLists.txt b/unitree_lidar_ros2/src/unitree_lidar_ros2/CMakeLists.txt diff --git a/unitree_lidar_ros2/src/unitree_lidar_ros2/CMakeLists.txt b/unitree_lidar_ros2/src/unitree_lidar_ros2/CMakeLists.txt
index 041ef0d..dd57d47 100644 index 041ef0d..dd57d47 100644
--- a/unitree_lidar_ros2/src/unitree_lidar_ros2/CMakeLists.txt --- a/unitree_lidar_ros2/src/unitree_lidar_ros2/CMakeLists.txt
@@ -37,15 +40,12 @@ index 041ef0d..dd57d47 100644
install(TARGETS install(TARGETS
diff --git a/unitree_lidar_ros2/src/unitree_lidar_ros2/package.xml b/unitree_lidar_ros2/src/unitree_lidar_ros2/package.xml diff --git a/unitree_lidar_ros2/src/unitree_lidar_ros2/package.xml b/unitree_lidar_ros2/src/unitree_lidar_ros2/package.xml
index 74539aa..69bb645 100644 index 74539aa..8b186d8 100644
--- a/unitree_lidar_ros2/src/unitree_lidar_ros2/package.xml --- a/unitree_lidar_ros2/src/unitree_lidar_ros2/package.xml
+++ b/unitree_lidar_ros2/src/unitree_lidar_ros2/package.xml +++ b/unitree_lidar_ros2/src/unitree_lidar_ros2/package.xml
@@ -15,14 +15,15 @@ @@ -17,10 +17,11 @@
<depend>rclcpp</depend>
<depend>std_msgs</depend>
<depend>sensor_msgs</depend> <depend>sensor_msgs</depend>
-
+
<depend>pcl_conversions</depend> <depend>pcl_conversions</depend>
- <depend>pcl</depend> - <depend>pcl</depend>
+ <depend>libpcl-all-dev</depend> + <depend>libpcl-all-dev</depend>
@@ -56,12 +56,8 @@ index 74539aa..69bb645 100644
<export> <export>
<build_type>ament_cmake</build_type> <build_type>ament_cmake</build_type>
</export>
-</package>
+</package>
\ No newline at end of file
diff --git a/unitree_lidar_sdk/CMakeLists.txt b/unitree_lidar_sdk/CMakeLists.txt diff --git a/unitree_lidar_sdk/CMakeLists.txt b/unitree_lidar_sdk/CMakeLists.txt
index 80af9c9..0d9a334 100644 index 80af9c9..00725ea 100644
--- a/unitree_lidar_sdk/CMakeLists.txt --- a/unitree_lidar_sdk/CMakeLists.txt
+++ b/unitree_lidar_sdk/CMakeLists.txt +++ b/unitree_lidar_sdk/CMakeLists.txt
@@ -1,39 +1,14 @@ @@ -1,39 +1,14 @@
@@ -114,35 +110,24 @@ index 80af9c9..0d9a334 100644
-target_link_libraries(set_to_udp_mode libunilidar_sdk2.a ) -target_link_libraries(set_to_udp_mode libunilidar_sdk2.a )
\ No newline at end of file \ No newline at end of file
+ament_package() +ament_package()
\ No newline at end of file
diff --git a/unitree_lidar_sdk/package.xml b/unitree_lidar_sdk/package.xml diff --git a/unitree_lidar_sdk/package.xml b/unitree_lidar_sdk/package.xml
index ef88d9a..68ab313 100644 new file mode 100644
--- a/unitree_lidar_sdk/package.xml index 0000000..ef88d9a
--- /dev/null
+++ b/unitree_lidar_sdk/package.xml +++ b/unitree_lidar_sdk/package.xml
@@ -1,15 +1,15 @@ @@ -0,0 +1,15 @@
<?xml version="1.0"?> +<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> +<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3"> +<package format="3">
- <name>unitree_lidar_sdk</name> + <name>unitree_lidar_sdk</name>
- <version>0.0.0</version> + <version>0.0.0</version>
- <description>Unitree LiDAR SDK (prebuilt static library and headers)</description> + <description>Unitree LiDAR SDK (prebuilt static library and headers)</description>
- <maintainer email="lukelbmeng@gmail.com">jo</maintainer> + <maintainer email="lukelbmeng@gmail.com">jo</maintainer>
- <license>BSD-3-Clause</license> + <license>BSD-3-Clause</license>
+ <name>unitree_lidar_sdk</name> +
+ <version>0.0.0</version> + <buildtool_depend>ament_cmake</buildtool_depend>
+ <description>Unitree LiDAR SDK (prebuilt static library and headers)</description> +
+ <maintainer email="lukelbmeng@gmail.com">jo</maintainer> + <export>
+ <license>BSD-3-Clause</license> + <build_type>ament_cmake</build_type>
+ </export>
- <buildtool_depend>ament_cmake</buildtool_depend>
+ <buildtool_depend>ament_cmake</buildtool_depend>
- <export>
- <build_type>ament_cmake</build_type>
- </export>
-</package>
+ <export>
+ <build_type>ament_cmake</build_type>
+ </export>
+</package> +</package>
\ No newline at end of file
+36
View File
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
#
# setup_upstream.sh — fetch the upstream sources agv_pro_ros2 depends on
# and apply any required patches.
#
# Sources are declared in upstream.jazzy.repos and cloned under src/upstream/.
# Patches in patches/ are applied idempotently (already-applied patches are
# silently skipped).
#
# Usage:
# ./setup_upstream.sh
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$REPO_ROOT"
echo "[setup_upstream] importing sources into src/upstream ..."
mkdir -p src/upstream
# Reset working-tree changes in already-cloned repos so that vcs import can
# pull upstream updates without hitting dirty-working-tree conflicts.
# Use -x so that gitignored files (e.g. generated package.xml) are also removed.
# Patches are re-applied unconditionally after the import step below.
for repo_dir in src/upstream/*/; do
if [[ -d "${repo_dir}/.git" ]]; then
git -C "${repo_dir}" checkout -- . 2>/dev/null || true
git -C "${repo_dir}" clean -fdx 2>/dev/null || true
fi
done
vcs import src/upstream < upstream.jazzy.repos
echo "[setup_upstream] applying patches ..."
bash patches/apply_patches.sh
echo "[setup_upstream] done."
+8 -8
View File
@@ -2,33 +2,33 @@ repositories:
FAST_LIO: FAST_LIO:
type: git type: git
url: https://github.com/hku-mars/FAST_LIO.git url: https://github.com/hku-mars/FAST_LIO.git
version: ROS2 version: a4743b095409588842a5b30ddfa27e29d2f99164
livox_ros_driver2: livox_ros_driver2:
type: git type: git
url: https://github.com/Livox-SDK/livox_ros_driver2.git url: https://github.com/Livox-SDK/livox_ros_driver2.git
version: master version: 13eb05e4e6dd7a765b934d0c5fd6236676a57b49
livox_sdk: livox_sdk:
type: git type: git
url: https://github.com/Livox-SDK/Livox-SDK2.git url: https://github.com/Livox-SDK/Livox-SDK2.git
version: master version: 68ae1e1dc77f61f03c95d7c2809831e198d0aedd
Lslidar_ROS2_driver: Lslidar_ROS2_driver:
type: git type: git
url: https://github.com/Lslidar/Lslidar_ROS2_driver.git url: https://github.com/Lslidar/Lslidar_ROS2_driver.git
version: LS-S1_V1.0 version: e23139673c34c51d07053837910020aaa81736fa
pcd2pgm: pcd2pgm:
type: git type: git
url: https://github.com/LihanChen2004/pcd2pgm.git url: https://github.com/LihanChen2004/pcd2pgm.git
version: main version: 885561552baae33685e59eef41a5d8c996538702
point_lio_ros2: point_lio_ros2:
type: git type: git
url: https://github.com/dfloreaa/point_lio_ros2.git url: https://github.com/dfloreaa/point_lio_ros2.git
version: main version: a8e2d0d5090af97ead8dd4fac3d37cf3dbb33ff7
slam_gmapping: slam_gmapping:
type: git type: git
url: https://github.com/Project-MANAS/slam_gmapping.git url: https://github.com/Project-MANAS/slam_gmapping.git
version: eloquent-devel version: 3c3de50c071d2c64ffe516e1ed84a574fc447b97
unilidar_sdk2: unilidar_sdk2:
type: git type: git
url: https://github.com/unitreerobotics/unilidar_sdk2.git url: https://github.com/unitreerobotics/unilidar_sdk2.git
version: main version: 0e3c51f512e6b8ff60b8c32f160b412cb48445c2