ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

When trying to use a pcl function, the pointCloud2 object I am using appears to be the incorrect type

asked 2021-03-19 19:29:31 -0500

critopadolf gravatar image
   void processLidar_Classifier(const pcl::PCLPointCloud2ConstPtr& cloud_msg)
   {
        Eigen::Affine3f m = Eigen::Affine3f();
        pcl::RangeImagePlanar rmp; 
        rmp.createFromPointCloudWithFixedSize(cloud_msg, 800, 800, 0, 0, 1000, 1000, m);
    }

required from ‘void pcl::RangeImagePlanar::createFromPointCloudWithFixedSize(const PointCloudType&, int, int, float, float, float, float, const Affine3f&, pcl::RangeImage::CoordinateFrame, float, float) [with PointCloudType = boost::shared_ptr<const pcl::pclpointcloud2="">; Eigen::Affine3f = Eigen::Transform<float, 3,="" 2="">]’ /home/bot/src/_basic/src/process_main.cpp:85:87: required from here /usr/include/pcl-1.7/pcl/range_image/impl/range_image.hpp:232:46: error: no type named ‘PointType’ in ‘class boost::shared_ptr<const pcl::pclpointcloud2="">’ typedef typename PointCloudType::PointType PointType2;

I've tried using (*cloud_msg) instead but it's class really doesn't have a 'PointType' type so I'm very confused on what this function expects. It says "const PointCloudType & point_cloud" but I don't know how to convert pointCloud2 into this type.

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2021-03-20 10:53:43 -0500

critopadolf gravatar image

https://github.com/tu-darmstadt-ros-p...

found an example here. I just have to convert the ROS message to pcl::PointCloud<pointt>

  pcl::PointCloud<PointT> cloud_pcl;
  pcl::fromROSMsg(cloud_msg, cloud_pcl);
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-03-19 19:29:31 -0500

Seen: 188 times

Last updated: Mar 20 '21