《视觉SLAM 十四讲》第五讲 实践:拼接点云-编译遇到的terminate called after throwing an instance of 'pcl::IOException问题及解决方法

《视觉SLAM 十四讲》第五讲 实践:拼接点云-编译遇到的terminate called after throwing an instance of 'pcl::IOException问题及解决方法

错误1:

启动:/home/xxx/资料/slambook-master/ch5/joinMap/build/joinMap
请在有pose.txt的目录下运行此程序
*** 退出,返回值:1 ***
解决方法:

   vector<cv::Mat> colorImgs, depthImgs;    // 彩色图和深度图
    vector<Eigen::Isometry3d, Eigen::aligned_allocator<Eigen::Isometry3d>> poses;         // 相机位姿
    
    ifstream fin("../pose.txt");
    if (!fin)
    {
        cerr<<"请在有pose.txt的目录下运行此程序"<<endl;
        return 1;
    }

第一种:即将ifstream fin("./pose.txt");改为ifstream fin("…/pose.txt");或者改成绝对路径
第二种:将pose.txt复制到build目录下

错误2:

启动:/home/xxx/资料/slambook-master/ch5/joinMap/build/joinMap
正在将图像转换为点云…
转换图像中: 1
转换图像中: 2
转换图像中: 3
转换图像中: 4
转换图像中: 5
点云共有0个点.
terminate called after throwing an instance of ‘pcl::IOException’
what(): : [pcl::PCDWriter::writeBinary] Input point cloud has no data!
*** 崩溃,返回值:0 ***
解决方法:

boost::format fmt( "../%s/%d.%s" ); //图像文件格式
        colorImgs.push_back( cv::imread( (fmt%"color"%(i+1)%"png").str() ));
        depthImgs.push_back( cv::imread( (fmt%"depth"%(i+1)%"pgm").str(), -1 )); // 使用-1读取原始图像

第一种:即将boost::format fmt( “./%s/%d.%s” ); 改为boost::format fmt( “…/%s/%d.%s” );
第二种:boost::format fmt( "/home/sunshine/slambook/ch5/joinMap/%s/%d.%s" ); //图像文件格式 colorImgs.push_back( cv::imread( (fmt%"color"%(i+1)%"png").str() )); depthImgs.push_back( cv::imread( (fmt%"depth"%(i+1)%"pgm").str(), -1 )); // 使用-1读取原始图像
按照这种格式把你的路径修改。

感谢原作者的回复!还有就是遇到问题是上github.com上那里面有前人遇到的问题https://github.com/gaoxiang12/slambook/issues/35
作者:RichardHansir
来源:CSDN
原文:https://blog.csdn.net/hxy130611/article/details/81170376
版权声明:本文为博主原创文章,转载请附上博文链接!

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值