1. <strong id="7actg"></strong>
    2. <table id="7actg"></table>

    3. <address id="7actg"></address>
      <address id="7actg"></address>
      1. <object id="7actg"><tt id="7actg"></tt></object>

        ROS 機(jī)器人技術(shù) - ROS 與 PCL 的點(diǎn)云類(lèi)型轉(zhuǎn)換

        共 1632字,需瀏覽 4分鐘

         ·

        2020-07-29 23:17

        82fb997a8f5d3bfcc39d8301dc707e8d.webp


        登龍

        這是我的第 138?篇原創(chuàng)


        在圖像和點(diǎn)云的融合節(jié)點(diǎn)中,做了一個(gè)點(diǎn)云格式的轉(zhuǎn)換:

        • ROS 點(diǎn)云 sensor_msgs::PointCloud2 -> PCL 第一代點(diǎn)云 pcl::PointCloudpcl::PointXYZ

        這里記錄下常用的 ROS 和 PCL 之間的轉(zhuǎn)換。

        1. sensor_msgs::PCLPointCloud2 <=> pcl::PointCloudpcl::PointXYZ

        把 ROS PointCloud2 轉(zhuǎn)為 PCL 第一代 PointCloud,方便用 PCL 庫(kù)處理:

        void?pcl::fromROSMsg(const?sensor_msgs::PointCloud2?&,?pcl::PointCloud?&);

        比如:

        sensor_msgs::PointCloud2::ConstPtr&?cloud_msg;

        //?PCL?第一代點(diǎn)云
        pcl::PointCloud::Ptr?pcl_cloud_msg(new?pcl::PointCloud);

        //?ROS?點(diǎn)云?->?PCL?第一代點(diǎn)云
        pcl::fromROSMsg(*cloud_msg,?*pcl_cloud_msg);

        把 PCL 第一代 PointCloud 轉(zhuǎn)為 ROS PointCloud2,用于發(fā)布 ROS 的點(diǎn)云主題:

        void?pcl::toROSMsg(const?pcl::PointCloud?&,?sensor_msgs::PointCloud2?&);

        比如:

        //?PCL?第一代點(diǎn)云
        pcl::PointCloud::Ptr?out_cloud(new?pcl::PointCloud);

        //?ROS?點(diǎn)云
        sensor_msgs::PointCloud2?fusion_cloud;

        //?PCL?第一代點(diǎn)云?->?ROS?點(diǎn)云
        pcl::toROSMsg(*out_cloud,?fusion_cloud);

        2. sensor_msgs::PCLPointCloud2 <=> pcl::PCLPointCloud2

        所用的頭文件:

        #include?

        把 ROS PointCloud2 轉(zhuǎn)為 PCL 第二代 PointCloud2:

        void?pcl_conversions::toPCL(const?sensor_msgs::PointCloud2?&,?pcl::PCLPointCloud2?&)

        比如:

        //?ROS?點(diǎn)云?->?第二代?PCL?點(diǎn)云
        //?cloud_msg?和?pcl_cloud2?這里都定義為指針
        pcl_conversions::toPCL(*cloud_msg,?*pcl_cloud2);

        把 PCL 第二代 PointCloud2 轉(zhuǎn)為 ROS PointCloud2:

        void?pcl_conversions::moveFromPCL(const?pcl::PCLPointCloud2?&,?const?sensor_msgs::PointCloud2?&);

        比如:

        pcl::PCLPointCloud2?pcl2_cloud_filtered;
        sensor_msgs::PointCloud2?ros_cloud_filter;

        //?第二代?PCL?點(diǎn)云?->?ROS?點(diǎn)云
        pcl_conversions::fromPCL(pcl2_cloud_filtered,?ros_cloud_filter);

        參考鏈接:

        • https://www.cnblogs.com/li-yao7758258/p/6651326.html

        推薦閱讀:

        Ubuntu install kitti2bag!

        ROS 機(jī)器人技術(shù) - TF 靜態(tài)坐標(biāo)幀

        ROS 機(jī)器人技術(shù) - rosbag 詳細(xì)使用教程



        廈大同學(xué),與你分享編程,AI 算法等技術(shù)干貨!精品文章創(chuàng)作不易,謝謝關(guān)注,歡迎在看。

        5f08dad72441495e3e417d8a30ca61cc.webp

        點(diǎn)擊閱讀原文,查看更多精彩文章!

        瀏覽 25
        點(diǎn)贊
        評(píng)論
        收藏
        分享

        手機(jī)掃一掃分享

        分享
        舉報(bào)
        評(píng)論
        圖片
        表情
        推薦
        點(diǎn)贊
        評(píng)論
        收藏
        分享

        手機(jī)掃一掃分享

        分享
        舉報(bào)
        1. <strong id="7actg"></strong>
        2. <table id="7actg"></table>

        3. <address id="7actg"></address>
          <address id="7actg"></address>
          1. <object id="7actg"><tt id="7actg"></tt></object>
            凹凸日日摸日日碰夜夜爽孕妇 | 操逼视频大香蕉 | 色婷婷伊人 | 日本成人中文字幕在线 | 狼友视频-首页 | 女人 精AAAA片一级网站 无码1区 | 欧美国产日韩人妻无码一区二区 | 在线观看国产一区 | 久久精品性爱视频 | 女人高潮天天躁夜夜躁 |