Livox-SDK / livox_ros_driver

Livox device driver under ros, support Lidar Mid-40, Mid-70, Tele-15, Horizon, Avia.
Other
352 stars 201 forks source link

compilation error with pcl 1.13 #149

Open samsdolphin opened 1 year ago

samsdolphin commented 1 year ago

Hi developers, do you have a plan for supporting pcl 1.13? I'm testing with ubuntu 20.04 and ros noetic, this ros driver couldn't be compiled with following errors:

In file included from /usr/include/pcl-1.13/pcl/point_cloud.h:50, from /opt/ros/noetic/include/pcl_ros/point_cloud.h:5, from /home/sam/catkin_ws/src/livox_ros_driver/livox_ros_driver/livox_ros_driver/lddc.h:32, from /home/sam/catkin_ws/src/livox_ros_driver/livox_ros_driver/livox_ros_driver/lddc.cpp:25: /usr/include/pcl-1.13/pcl/point_traits.h:41:1: note: #pragma message: This header is deprecated. Use <pcl/type_traits.h> instead. (It will be removed in PCL 1.15) 41 | PCL_DEPRECATED_HEADER(1, 15, "Use <pcl/type_traits.h> instead.") | ^~~~~ /usr/include/pcl-1.13/pcl/point_traits.h:41:1: note: #pragma message: This header is deprecated. Use <pcl/type_traits.h> instead. (It will be removed in PCL 1.15) /usr/include/pcl-1.13/pcl/point_traits.h:41:1: note: #pragma message: This header is deprecated. Use <pcl/type_traits.h> instead. (It will be removed in PCL 1.15) /usr/include/pcl-1.13/pcl/point_traits.h:41:1: note: #pragma message: This header is deprecated. Use <pcl/type_traits.h> instead. (It will be removed in PCL 1.15) In file included from /opt/ros/noetic/include/ros/serialization.h:37, from /opt/ros/noetic/include/ros/publisher.h:34, from /opt/ros/noetic/include/ros/node_handle.h:32, from /opt/ros/noetic/include/ros/ros.h:45, from /home/sam/catkin_ws/src/livox_ros_driver/livox_ros_driver/livox_ros_driver/lddc.h:30, from /home/sam/catkin_ws/src/livox_ros_driver/livox_ros_driver/livox_ros_driver/lddc.cpp:25: /opt/ros/noetic/include/ros/message_traits.h: In instantiation of ‘static const char ros::message_traits::MD5Sum::value(const M&) [with M = std::shared_ptr<pcl::PointCloud >]’: /opt/ros/noetic/include/ros/message_traits.h:254:102: required from ‘const char ros::message_traits::md5sum(const M&) [with M = std::shared_ptr<pcl::PointCloud >]’ /opt/ros/noetic/include/ros/publisher.h:117:38: required from ‘void ros::Publisher::publish(const M&) const [with M = std::shared_ptr<pcl::PointCloud >]’ /home/sam/catkin_ws/src/livox_ros_driver/livox_ros_driver/livox_ros_driver/lddc.cpp:343:31: required from here /opt/ros/noetic/include/ros/message_traits.h:125:14: error: ‘const class std::shared_ptr<pcl::PointCloud >’ has no member named ‘getMD5Sum’ 125 | return m.getMD5Sum().c_str();

Maltiec commented 4 months ago

you should change this string in ldcc.cpp: p_publisher->publish(cloud); to: p_publisher->publish(*cloud);

and if (bag_ && enable_lidar_bag_) { bag_->write(p_publisher->getTopic(), ros::Time(timestamp / 1000000000.0), cloud); } to: if (bag_ && enable_lidar_bag_) { bag_->write(p_publisher->getTopic(), ros::Time(timestamp / 1000000000.0), *cloud); }