leggedrobotics / darknet_ros

YOLO ROS: Real-Time Object Detection for ROS
BSD 3-Clause "New" or "Revised" License
2.14k stars 1.16k forks source link

About Publishing empty array when darknet_ros detect nothing. #355

Open Jaelly opened 2 years ago

Jaelly commented 2 years ago

Additional context

Hi, I perfectly success to run darknet_ros on my laptop, but I want to customize it. I want darknet_ros to always publish empty array when darknet_ros detect nothing.

So, I fixed ~/darknetros/src/YoloObjectDetector.cpp line 360. 0 to 1 ` if (count == 0) { roiBoxes[0].num = 1; } else { roiBoxes_[0].num = count; }` But I noticed that darknet_ros publish the 'car' topic 0even though there weren't car. And, the imformation about cat was old one.(same probability) I think that was saved data a few seconds ago.

Is there any tip for properly publishing empty array when I detect nothing?

Screenshots If applicable, add screenshots to help explain your problem. image image

System (please complete the following information):