ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
void cloudCallback(const pcl::PointCloud<pcl::PointXYZ>::ConstPtr& msg)
{
// Read incoming cloud
pcl::PointCloud<pcl::PointXYZ>::Ptr filtered_cloud (new pcl::PointCloud<pcl::PointXYZ>);
*filtered_cloud = *msg;
}
2 | No.2 Revision |
This is how I convert it:
void cloudCallback(const pcl::PointCloud<pcl::pointxyz>::ConstPtr& msg)
3 | No.3 Revision |
This is how I convert it:
void cloudCallback(const 4 | No.4 Revision |
This is how I convert it:
void cloudCallback(const pcl::PointCloud<pcl::PointXYZ>::ConstPtr& msg)
{
// Read incoming cloud
pcl::PointCloud<pcl::PointXYZ>::Ptr filtered_cloud (new pcl::PointCloud<pcl::PointXYZ>);
*filtered_cloud = *msg;
}
5 | No.5 Revision |
This is how I convert it:
void cloudCallback(const pcl::PointCloud<pcl::PointXYZ>::ConstPtr& msg)
{
// Read incoming cloud
pcl::PointCloud<pcl::PointXYZ>::Ptr filtered_cloud (new pcl::PointCloud<pcl::PointXYZ>);
*filtered_cloud = *msg;
}
}
6 | No.6 Revision |
This is how I convert it:
void cloudCallback(const pcl::PointCloud<pcl::PointXYZ>::ConstPtr& msg)
{
// Read incoming cloud
pcl::PointCloud<pcl::PointXYZ>::Ptr filtered_cloud (new pcl::PointCloud<pcl::PointXYZ>);
*filtered_cloud = *msg;
}
}
7 | No.7 Revision |
This is how I convert it:use it. I am directly publishing and subscribing pcl::PointCloud types instead of sensor_msgs but if you create the new variable in the callback function as sensor_msgs it would work the same way.
void cloudCallback(const pcl::PointCloud<pcl::PointXYZ>::ConstPtr& msg)
{
// Read incoming cloud
pcl::PointCloud<pcl::PointXYZ>::Ptr filtered_cloud (new pcl::PointCloud<pcl::PointXYZ>);
*filtered_cloud = *msg;
}