Files
agv_pro_ros2/patches/unilidar_sdk2.patch
T
Matt Spencer 46f7cbb8b5 Migrate to ROS2 Lyrical for all non-lidar packages
- Switch base image / repos file / rosdep distro from jazzy to lyrical
  (ros:lyrical is built on Ubuntu resolute/26.04).
- Vendor transport_drivers (serial_driver/io_context/udp_driver) since
  lyrical apt packages for them are not yet published; patch removes
  the now-gone ament_target_dependencies() macro.
- Fix ament_target_dependencies() removal across agv_pro_base,
  agv_pro_hardware, agv_pro_rviz_plugins, and slam_gmapping by switching
  to target_link_libraries() with namespaced imported targets (or raw
  *_LIBRARIES/*_INCLUDE_DIRS variables for packages with no modern
  target: serial_driver, ASIO).
- Migrate agv_pro_rviz_plugins from Qt5 to Qt6.
- Fix Boost 1.90 dropping libboost-system-dev: use header-only
  Boost::boost instead of a system component.
- Rename boost::asio::io_service -> io_context and
  mutable_buffers_1 -> mutable_buffer (Asio API removal) in
  agv_pro_hardware and agv_pro_base.
- Update tf2/message_filters includes from removed .h shims to .hpp,
  and fix message_filters::Subscriber's QoS constructor signature.
- Regenerate rosdep-packages.txt for lyrical; skip cartographer_ros/
  orbbec_camera in rosdep install (exec_depend-only, not yet published
  as ros-lyrical-* apt packages -- tracked in TODO.md).
- Lidar packages (fast_lio, livox_*, lslidar_*, point_lio,
  unitree_lidar_*) are deferred; their patches are present but not
  verified yet under lyrical.

Verified: full docker build succeeds with colcon build reporting all
23 non-lidar/transport packages finished, 0 failed.
2026-10-19 17:48:21 +01:00

137 lines
4.5 KiB
Diff

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
index 041ef0d..dd57d47 100644
--- a/unitree_lidar_ros2/src/unitree_lidar_ros2/CMakeLists.txt
+++ b/unitree_lidar_ros2/src/unitree_lidar_ros2/CMakeLists.txt
@@ -23,16 +23,15 @@ find_package(pcl_conversions REQUIRED)
find_package(PCL REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(sensor_msgs REQUIRED)
+find_package(unitree_lidar_sdk REQUIRED)
include_directories(
${PCL_INCLUDE_DIRS}
include
- ../../../unitree_lidar_sdk/include
)
link_directories(
${PCL_LIBRARY_DIRS}
- ../../../unitree_lidar_sdk/lib/${CMAKE_SYSTEM_PROCESSOR}
)
add_definitions(${PCL_DEFINITIONS})
@@ -42,7 +41,6 @@ add_executable(unitree_lidar_ros2_node src/unitree_lidar_ros2_node.cpp)
target_link_libraries( unitree_lidar_ros2_node
${Boost_SYSTEM_LIBRARY}
${PCL_LIBRARIES}
- libunilidar_sdk2.a
)
ament_target_dependencies(
@@ -52,6 +50,7 @@ ament_target_dependencies(
geometry_msgs
tf2_ros
pcl_conversions
+ unitree_lidar_sdk
)
install(TARGETS
diff --git a/unitree_lidar_ros2/src/unitree_lidar_ros2/package.xml b/unitree_lidar_ros2/src/unitree_lidar_ros2/package.xml
index 74539aa..8b186d8 100644
--- a/unitree_lidar_ros2/src/unitree_lidar_ros2/package.xml
+++ b/unitree_lidar_ros2/src/unitree_lidar_ros2/package.xml
@@ -17,10 +17,11 @@
<depend>sensor_msgs</depend>
<depend>pcl_conversions</depend>
- <depend>pcl</depend>
+ <depend>libpcl-all-dev</depend>
<depend>geometry_msgs</depend>
<depend>tf2_ros</depend>
+ <depend>unitree_lidar_sdk</depend>
<export>
<build_type>ament_cmake</build_type>
diff --git a/unitree_lidar_sdk/CMakeLists.txt b/unitree_lidar_sdk/CMakeLists.txt
index 80af9c9..00725ea 100644
--- a/unitree_lidar_sdk/CMakeLists.txt
+++ b/unitree_lidar_sdk/CMakeLists.txt
@@ -1,39 +1,14 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.5)
project(unitree_lidar_sdk)
-set(CMAKE_BUILD_TYPE "Release")
-set(CMAKE_CXX_FLAGS "-std=c++17")
-set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb")
-set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall -DNDEBUG")
+find_package(ament_cmake REQUIRED)
-include_directories(include)
+# Install the SDK headers and the architecture-specific prebuilt static library.
+install(DIRECTORY include/ DESTINATION include/${PROJECT_NAME})
+install(FILES lib/${CMAKE_SYSTEM_PROCESSOR}/libunilidar_sdk2.a DESTINATION lib)
-link_directories(lib/${CMAKE_SYSTEM_PROCESSOR})
+# Export them so ament packages can consume the SDK via find_package().
+ament_export_include_directories(include/${PROJECT_NAME})
+ament_export_libraries(unilidar_sdk2)
-SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib/${CMAKE_SYSTEM_PROCESSOR})
-
-add_executable(example_lidar_udp
- examples/example_lidar_udp.cpp
-)
-target_link_libraries(example_lidar_udp libunilidar_sdk2.a )
-
-add_executable(example_lidar_serial
- examples/example_lidar_serial.cpp
-)
-target_link_libraries(example_lidar_serial libunilidar_sdk2.a )
-
-add_executable(set_ip_address
- examples/set_ip_address.cpp
-)
-target_link_libraries(set_ip_address libunilidar_sdk2.a )
-
-add_executable(set_to_serial_mode
- examples/set_to_serial_mode.cpp
-)
-target_link_libraries(set_to_serial_mode libunilidar_sdk2.a )
-
-add_executable(set_to_udp_mode
- examples/set_to_udp_mode.cpp
-)
-target_link_libraries(set_to_udp_mode libunilidar_sdk2.a )
\ No newline at end of file
+ament_package()
diff --git a/unitree_lidar_sdk/package.xml b/unitree_lidar_sdk/package.xml
new file mode 100644
index 0000000..ef88d9a
--- /dev/null
+++ b/unitree_lidar_sdk/package.xml
@@ -0,0 +1,15 @@
+<?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>unitree_lidar_sdk</name>
+ <version>0.0.0</version>
+ <description>Unitree LiDAR SDK (prebuilt static library and headers)</description>
+ <maintainer email="lukelbmeng@gmail.com">jo</maintainer>
+ <license>BSD-3-Clause</license>
+
+ <buildtool_depend>ament_cmake</buildtool_depend>
+
+ <export>
+ <build_type>ament_cmake</build_type>
+ </export>
+</package>
diff --git a/COLCON_IGNORE b/COLCON_IGNORE
new file mode 100644
index 0000000..e69de29