ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
2020-01-29 18:55:28 -0600 | received badge | ● Famous Question (source) |
2018-08-06 05:06:19 -0600 | received badge | ● Notable Question (source) |
2018-03-22 15:01:37 -0600 | received badge | ● Popular Question (source) |
2017-04-11 11:31:20 -0600 | asked a question | ROS: Error PCL Euclidean Cluster Extraction Hi! I'm new in PCL and I'm trying to pass the Euclidean Cluster extraction to the point cloud obtained from the Kinect. The algorithm works well but I don't achieve to view the cluster cloud in RviZ. I get the next error. I think that it can be caused by a bad way to publish the information. There is the code. pcl::PointCloud<pcl::pointxyz>::Ptr cloud_cluster (new pcl::PointCloud<pcl::pointxyz>); for (std::vector<pcl::pointindices>::const_iterator it = cluster_indices.begin (); it != cluster_indices.end (); ++it) { for (std::vector<int>::const_iterator pit = it->indices.begin (); pit != it->indices.end (); ++pit) cloud_cluster->points.push_back (cloud_rem_noise->points[pit]); // cloud_cluster->width = cloud_cluster->points.size (); cloud_cluster->height = 1; cloud_cluster->is_dense = true; std::cout << "PointCloud representing the Cluster: " << cloud_cluster->points.size () << " data points." << std::endl; } // Convert to ROS data type sensor_msgs::PointCloud2 output; pcl::toPCLPointCloud2 (cloud_cluster, *cloud_plane_PCL2); pcl_conversions::fromPCL(cloud_plane_PCL2, output); // Publish the data pub.publish (output); |
2017-04-11 11:31:20 -0600 | asked a question | Error: Euclidean Cluster Extraction, Cannot publish the cloud cluster Hello I'm working with the camera Kinect and ROS. What I want to do is to pass the Euclidean Cluster Extraction algorithm ,which is already programmed by PCL, and then publish the cluster point cloud as a topic to see it in RVIZ. The algorithm works well but I don't achieve to see the point cloud in RVIZ. I get the next error. I think that is has something to do with the way of saving the information. Here's the code. pcl::PointCloud<pcl::pointxyz>::Ptr cloud_cluster (new pcl::PointCloud<pcl::pointxyz>); for (std::vector<pcl::pointindices>::const_iterator it = cluster_indices.begin (); it != cluster_indices.end (); ++it) { for (std::vector<int>::const_iterator pit = it->indices.begin (); pit != it->indices.end (); ++pit) cloud_cluster->points.push_back (cloud_rem_noise->points[pit]); // cloud_cluster->width = cloud_cluster->points.size (); cloud_cluster->height = 1; cloud_cluster->is_dense = true; std::cout << "PointCloud representing the Cluster: " << cloud_cluster->points.size () << " data points." << std::endl; } // Convert to ROS data type sensor_msgs::PointCloud2 output; pcl::toPCLPointCloud2 (cloud_cluster, *cloud_plane_PCL2); pcl_conversions::fromPCL(cloud_plane_PCL2, output); // Publish the data pub.publish (output); pub.publish (output); Thaks in advance |