PCL Header to Sensor_msg convertion problem
Guys,
I have this code snippet (I wrote it):
#include "depth_image_proc.h"
#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <pcl_ros/point_cloud.h>
#include <pcl/point_types.h>
#include <sensor_msgs/image_encodings.h>
#include <image_geometry/pinhole_camera_model.h>
#include <sensor_msgs/PointCloud2.h>
generatePCL::generatePCL(const sensor_msgs::ImageConstPtr& depth_msg,
const sensor_msgs::CameraInfoConstPtr& info_m)
{
cloud_msg.header = depth_msg->header;
cloud_msg.height = depth_msg->height;
cloud_msg.width = depth_msg->width;
cloud_msg.is_dense = false;
cloud_msg.points.resize(cloud_msg.height * cloud_msg.width);
convert(depth_msg);
}
Where cloud_msg is defined as:
pcl::PointCloud<pcl::PointXYZ> cloud_msg;
But after I run the code I get this error:
depth_image_proc.cpp: In constructor ‘generatePCL::generatePCL(const ImageConstPtr&, const CameraInfoConstPtr&)’:
depth_image_proc.cpp:16:19: error: no match for ‘operator=’ (operand types are ‘pcl::PCLHeader’ and ‘const _header_type {aka const std_msgs::Header_<std::allocator<void> >}’)
cloud_msg.header = depth_msg->header;
^
Is there a library I am missing? Or a new format? This code was running in Fuerte, and now I am trying to make it run in Indigo.