Initial fix of the lidar upgrade to Lyrical. Not yet tested.

This commit is contained in:
Matt Spencer committed 2026-10-19 18:34:11 +01:00
1 parent 46f7cbb8b5
commit c9144028f8
8 files changed
+480 -81

No files matched your search

+33 -9
View File
@@ -8,21 +8,45 @@ packages are temporarily excluded from the colcon build via a `COLCON_IGNORE` ma
(captured in their respective `patches/*.patch` so it survives a fresh `vcs import`),
pending a dedicated pass to get them building under Lyrical:
- `FAST_LIO` (`patches/fast_lio.patch`)
- `livox_ros_driver2` (`patches/livox_ros_driver2.patch`)
- `livox_sdk` (`patches/livox_sdk.patch`)
- `Lslidar_ROS2_driver` (`patches/lslidar_ros2_driver.patch`, new)
- `point_lio_ros2` (`patches/point_lio_ros2.patch`, new)
- `unilidar_sdk2` (`patches/unilidar_sdk2.patch`)
- ~~`FAST_LIO` (`patches/fast_lio.patch`)~~ re-enabled, builds clean under lyrical
(`ament_target_dependencies()` guarded with `if(COMMAND ...)` + modern namespaced
targets; `tf2_ros/transform_broadcaster.h` → `.hpp`; added missing `tf2_ros` depend;
dropped unused `pcl_ros`/`rclcpp_components` link targets which don't export a
simple umbrella target under lyrical).
- ~~`livox_ros_driver2` (`patches/livox_ros_driver2.patch`)~~ re-enabled, builds clean
under lyrical (extended its existing `DISTRO_ROS STREQUAL "humble" OR "jazzy"`
modern-rosidl-typesupport guard to also match `"lyrical"`).
- ~~`livox_sdk` (`patches/livox_sdk.patch`)~~ re-enabled, builds clean under lyrical
(needed `cmake_minimum_required` bumped from 3.0 to 3.5 in several sub-CMakeLists —
CMake 4.2 fully removed compatibility with versions below 3.5).
- ~~`Lslidar_ROS2_driver` (`patches/lslidar_ros2_driver.patch`, new)~~ re-enabled,
builds clean under lyrical (`ament_target_dependencies` guarded with
`if(COMMAND...)` + modern namespaced targets in both the `lslidar_driver`
library and `lslidar_driver_node` executable; also needed `libpcap0.8-dev`
installed -- the package.xml's `libpcap` rosdep key resolves to it, but it
wasn't in `rosdep-packages.txt` yet since this package was previously
COLCON_IGNORE'd when that file was last frozen).
- ~~`point_lio_ros2` (`patches/point_lio_ros2.patch`, new)~~ re-enabled, builds clean
under lyrical (same `ament_target_dependencies`/modern-target-link pattern as
`FAST_LIO`; `tf2_ros/transform_broadcaster.h` \u2192 `.hpp` in 3 files; plus a new
fix not needed by `FAST_LIO`: added an explicit `find_package(PCL REQUIRED
COMPONENTS common io filters)` + `target_link_libraries(${PCL_LIBRARIES})`,
since this package never had its own PCL linkage and relied on legacy
`ament_target_dependencies` transitively pulling it in via `pcl_conversions`).
- ~~`unilidar_sdk2` (`patches/unilidar_sdk2.patch`)~~ re-enabled, builds clean under
lyrical (`unitree_lidar_ros2`'s `ament_target_dependencies` guarded with
`if(COMMAND...)` + modern namespaced targets; `unitree_lidar_sdk` only exports
legacy `ament_export_libraries()`/`ament_export_include_directories()` variables
(no namespaced target), so it's linked via explicit `${unitree_lidar_sdk_LIBRARIES}`/
`${unitree_lidar_sdk_INCLUDE_DIRS}`; `tf2_ros/transform_broadcaster.h` → `.hpp` and
`tf2/LinearMath/Quaternion.h` → `.hpp` in `unitree_lidar_ros2.h`). All 6 lidar
packages are now re-enabled and the full workspace builds clean (31/31 packages).
`agv_pro_bringup`'s `exec_depend` on `livox_ros_driver2`/`lslidar_driver` is left as-is —
rosdep's `--ignore-src` treats those as satisfied by the (ignored) local source packages,
so this doesn't block `rosdep install`. The `wheel_interface`/lidar-dependent launch
options simply won't have a built executable until the lidar packages are revisited.
- [ ] Re-enable the lidar packages above (remove their `COLCON_IGNORE`) and fix whatever
breaks building them under `ros:lyrical`.
`agv_pro_base` hard-depends on `serial_driver`/`io_context` (from the
`ros-drivers/transport_drivers` repo) at build time, but `ros-lyrical-serial-driver`/
`ros-lyrical-io-context` aren't published as apt packages yet (confirmed via
+66 -4
View File
@@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index be3040b..3176847 100644
index be3040b..263c61c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,17 +5,39 @@ if(NOT CMAKE_BUILD_TYPE)
@@ -47,6 +47,68 @@ index be3040b..3176847 100644
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
message("Current CPU archtecture: ${CMAKE_SYSTEM_PROCESSOR}")
diff --git a/COLCON_IGNORE b/COLCON_IGNORE
new file mode 100644
index 0000000..e69de29
@@ -59,6 +81,7 @@ find_package(std_srvs REQUIRED)
find_package(visualization_msgs REQUIRED)
find_package(pcl_ros REQUIRED)
find_package(pcl_conversions REQUIRED)
+find_package(tf2_ros REQUIRED)
find_package(livox_ros_driver2 REQUIRED)
find_package(rosidl_default_generators REQUIRED)
@@ -73,6 +96,7 @@ set(dependencies
visualization_msgs
pcl_ros
pcl_conversions
+ tf2_ros
livox_ros_driver2
)
@@ -113,7 +137,22 @@ else()
target_link_libraries(fastlio_mapping ${cpp_typesupport_target})
endif()
-ament_target_dependencies(fastlio_mapping ${dependencies})
+if(COMMAND ament_target_dependencies)
+ ament_target_dependencies(fastlio_mapping ${dependencies})
+else()
+ target_link_libraries(fastlio_mapping
+ rclcpp::rclcpp
+ geometry_msgs::geometry_msgs
+ nav_msgs::nav_msgs
+ sensor_msgs::sensor_msgs
+ std_msgs::std_msgs
+ std_srvs::std_srvs
+ visualization_msgs::visualization_msgs
+ pcl_conversions::pcl_conversions
+ tf2_ros::tf2_ros
+ livox_ros_driver2::livox_ros_driver2
+ )
+endif()
# ---------------- Install --------------- #
install(TARGETS fastlio_mapping
diff --git a/package.xml b/package.xml
index 8c39e18..b64f06c 100644
--- a/package.xml
+++ b/package.xml
@@ -25,6 +25,7 @@
<depend>sensor_msgs</depend>
<depend>common_interfaces</depend>
<depend>tf2</depend>
+ <depend>tf2_ros</depend>
<depend>pcl_ros</depend>
<depend>pcl_conversions</depend>
<depend>livox_ros_driver2</depend>
diff --git a/src/laserMapping.cpp b/src/laserMapping.cpp
index e5d9950..9c437a1 100644
--- a/src/laserMapping.cpp
+++ b/src/laserMapping.cpp
@@ -56,7 +56,7 @@
#include <sensor_msgs/msg/point_cloud2.hpp>
#include <sensor_msgs/msg/imu.hpp>
#include <std_srvs/srv/trigger.hpp>
-#include <tf2_ros/transform_broadcaster.h>
+#include <tf2_ros/transform_broadcaster.hpp>
#include <geometry_msgs/msg/transform_stamped.hpp>
#include <geometry_msgs/msg/vector3.hpp>
#include <livox_ros_driver2/msg/custom_msg.hpp>
+11 -5
View File
@@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7344d08..3d531a9 100644
index 7344d08..28e3de8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,3 +1,9 @@
@@ -25,6 +25,15 @@ index 7344d08..3d531a9 100644
# Default to C99
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
@@ -282,7 +294,7 @@ else(ROS_EDITION STREQUAL "ROS2")
target_include_directories(${PROJECT_NAME} PRIVATE ${livox_sdk_INCLUDE_DIRS})
# get include directories of custom msg headers
- if(DISTRO_ROS STREQUAL "humble" OR DISTRO_ROS STREQUAL "jazzy")
+ if(DISTRO_ROS STREQUAL "humble" OR DISTRO_ROS STREQUAL "jazzy" OR DISTRO_ROS STREQUAL "lyrical")
rosidl_get_typesupport_target(cpp_typesupport_target
${LIVOX_INTERFACES} "rosidl_typesupport_cpp")
target_link_libraries(${PROJECT_NAME} "${cpp_typesupport_target}")
diff --git a/launch b/launch
new file mode 120000
index 0000000..163fb01
@@ -35,7 +44,7 @@ index 0000000..163fb01
\ No newline at end of file
diff --git a/package.xml b/package.xml
new file mode 100644
index 0000000..0000000
index 0000000..c66785b
--- /dev/null
+++ b/package.xml
@@ -0,0 +1,36 @@
@@ -87,6 +96,3 @@ index 96f5762..c66785b 100644
<export>
<build_type>ament_cmake</build_type>
diff --git a/COLCON_IGNORE b/COLCON_IGNORE
new file mode 100644
index 0000000..e69de29
+115 -42
View File
@@ -1,43 +1,3 @@
diff --git a/package.xml b/package.xml
new file mode 100644
index 0000000..ffdf3ce
--- /dev/null
+++ b/package.xml
@@ -0,0 +1,18 @@
+<?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_sdk2</name>
+ <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>
+
+ <buildtool_depend>ament_cmake</buildtool_depend>
+
+ <export>
+ <build_type>ament_cmake</build_type>
+ </export>
+</package>
diff --git a/sdk_core/CMakeLists.txt b/sdk_core/CMakeLists.txt
index 15e960d..aa9e08a 100644
--- a/sdk_core/CMakeLists.txt
+++ b/sdk_core/CMakeLists.txt
@@ -142,3 +142,11 @@ install(TARGETS ${SDK_LIBRARY_STATIC} ${SDK_LIBRARY_SHARED}
PUBLIC_HEADER DESTINATION include
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
+
+# livox_ros_driver2's (unpatched, vendor) CMakeLists.txt looks for the shared library and
+# headers with a raw find_library()/find_path() call pinned to /usr/local, not via colcon's
+# per-package install prefix -- so also install there directly.
+install(TARGETS ${SDK_LIBRARY_STATIC} ${SDK_LIBRARY_SHARED}
+ PUBLIC_HEADER DESTINATION /usr/local/include
+ ARCHIVE DESTINATION /usr/local/lib
+ LIBRARY DESTINATION /usr/local/lib)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 05f84c5..4fb6f31 100644
--- a/CMakeLists.txt
@@ -63,6 +23,119 @@ index 05f84c5..4fb6f31 100644
+ament_export_include_directories(include)
+ament_export_libraries(livox_lidar_sdk_shared)
+ament_package()
diff --git a/COLCON_IGNORE b/COLCON_IGNORE
diff --git a/package.xml b/package.xml
new file mode 100644
index 0000000..e69de29
index 0000000..ffdf3ce
--- /dev/null
+++ b/package.xml
@@ -0,0 +1,18 @@
+<?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_sdk2</name>
+ <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>
+
+ <buildtool_depend>ament_cmake</buildtool_depend>
+
+ <export>
+ <build_type>ament_cmake</build_type>
+ </export>
+</package>
diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt
index 77c05c7..14e2572 100644
--- a/samples/CMakeLists.txt
+++ b/samples/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.5)
project(livox_sdk2)
diff --git a/samples/debug_point_cloud/CMakeLists.txt b/samples/debug_point_cloud/CMakeLists.txt
index c94f254..a4ccce7 100644
--- a/samples/debug_point_cloud/CMakeLists.txt
+++ b/samples/debug_point_cloud/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.5)
set(DEMO_NAME debug_point_cloud)
add_executable(${DEMO_NAME} main.cpp)
diff --git a/samples/lidar_cmd_observer/CMakeLists.txt b/samples/lidar_cmd_observer/CMakeLists.txt
index 503ff6f..347d17e 100644
--- a/samples/lidar_cmd_observer/CMakeLists.txt
+++ b/samples/lidar_cmd_observer/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.5)
set(DEMO_NAME lidar_cmd_observer)
add_executable(${DEMO_NAME} main.cpp)
diff --git a/samples/livox_lidar_quick_start/CMakeLists.txt b/samples/livox_lidar_quick_start/CMakeLists.txt
index 3f17580..ebc39f9 100644
--- a/samples/livox_lidar_quick_start/CMakeLists.txt
+++ b/samples/livox_lidar_quick_start/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.5)
set(DEMO_NAME livox_lidar_quick_start)
add_executable(${DEMO_NAME} main.cpp)
diff --git a/samples/livox_lidar_rmc_time_sync/CMakeLists.txt b/samples/livox_lidar_rmc_time_sync/CMakeLists.txt
index c976087..fcdcaf8 100644
--- a/samples/livox_lidar_rmc_time_sync/CMakeLists.txt
+++ b/samples/livox_lidar_rmc_time_sync/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.5)
set(DEMO_NAME livox_lidar_rmc_time_sync)
if (WIN32)
diff --git a/samples/logger/CMakeLists.txt b/samples/logger/CMakeLists.txt
index 72b625b..252bf4b 100644
--- a/samples/logger/CMakeLists.txt
+++ b/samples/logger/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.5)
set(DEMO_NAME logger)
add_executable(${DEMO_NAME} main.cpp)
diff --git a/samples/multi_lidars_upgrade/CMakeLists.txt b/samples/multi_lidars_upgrade/CMakeLists.txt
index 74f08d6..4b8dfa9 100644
--- a/samples/multi_lidars_upgrade/CMakeLists.txt
+++ b/samples/multi_lidars_upgrade/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.5)
set(DEMO_NAME multi_lidars_upgrade)
add_executable(${DEMO_NAME} main.cpp)
diff --git a/sdk_core/CMakeLists.txt b/sdk_core/CMakeLists.txt
index 15e960d..98173f8 100644
--- a/sdk_core/CMakeLists.txt
+++ b/sdk_core/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.5)
set(SDK_LIBRARY_STATIC livox_lidar_sdk_static)
set(SDK_LIBRARY_SHARED livox_lidar_sdk_shared)
@@ -142,3 +142,11 @@ install(TARGETS ${SDK_LIBRARY_STATIC} ${SDK_LIBRARY_SHARED}
PUBLIC_HEADER DESTINATION include
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
+
+# livox_ros_driver2's (unpatched, vendor) CMakeLists.txt looks for the shared library and
+# headers with a raw find_library()/find_path() call pinned to /usr/local, not via colcon's
+# per-package install prefix -- so also install there directly.
+install(TARGETS ${SDK_LIBRARY_STATIC} ${SDK_LIBRARY_SHARED}
+ PUBLIC_HEADER DESTINATION /usr/local/include
+ ARCHIVE DESTINATION /usr/local/lib
+ LIBRARY DESTINATION /usr/local/lib)
+75 -3
View File
@@ -1,3 +1,75 @@
diff --git a/COLCON_IGNORE b/COLCON_IGNORE
new file mode 100644
index 0000000..e69de29
diff --git a/lslidar_driver/CMakeLists.txt b/lslidar_driver/CMakeLists.txt
index 20836be..e8f3fdd 100644
--- a/lslidar_driver/CMakeLists.txt
+++ b/lslidar_driver/CMakeLists.txt
@@ -64,15 +64,27 @@ target_link_libraries(lslidar_driver
${YAML_CPP_LIBRARIES}
)
-ament_target_dependencies(lslidar_driver
- rclcpp
- sensor_msgs
- std_msgs
- lslidar_msgs
- ament_index_cpp
- pcl_conversions
- Eigen3
-)
+if(COMMAND ament_target_dependencies)
+ ament_target_dependencies(lslidar_driver
+ rclcpp
+ sensor_msgs
+ std_msgs
+ lslidar_msgs
+ ament_index_cpp
+ pcl_conversions
+ Eigen3
+ )
+else()
+ target_link_libraries(lslidar_driver
+ rclcpp::rclcpp
+ sensor_msgs::sensor_msgs
+ std_msgs::std_msgs
+ lslidar_msgs::lslidar_msgs
+ ament_index_cpp::ament_index_cpp
+ pcl_conversions::pcl_conversions
+ Eigen3::Eigen
+ )
+endif()
add_executable(lslidar_driver_node src/lslidar_driver_node.cpp)
target_link_libraries(lslidar_driver_node
@@ -80,14 +92,25 @@ target_link_libraries(lslidar_driver_node
${Boost_LIBRARIES}
)
-ament_target_dependencies(lslidar_driver_node
- rclcpp
- sensor_msgs
- std_msgs
- lslidar_msgs
- ament_index_cpp
- pcl_conversions
-)
+if(COMMAND ament_target_dependencies)
+ ament_target_dependencies(lslidar_driver_node
+ rclcpp
+ sensor_msgs
+ std_msgs
+ lslidar_msgs
+ ament_index_cpp
+ pcl_conversions
+ )
+else()
+ target_link_libraries(lslidar_driver_node
+ rclcpp::rclcpp
+ sensor_msgs::sensor_msgs
+ std_msgs::std_msgs
+ lslidar_msgs::lslidar_msgs
+ ament_index_cpp::ament_index_cpp
+ pcl_conversions::pcl_conversions
+ )
+endif()
install(TARGETS
lslidar_driver
+101 -3
View File
@@ -1,3 +1,101 @@
diff --git a/COLCON_IGNORE b/COLCON_IGNORE
new file mode 100644
index 0000000..e69de29
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 75e0b30..5375a4a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,27 +61,44 @@ endif()
find_package(PythonLibs REQUIRED) # Consider using Pybind11 for ROS2
find_path(MATPLOTLIB_CPP_INCLUDE_DIRS "matplotlibcpp.h")
+find_package(PCL REQUIRED COMPONENTS common io filters)
+
include_directories(
include
${EIGEN3_INCLUDE_DIR}
${PYTHON_INCLUDE_DIRS}
+ ${PCL_INCLUDE_DIRS}
)
+link_directories(${PCL_LIBRARY_DIRS})
+add_definitions(${PCL_DEFINITIONS})
# Declare a ROS2 executable
add_executable(pointlio_mapping src/laserMapping.cpp include/ikd-Tree/ikd_Tree.cpp src/parameters.cpp src/preprocess.cpp src/Estimator.cpp)
-ament_target_dependencies(pointlio_mapping
- rclcpp
- rclpy
- geometry_msgs
- nav_msgs
- sensor_msgs
- pcl_ros
- pcl_conversions
- tf2_ros
- visualization_msgs
- # livox_ros_driver2
-)
-target_link_libraries(pointlio_mapping ${PYTHON_LIBRARIES})
+if(COMMAND ament_target_dependencies)
+ ament_target_dependencies(pointlio_mapping
+ rclcpp
+ rclpy
+ geometry_msgs
+ nav_msgs
+ sensor_msgs
+ pcl_ros
+ pcl_conversions
+ tf2_ros
+ visualization_msgs
+ # livox_ros_driver2
+ )
+else()
+ target_link_libraries(pointlio_mapping
+ rclcpp::rclcpp
+ geometry_msgs::geometry_msgs
+ nav_msgs::nav_msgs
+ sensor_msgs::sensor_msgs
+ pcl_conversions::pcl_conversions
+ tf2_ros::tf2_ros
+ visualization_msgs::visualization_msgs
+ )
+endif()
+target_link_libraries(pointlio_mapping ${PYTHON_LIBRARIES} ${PCL_LIBRARIES})
target_include_directories(pointlio_mapping PRIVATE ${PYTHON_INCLUDE_DIRS})
# Install the executable
diff --git a/include/common_lib.h b/include/common_lib.h
index a3ef8e5..96beb41 100644
--- a/include/common_lib.h
+++ b/include/common_lib.h
@@ -7,7 +7,7 @@
#include <pcl/point_cloud.h>
#include <sensor_msgs/msg/imu.hpp>
#include <nav_msgs/msg/odometry.hpp>
-#include <tf2_ros/transform_broadcaster.h>
+#include <tf2_ros/transform_broadcaster.hpp>
#include <deque>
using namespace std;
using namespace Eigen;
diff --git a/src/IMU_Processing.hpp b/src/IMU_Processing.hpp
index 898a451..1a7a0a7 100644
--- a/src/IMU_Processing.hpp
+++ b/src/IMU_Processing.hpp
@@ -16,7 +16,7 @@
#include <nav_msgs/msg/odometry.hpp>
#include <pcl/common/transforms.h>
#include <pcl/kdtree/kdtree_flann.h>
-#include <tf2_ros/transform_broadcaster.h>
+#include <tf2_ros/transform_broadcaster.hpp>
#include <pcl_conversions/pcl_conversions.h>
#include <sensor_msgs/msg/imu.hpp>
#include <sensor_msgs/msg/point_cloud2.hpp>
diff --git a/src/laserMapping.cpp b/src/laserMapping.cpp
index b6d5f4a..2d5bebc 100644
--- a/src/laserMapping.cpp
+++ b/src/laserMapping.cpp
@@ -19,7 +19,7 @@
#include <pcl/filters/voxel_grid.h>
#include <pcl/io/pcd_io.h>
#include <sensor_msgs/msg/point_cloud2.hpp>
-#include <tf2_ros/transform_broadcaster.h>
+#include <tf2_ros/transform_broadcaster.hpp>
#include <geometry_msgs/msg/vector3.hpp>
// #include <livox_ros_driver2/msg/custom_msg.hpp>
+51 -13
View File
@@ -2,10 +2,10 @@ diff --git a/unitree_lidar_ros/src/unitree_lidar_ros/COLCON_IGNORE b/unitree_lid
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
index 041ef0d..7014678 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)
@@ -23,16 +23,16 @@ find_package(pcl_conversions REQUIRED)
find_package(PCL REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(sensor_msgs REQUIRED)
@@ -15,6 +15,7 @@ index 041ef0d..dd57d47 100644
${PCL_INCLUDE_DIRS}
include
- ../../../unitree_lidar_sdk/include
+ ${unitree_lidar_sdk_INCLUDE_DIRS}
)
link_directories(
@@ -23,22 +24,62 @@ index 041ef0d..dd57d47 100644
)
add_definitions(${PCL_DEFINITIONS})
@@ -42,7 +41,6 @@ add_executable(unitree_lidar_ros2_node src/unitree_lidar_ros2_node.cpp)
@@ -42,17 +42,31 @@ 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
+ # unitree_lidar_sdk only exports legacy ament_export_libraries()/
+ # ament_export_include_directories() variables, not a namespaced CMake
+ # target, so it must be linked via ${unitree_lidar_sdk_LIBRARIES}.
+ ${unitree_lidar_sdk_LIBRARIES}
)
ament_target_dependencies(
@@ -52,6 +50,7 @@ ament_target_dependencies(
geometry_msgs
tf2_ros
pcl_conversions
+ unitree_lidar_sdk
)
-ament_target_dependencies(
- unitree_lidar_ros2_node
- rclcpp std_msgs
- sensor_msgs
- geometry_msgs
- tf2_ros
- pcl_conversions
-)
+if(COMMAND ament_target_dependencies)
+ ament_target_dependencies(
+ unitree_lidar_ros2_node
+ rclcpp std_msgs
+ sensor_msgs
+ geometry_msgs
+ tf2_ros
+ pcl_conversions
+ )
+else()
+ target_link_libraries(unitree_lidar_ros2_node
+ rclcpp::rclcpp
+ std_msgs::std_msgs
+ sensor_msgs::sensor_msgs
+ geometry_msgs::geometry_msgs
+ tf2_ros::tf2_ros
+ pcl_conversions::pcl_conversions
+ )
+endif()
install(TARGETS
unitree_lidar_ros2_node
diff --git a/unitree_lidar_ros2/src/unitree_lidar_ros2/include/unitree_lidar_ros2.h b/unitree_lidar_ros2/src/unitree_lidar_ros2/include/unitree_lidar_ros2.h
index 29c094c..5159909 100644
--- a/unitree_lidar_ros2/src/unitree_lidar_ros2/include/unitree_lidar_ros2.h
+++ b/unitree_lidar_ros2/src/unitree_lidar_ros2/include/unitree_lidar_ros2.h
@@ -25,8 +25,8 @@
#include "rclcpp/rclcpp.hpp"
#include "rclcpp/time.hpp"
-#include "tf2_ros/transform_broadcaster.h"
-#include "tf2/LinearMath/Quaternion.h"
+#include "tf2_ros/transform_broadcaster.hpp"
+#include "tf2/LinearMath/Quaternion.hpp"
#include "geometry_msgs/msg/transform_stamped.hpp"
// SDK
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
@@ -131,6 +172,3 @@ index 0000000..ef88d9a
+ <build_type>ament_cmake</build_type>
+ </export>
+</package>
diff --git a/COLCON_IGNORE b/COLCON_IGNORE
new file mode 100644
index 0000000..e69de29
+28 -2
View File
@@ -1,5 +1,31 @@
git
libapr1-dev
libaprutil1-dev
libasio-dev
libboost-all-dev
libboost-dev
libpcap0.8-dev
libpcl-apps1.15
libpcl-common1.15
libpcl-dev
libpcl-features1.15
libpcl-filters1.15
libpcl-io1.15
libpcl-kdtree1.15
libpcl-keypoints1.15
libpcl-ml1.15
libpcl-octree1.15
libpcl-outofcore1.15
libpcl-people1.15
libpcl-recognition1.15
libpcl-registration1.15
libpcl-sample-consensus1.15
libpcl-search1.15
libpcl-segmentation1.15
libpcl-stereo1.15
libpcl-surface1.15
libpcl-tracking1.15
libpcl-visualization1.15
libqt6core6t64
libqt6gui6
libqt6opengl6
@@ -23,19 +49,19 @@ ros-lyrical-nav2-simple-commander
ros-lyrical-pcl-conversions
ros-lyrical-pcl-ros
ros-lyrical-resource-retriever
ros-lyrical-ros2-control
ros-lyrical-ros-gz-bridge
ros-lyrical-ros-gz-sim
ros-lyrical-ros2-control
ros-lyrical-rtabmap-demos
ros-lyrical-rtabmap-slam
ros-lyrical-rtabmap-sync
ros-lyrical-rtabmap-util
ros-lyrical-rtabmap-viz
ros-lyrical-rviz2
ros-lyrical-rviz-common
ros-lyrical-rviz-default-plugins
ros-lyrical-rviz-ogre-vendor
ros-lyrical-rviz-rendering
ros-lyrical-rviz2
ros-lyrical-slam-toolbox
ros-lyrical-teleop-twist-keyboard
ros-lyrical-udp-msgs