diff --git a/CMakeLists.txt b/CMakeLists.txt index a1e0330e..40fb4a7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,10 @@ find_package(rosidl_default_generators REQUIRED) find_package(builtin_interfaces REQUIRED) find_package(std_msgs REQUIRED) find_package(sensor_msgs REQUIRED) +find_package(pcl_conversions REQUIRED) +find_package(tf2_geometry_msgs REQUIRED) +find_package(tf2_ros REQUIRED) +find_package(image_transport REQUIRED) # install(FILES DESTINATION share/${PROJECT_NAME}) # ament_export_dependencies(rosidl_default_runtime) # ament_export_dependencies(rosidl_default_runtime) @@ -47,6 +51,7 @@ target_include_directories(PandarGeneral PRIVATE src/HesaiLidar_General_SDK/src/PandarGeneralRaw/ ${Boost_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS} + ${tf2_ros_INCLUDE_DIRS} # ${ament_INCLUDE_DIRS} ) target_link_libraries(PandarGeneral @@ -55,6 +60,7 @@ target_link_libraries(PandarGeneral Boost::thread pcap # ${ament_LIBRARIES} + ${tf2_ros_LIBRARIES} ) rosidl_target_interfaces(PandarGeneral ${PROJECT_NAME} "rosidl_typesupport_cpp") @@ -99,6 +105,9 @@ ament_target_dependencies(hesai_lidar_node "sensor_msgs" "std_msgs" "tf2_geometry_msgs" + "tf2_ros" + "image_transport" + "rclcpp_components" ) target_include_directories(hesai_lidar_node PRIVATE diff --git a/src/HesaiLidar_General_SDK/src/PandarGeneralRaw/src/pandarGeneral_internal.h b/src/HesaiLidar_General_SDK/src/PandarGeneralRaw/src/pandarGeneral_internal.h index cd69a3b0..287e58be 100644 --- a/src/HesaiLidar_General_SDK/src/PandarGeneralRaw/src/pandarGeneral_internal.h +++ b/src/HesaiLidar_General_SDK/src/PandarGeneralRaw/src/pandarGeneral_internal.h @@ -26,6 +26,7 @@ #include #include +#include #include "pandarGeneral/point_types.h" #include "src/input.h" @@ -35,6 +36,7 @@ #include #include #include +#include // #include #include diff --git a/src/cloud_nodelet.cc b/src/cloud_nodelet.cc index f7921c74..fbe4fcea 100644 --- a/src/cloud_nodelet.cc +++ b/src/cloud_nodelet.cc @@ -8,7 +8,7 @@ */ #include -#include +#include #include #include #include diff --git a/src/main.cc b/src/main.cc index 71ebafc4..17e2cef4 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/src/main_ros2.cc b/src/main_ros2.cc index 5203eada..62b49535 100644 --- a/src/main_ros2.cc +++ b/src/main_ros2.cc @@ -2,10 +2,10 @@ #include #include #include -#include +#include #include #include -#include +#include #include "pandarGeneral_sdk/pandarGeneral_sdk.h" #include #include @@ -13,6 +13,7 @@ #include #include #include "std_msgs/msg/string.hpp" +#include "boost/bind.hpp" // #define PRINT_FLAG using namespace std; @@ -40,7 +41,7 @@ class HesaiLidarClient: public rclcpp::Node this->declare_parameter("target_frame", ""); this->declare_parameter("fixed_frame", ""); rclcpp::QoS qos(rclcpp::KeepLast(7)); - lidarPublisher = this->create_publisher("pandar"); + lidarPublisher = this->create_publisher("pandar", qos); packetPublisher = this->create_publisher("pandar_packets", qos); this->timer_callback(); }