Error: Invalid argument passed to canTransform argument source_frame
Hi,
I'm using the Euclidean Clustering and trying to publish a certain cluster which has 3500- 4500 points in it, but iI'm getting a weird error when trying to visualize it in rviz.
[WARN] [1426601373.806774699]: Invalid argument passed to canTransform argument source_frame in tf2 frame_ids cannot be empty
It works fine when I use the original cloud, the problem seems to be with the cloudCluster. Here is the code:
pcl::PointCloud<pcl::PointXYZ> cloudCluster;
for (std::vector<pcl::PointIndices>::const_iterator it = cluster_indices.begin (); it != cluster_indices.end (); ++it)
{
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_cluster (new pcl::PointCloud<pcl::PointXYZ>);
for (std::vector<int>::const_iterator pit = it->indices.begin (); pit != it->indices.end (); ++pit)
{
cloud_cluster->points.push_back (cloud_filtered->points[*pit]);
}
cloud_cluster->width = cloud_cluster->points.size ();
cloud_cluster->height = 1;
cloud_cluster->is_dense = true;
if (cloud_cluster->points.size() > 3500 && cloud_cluster->points.size() < 4500) {
cloudCluster = *cloud_cluster;
}
j++;
}
sensor_msgs::PointCloud2 cloud2;
pcl::toROSMsg(cloudCluster, cloud2);
pub_.publish(cloud2);
It would probably help if you updated your question with what "a weird error" actually is.
For some reason it did not show up, removed [] from WARN and now it shows
In the future, format console copy/pastes as code.