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 #include #include -#include +#include #include 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 #include #include -#include +#include #include #include #include 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 #include #include -#include +#include #include // #include