PCL complains no member functions
Hello,
My system details: Arch Linux, ROS melodic. I have installed the ROS system using yay
.
I am building a library that is dependent on PCL library.
Part of the code that I am using is;
pointcloud_pub_ =
nh_.advertise<pcl::PointCloud<pcl::PointXYZRGB>>("time_horizon_pointcloud", 1, true);
pcl::PointCloud<pcl::PointXYZRGB>::Ptr msg(new PointCloudXYZRGB);
msg->header.frame_id = world_frame_id_;
msg->is_dense = true;
msg->height = 1;
msg->width = points_with_id.size();
msg->points.resize(points_with_id.size());
ros::Time ros_timestamp;
ros_timestamp.fromNSec(timestamp);
pcl_conversions::toPCL(ros_timestamp, msg->header.stamp);
// pointcloud_pub_.publish(msg);
The commented line is the one which is causing the following error (i.e, if not commented out, it causes the following error and if commented out no error is reported.).
/opt/ros/melodic/include/ros/message_traits.h:125:14: error: ‘const class std::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> >’ has no member named ‘__getMD5Sum’
125 | return m.__getMD5Sum().c_str();
/opt/ros/melodic/include/ros/serialization.h:144:14: error: ‘const class std::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> >’ has no member named ‘serializationLength’
144 | return t.serializationLength();
| ~~^~~~~~~~~~~~~~~~~~~
/opt/ros/melodic/include/ros/serialization.h:127:7: error: ‘const class std::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> >’ has no member named ‘serialize’
127 | t.serialize(stream.getData(), 0);
I am not quite sure how to circumvent this error.