|
楼主 |
发表于 2013-5-30 11:06:33
|
显示全部楼层
mypcl 发表于 2013-5-30 10:55
nan的数值处理方式和ls说的一样,过滤掉就行了,一般用kinect或者的都会有的。至于你说保存和显示的例子 ...
恩,谢谢。我去看下滤波的部分,不过,@mypcl,@苏菲娅,我想问问你们你们用PCL是在ROS下用吗?我是在ROS下用的,所以我觉得我需要的更像是这样一个程序:
#include <ros/ros.h>
#include <pcl_ros/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/io/pcd_io.h>
#include <boost/foreach.hpp>
pcl::PointCloud<pcl::PointXYZRGB> PC;
void callback(const sensor_msgs::PointCloud2ConstPtr& msg)
{
printf("Writing the file...\n");
pcl::fromROSMsg(*msg, PC);
int a = pcl::io::savePCDFileBinary"/home/rootx/pcl_proj/pcd/temp.pcd", PC);
printf("Saved the pcd file...%d Return %d\n", PC.points.size(), a);
}
int main(int argc, char** argv)
{
ros::init(argc, argv, "sub_pcl");
ros::NodeHandle nh;
ros::Subscriber sub = nh.subscrib<sensor_msgs::PointCloud2>("points2", 1, callback);
ros::spin();
},你们是在ROS下用吗?还是直接用PCL?? |
|