diff --git a/nebula_common/CMakeLists.txt b/nebula_common/CMakeLists.txt
index 154f8e453..2e4be4f14 100644
--- a/nebula_common/CMakeLists.txt
+++ b/nebula_common/CMakeLists.txt
@@ -2,13 +2,9 @@ cmake_minimum_required(VERSION 3.14)
project(nebula_common)
find_package(ament_cmake_auto REQUIRED)
-find_package(PCL REQUIRED)
find_package(PCL REQUIRED COMPONENTS common)
-find_package(pcl_conversions REQUIRED)
find_package(yaml-cpp REQUIRED)
-ament_auto_find_build_dependencies()
-
# Default to C++17
if (NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
@@ -28,21 +24,35 @@ if(BUILD_TESTING)
endif()
include_directories(
- include
- SYSTEM
- ${YAML_CPP_INCLUDE_DIRS}
- ${PCL_INCLUDE_DIRS}
- ${PCL_COMMON_INCLUDE_DIRS}
+ include
+ SYSTEM
+ ${YAML_CPP_INCLUDE_DIRS}
+ ${PCL_INCLUDE_DIRS}
+)
+
+link_libraries(
+ ${PCL_LIBRARIES}
+ ${YAML_CPP_LIBRARIES}
+)
+
+add_library(nebula_common SHARED
+ src/nebula_common.cpp
+ src/velodyne/velodyne_calibration_decoder.cpp
)
-ament_auto_add_library(nebula_common SHARED
- src/nebula_common.cpp
- src/velodyne/velodyne_calibration_decoder.cpp
- )
+install(TARGETS nebula_common EXPORT export_nebula_common)
+install(DIRECTORY include/ DESTINATION include/${PROJECT_NAME})
+
+ament_export_include_directories("include/${PROJECT_NAME}")
+ament_export_targets(export_nebula_common)
+
+ament_export_dependencies(
+ PCL
+ yaml-cpp
+)
-target_link_libraries(nebula_common yaml-cpp)
+ament_package()
-ament_auto_package()
# Set ROS_DISTRO macros
set(ROS_DISTRO $ENV{ROS_DISTRO})
diff --git a/nebula_common/package.xml b/nebula_common/package.xml
index d769e273e..f5d6c83ac 100644
--- a/nebula_common/package.xml
+++ b/nebula_common/package.xml
@@ -13,7 +13,6 @@
ros_environment
libpcl-all-dev
- pcl_conversions
yaml-cpp
ament_cmake_gtest
diff --git a/nebula_decoders/CMakeLists.txt b/nebula_decoders/CMakeLists.txt
index 31385de6f..7238e0d67 100644
--- a/nebula_decoders/CMakeLists.txt
+++ b/nebula_decoders/CMakeLists.txt
@@ -1,10 +1,6 @@
cmake_minimum_required(VERSION 3.14)
project(nebula_decoders)
-find_package(ament_cmake_auto REQUIRED)
-
-ament_auto_find_build_dependencies()
-
# Default to C++17
if (NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
@@ -14,58 +10,151 @@ if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic -Wunused-function)
endif ()
+
+find_package(ament_cmake_auto REQUIRED)
+find_package(PCL REQUIRED COMPONENTS common)
find_package(angles REQUIRED)
-find_package(PCL REQUIRED)
-find_package(pcl_conversions REQUIRED)
-find_package(yaml-cpp REQUIRED)
+find_package(continental_msgs REQUIRED)
+find_package(diagnostic_msgs REQUIRED)
find_package(nebula_common REQUIRED)
+find_package(nebula_msgs REQUIRED)
+find_package(pandar_msgs REQUIRED)
+find_package(pcl_conversions REQUIRED)
+find_package(rclcpp REQUIRED)
find_package(robosense_msgs REQUIRED)
+find_package(sensor_msgs REQUIRED)
+find_package(velodyne_msgs REQUIRED)
+find_package(yaml-cpp REQUIRED)
-include_directories(
- include
- SYSTEM
- ${YAML_CPP_INCLUDE_DIRS}
- ${PCL_INCLUDE_DIRS}
- ${PCL_COMMON_INCLUDE_DIRS}
+include_directories(PUBLIC
+ include
+ SYSTEM
+ ${nebula_common_INCLUDE_DIRS}
+ ${YAML_CPP_INCLUDE_DIRS}
+ ${PCL_INCLUDE_DIRS}
+ ${pcl_conversions_INCLUDE_DIRS}
+ ${rclcpp_INCLUDE_DIRS}
+ ${sensor_msgs_INCLUDE_DIRS}
+)
+
+link_libraries(
+ ${nebula_common_TARGETS}
+ ${PCL_LIBRARIES}
+ ${pcl_conversions_LIBRARIES}
+ ${rclcpp_TARGETS}
+ ${sensor_msgs_TARGETS}
)
# Lidar Decoders
# Hesai
-ament_auto_add_library(nebula_decoders_hesai SHARED
- src/nebula_decoders_hesai/hesai_driver.cpp
- )
+add_library(nebula_decoders_hesai SHARED
+ src/nebula_decoders_hesai/hesai_driver.cpp
+)
+target_link_libraries(nebula_decoders_hesai PUBLIC
+ ${pandar_msgs_TARGETS}
+)
+
+target_include_directories(nebula_decoders_hesai PUBLIC
+ ${pandar_msgs_INCLUDE_DIRS}
+)
# Velodyne
-ament_auto_add_library(nebula_decoders_velodyne SHARED
- src/nebula_decoders_velodyne/velodyne_driver.cpp
- src/nebula_decoders_velodyne/decoders/vls128_decoder.cpp
- src/nebula_decoders_velodyne/decoders/vlp16_decoder.cpp
- src/nebula_decoders_velodyne/decoders/vlp32_decoder.cpp
- )
+add_library(nebula_decoders_velodyne SHARED
+ src/nebula_decoders_velodyne/velodyne_driver.cpp
+ src/nebula_decoders_velodyne/decoders/vls128_decoder.cpp
+ src/nebula_decoders_velodyne/decoders/vlp16_decoder.cpp
+ src/nebula_decoders_velodyne/decoders/vlp32_decoder.cpp
+)
+target_link_libraries(nebula_decoders_velodyne PUBLIC
+ ${angles_msgs_TARGETS}
+ ${velodyne_msgs_TARGETS}
+)
+target_include_directories(nebula_decoders_velodyne PUBLIC
+ ${angles_INCLUDE_DIRS}
+ ${velodyne_msgs_INCLUDE_DIRS}
+)
# Robosense
-ament_auto_add_library(nebula_decoders_robosense SHARED
- src/nebula_decoders_robosense/robosense_driver.cpp
- )
+add_library(nebula_decoders_robosense SHARED
+ src/nebula_decoders_robosense/robosense_driver.cpp
+)
+target_link_libraries(nebula_decoders_robosense PUBLIC
+ ${robosense_msgs_TARGETS}
+)
+target_include_directories(nebula_decoders_robosense PUBLIC
+ ${robosense_msgs_INCLUDE_DIRS}
+)
-ament_auto_add_library(nebula_decoders_robosense_info SHARED
- src/nebula_decoders_robosense/robosense_info_driver.cpp
- )
+add_library(nebula_decoders_robosense_info SHARED
+ src/nebula_decoders_robosense/robosense_info_driver.cpp
+)
+target_link_libraries(nebula_decoders_robosense_info PUBLIC
+ ${robosense_msgs_TARGETS}
+)
+target_include_directories(nebula_decoders_robosense_info PUBLIC
+ ${robosense_msgs_INCLUDE_DIRS}
+)
# Continental
-ament_auto_add_library(nebula_decoders_continental SHARED
- src/nebula_decoders_continental/decoders/continental_ars548_decoder.cpp
- )
+add_library(nebula_decoders_continental SHARED
+ src/nebula_decoders_continental/decoders/continental_ars548_decoder.cpp
+)
+target_link_libraries(nebula_decoders_continental PUBLIC
+ ${continental_msgs_TARGETS}
+ ${diagnostic_msgs_TARGETS}
+ ${boost_udp_driver_TARGETS}
+ ${nebula_common_TARGETS}
+ ${nebula_msgs_TARGETS}
+)
+target_include_directories(nebula_decoders_continental PUBLIC
+ ${continental_msgs_INCLUDE_DIRS}
+ ${diagnostic_msgs_INCLUDE_DIRS}
+ ${boost_udp_driver_INCLUDE_DIRS}
+ ${nebula_common_INCLUDE_DIRS}
+ ${nebula_msgs_INCLUDE_DIRS}
+)
+
+install(TARGETS nebula_decoders_hesai EXPORT export_nebula_decoders_hesai)
+install(TARGETS nebula_decoders_velodyne EXPORT export_nebula_decoders_velodyne)
+install(TARGETS nebula_decoders_robosense EXPORT export_nebula_decoders_robosense)
+install(TARGETS nebula_decoders_robosense_info EXPORT export_nebula_decoders_robosense_info)
+install(TARGETS nebula_decoders_continental EXPORT export_nebula_decoders_continental)
+install(DIRECTORY include/ DESTINATION include/${PROJECT_NAME})
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()
-ament_auto_package(
- INSTALL_TO_SHARE
- calibration
- )
+ament_export_include_directories("include/${PROJECT_NAME}")
+ament_export_targets(export_nebula_decoders_hesai)
+ament_export_targets(export_nebula_decoders_velodyne)
+ament_export_targets(export_nebula_decoders_robosense)
+ament_export_targets(export_nebula_decoders_robosense_info)
+ament_export_targets(export_nebula_decoders_continental)
+
+install(
+ DIRECTORY calibration
+ DESTINATION share/${PROJECT_NAME}
+)
+
+ament_export_dependencies(
+ PCL
+ pcl_conversions
+ angles
+ continental_msgs
+ diagnostic_msgs
+ nebula_common
+ nebula_msgs
+ pandar_msgs
+ rclcpp
+ robosense_msgs
+ sensor_msgs
+ velodyne_msgs
+ yaml-cpp
+)
+
+ament_package()
# Set ROS_DISTRO macros
set(ROS_DISTRO $ENV{ROS_DISTRO})
diff --git a/nebula_decoders/include/nebula_decoders/nebula_decoders_robosense/robosense_info_driver.hpp b/nebula_decoders/include/nebula_decoders/nebula_decoders_robosense/robosense_info_driver.hpp
index a3b6d6d81..706d7942e 100644
--- a/nebula_decoders/include/nebula_decoders/nebula_decoders_robosense/robosense_info_driver.hpp
+++ b/nebula_decoders/include/nebula_decoders/nebula_decoders_robosense/robosense_info_driver.hpp
@@ -12,14 +12,14 @@
#include "nebula_decoders/nebula_decoders_robosense/decoders/robosense_info_decoder.hpp"
#include "nebula_decoders/nebula_decoders_robosense/decoders/robosense_info_decoder_base.hpp"
-#include "pandar_msgs/msg/pandar_packet.hpp"
-#include "pandar_msgs/msg/pandar_scan.hpp"
-
#include
#include
+#include