voxblox++源码阅读(一)

包的结构

depth_segmentation
在这里插入图片描述

源码

depth_segmentation_node.cpp

  1. main()函数
    定义类DepthSegmentationNode对象,会在构造对象时初始化成员列表:
    depth_camera_()
    rgb_camera_()
    params_()
    camra_tracker_(depth_camera_, rgb_camera_)
    depth_segmenter_(depth_camera, params)
    构造函数的主要逻辑:
    加载参数
    订阅话题:

depth_image_sub_topic
rgb_image_sub_topic
depth_camera_info_sub_topic
rgb_camera_info_topic
instance_segmentation_sub

制定同步话题的策略:ImageSegmentationSyncPolicy、cameraInfoSyncPolicy
发布话题:

object_segment
segmented_scene

2.回调函数
cameraInfoCallback(初始化depth_camera_,rgb_camera_,depth_segmenter_,camera_tracker)初始化一次之后就不回执行了
imageSegmentationCallback
(1)将接收的语义分割的消息Result从ros消息转换到自定义的消息类型semanticInstanceSegmentationFromRosMsg(Result–>SemanticInstanceSegmentation)
(2)将接收的rgb消息转为opencv格式

      cv_bridge::CvImagePtr cv_rgb_image(new cv_bridge::CvImage);  //typedef boost::shared_ptr<CvImage> CvImagePtr为智能指针
      //CvImagePtr toCvCopy(const sensor_msgs::Image& source,const std::string& encoding = std::string());
      cv_rgb_image = cv_bridge::toCvCopy(rgb_msg, rgb_msg->encoding);  
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值