节点组织

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_28306361/article/details/89103803

tracking包
订阅“image_for_tracking”话题,通过调用trackImageCallback函数解析出跟踪的结果框

detecting_and_tracking包
发布"image_for_tracking"话题,通过该话题发布用来跟踪的图像信息,信息的形式为自定义消息

sensor_msgs/Image img
int64 frame_count
int64 xmin
int64 ymin
int64 xmax
int64 ymax

detecting_test包
发布"/camere/image_raw"话题,该话题发布给darknet_ros,
订阅"/darknet_ros/detection_image",通过调用imageCallback函数显示检测的结果。

darknet_ros包

subscribers:

  camera_reading:
    topic: /camere/image_raw
    queue_size: 1

actions:

  camera_reading:
    name: /darknet_ros/check_for_objects

publishers:

  object_detector:
    topic: /darknet_ros/found_object
    queue_size: 1
    latch: false

  bounding_boxes:
    topic: /darknet_ros/bounding_boxes
    queue_size: 1
    latch: false

  detection_image:
    topic: /darknet_ros/detection_image
    queue_size: 1
    latch: true

通过”/camere/image_raw“订阅需要检测的图像,
通过三个不同的话题”/darknet_ros/found_object“、"/darknet_ros/bounding_boxes"、”/darknet_ros/detection_image“来显示检测的结果,分别表示

其中bounding_boxes的数据结构为:

Header header
Header image_header
BoundingBox[] bounding_boxes

而每一个BoundingBox的数据结构为:

string Class
float64 probability
int64 xmin
int64 ymin
int64 xmax
int64 ymax

这两个能在msg文件夹中查阅到。

猜你喜欢

转载自blog.csdn.net/qq_28306361/article/details/89103803