PCL: Input dataset is not from a projective device!

asked 2019-09-02 04:43:52 -0600

S.Yildiz gravatar image

I have a rgbd camera (pico monstar) and I want to use the statistical outlier removal filter on it. I use this 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> ()),


      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 this 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

edit retag flag offensive close merge delete