PCL: Input dataset is not from a projective device!
I have a rgbd camera (pico monstar) and I want to use the statistical outlier removal filter on it. I use the following code:
ros::Publisher pub;
void cloud_cb(const sensor_msgs::PointCloud2ConstPtr& input)
{
// Convert the sensor_msgs/PointCloud2 data to pcl/PointCloud
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>());
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_filtered(new pcl::PointCloud<pcl::PointXYZ>());
pcl::fromROSMsg(*input, *cloud);
pcl::StatisticalOutlierRemoval<pcl::PointXYZ> sor;
sor.setInputCloud(cloud);
sor.setMeanK(50);
sor.setStddevMulThresh(1.0);
sor.filter(*cloud_filtered);
sensor_msgs::PointCloud2::Ptr cloud_filtered2(new sensor_msgs::PointCloud2());
pcl::toROSMsg(*cloud_filtered, *cloud_filtered2);
// Publish the dataSize
pub.publish(cloud_filtered2);
}
int main(int argc, char** argv)
{
// Initialize ROS
ros::init(argc, argv, "statistical_outlier");
ros::NodeHandle nh;
// Create a ROS subscriber for the input point cloud
ros::Subscriber sub = nh.subscribe("/royale_camera_driver/point_cloud", 1000, cloud_cb);
// Create a ROS publisher for the output point cloud
pub = nh.advertise<sensor_msgs::PointCloud2>("/camera/points_voxel", 1000);
// Spin
ros::spin();
}
And when I run the above code, I get the following error:
[pcl::OrganizedNeighbor::radiusSearch] Input dataset is not from a projective device!
Residual (MSE) 0.000511, using 1152 valid points
But the node is running and I get always 2 Messages in approximately 2 mins
Asked by S.Yildiz on 2019-09-02 04:43:52 UTC
Comments
Any luck? Were you able to fix it?
Asked by Pran-Seven on 2022-10-17 03:49:54 UTC
@Pran-Seven please don't use an answer to leave a comment. I've moved your answer to a comment for you
Asked by jayess on 2022-10-17 17:46:46 UTC