ubuntu20.04编译ntd_omp的问题

ubuntu20.04编译ntd_omp的问题

ROS2移植过程中也会出现,工作中遇见几次了,记录以下。

报错

在这里插入图片描述
需修改 gicp_omp.h 以下的代码:

	  typedef pcl::PointCloud<PointSource> PointCloudSource;
      typedef typename PointCloudSource::Ptr PointCloudSourcePtr;
      typedef typename PointCloudSource::ConstPtr PointCloudSourceConstPtr;

      typedef pcl::PointCloud<PointTarget> PointCloudTarget;
      typedef typename PointCloudTarget::Ptr PointCloudTargetPtr;
      typedef typename PointCloudTarget::ConstPtr PointCloudTargetConstPtr;

      typedef pcl::PointIndices::Ptr PointIndicesPtr;
      typedef pcl::PointIndices::ConstPtr PointIndicesConstPtr;

      typedef std::vector< Eigen::Matrix3d, Eigen::aligned_allocator<Eigen::Matrix3d> > MatricesVector;
      typedef boost::shared_ptr< MatricesVector > MatricesVectorPtr;
      typedef boost::shared_ptr< const MatricesVector > MatricesVectorConstPtr;
      
      typedef typename pcl::Registration<PointSource, PointTarget>::KdTree InputKdTree;
      typedef typename pcl::Registration<PointSource, PointTarget>::KdTreePtr InputKdTreePtr;

      typedef boost::shared_ptr< GeneralizedIterativeClosestPoint<PointSource, PointTarget> > Ptr;
      typedef boost::shared_ptr< const GeneralizedIterativeClosestPoint<PointSource, PointTarget> > ConstPtr;
      
      typedef Eigen::Matrix<double, 6, 1> Vector6d;

修改为

	  using PointCloudSource = pcl::PointCloud<PointSource>;
      using PointCloudSourcePtr = typename PointCloudSource::Ptr;
      using PointCloudSourceConstPtr = typename PointCloudSource::ConstPtr;

      using PointCloudTarget = pcl::PointCloud<PointTarget>;
      using PointCloudTargetPtr = typename PointCloudTarget::Ptr;
      using PointCloudTargetConstPtr = typename PointCloudTarget::ConstPtr;

      using PointIndicesPtr = pcl::PointIndices::Ptr;
      using PointIndicesConstPtr = pcl::PointIndices::ConstPtr;

      using MatricesVector = std::vector< Eigen::Matrix3d, Eigen::aligned_allocator<Eigen::Matrix3d> >;
      using MatricesVectorPtr = boost::shared_ptr< MatricesVector >;
      using MatricesVectorConstPtr = boost::shared_ptr< const MatricesVector >;
      
      using InputKdTree = typename pcl::Registration<PointSource, PointTarget>::KdTree;
      using InputKdTreePtr = typename pcl::Registration<PointSource, PointTarget>::KdTreePtr;

      using Ptr = boost::shared_ptr< GeneralizedIterativeClosestPoint<PointSource, PointTarget> >;
      using ConstPtr = boost::shared_ptr< const GeneralizedIterativeClosestPoint<PointSource, PointTarget> >;


      using Vector6d = Eigen::Matrix<double, 6, 1>;

修改另一处代码:

rigid_transformation_estimation_ = 
          boost::bind (&GeneralizedIterativeClosestPoint<PointSource, PointTarget>::estimateRigidTransformationBFGS, 
                       this, _1, _2, _3, _4, _5); 

修改为:

rigid_transformation_estimation_ = [this](const PointCloudSource &cloud_src,
                                                  const std::vector<int> &indices_src,
                                                  const PointCloudTarget &cloud_tgt,
                                                  const std::vector<int> &indices_tgt,
                                                  Eigen::Matrix4f &transformation_matrix)
        {
          estimateRigidTransformationBFGS(cloud_src,indices_src,cloud_tgt,indices_tgt,transformation_matrix);
        };

修改另一处代码:

boost::function<void(const pcl::PointCloud<PointSource> &cloud_src,
                           const std::vector<int> &src_indices,
                           const pcl::PointCloud<PointTarget> &cloud_tgt,
                           const std::vector<int> &tgt_indices,
                           Eigen::Matrix4f &transformation_matrix)> rigid_transformation_estimation_;

修改为:

 std::function<void(const pcl::PointCloud<PointSource> &cloud_src,
                           const std::vector<int> &src_indices,
                           const pcl::PointCloud<PointTarget> &cloud_tgt,
                           const std::vector<int> &tgt_indices,
                           Eigen::Matrix4f &transformation_matrix)> rigid_transformation_estimation_;
  • 7
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值