ros-perception / vision_msgs

Algorithm-agnostic computer vision message types for ROS.
Apache License 2.0
155 stars 74 forks source link

Query regarding usage of vision_msgs::msg::Detection2DArray #37

Closed VeCAD closed 3 years ago

VeCAD commented 4 years ago

I can see the darknet detector values (bbox, object id) is being published using ros2 topic echo /topic. But I'm having issue pulling the detector values.

At the subscriber: const vision_msgs::msg::Detection2DArray::SharedPtr det_msg

I can pull the header info as below. std::cout << det_msg->header.frame_id << std::endl;

Is there any example that uses Detection2DArray at subscription side?

Kukanani commented 4 years ago

Hi, I am not sure what code you are using to generate the detections, but if this package is being used as intended, then I think you're looking for det_msg->detections[0].results.id and det_msg->detections[0].results.score.

The id field should allow you to look up the results in a lookup table that should be supplied either in the dataset or by the detector. See https://github.com/Kukanani/vision_msgs/blob/kinetic-devel/msg/ObjectHypothesisWithPose.msg#L5 for details.

Kukanani commented 3 years ago

Closing due to inactivity.