Skip to content

Commit

Permalink
Add always_publish arg
Browse files Browse the repository at this point in the history
  • Loading branch information
tkmtnt7000 committed Jun 26, 2023
1 parent d2c8a34 commit d850123
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/coral_usb/detector_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ def image_cb(self, msg):
self.labels = labels
self.scores = scores

if not self.always_publish and len(cls_msg.labels) <= 0:
return
self.pub_rects.publish(rect_msg)
self.pub_class.publish(cls_msg)

Expand Down
5 changes: 5 additions & 0 deletions python/coral_usb/node_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ def __init__(self, model_file=None, label_file=None, namespace='~'):
self.timer = rospy.Timer(
rospy.Duration(self.duration), self.visualize_cb)

self.always_publish = rospy.get_param("~always_publish", True)
rospy.loginfo(
"Publish even if object/human_pose is not found : {}".format(
self.always_publish))

def subscribe(self):
if self.transport_hint == 'compressed':
self.sub_image = rospy.Subscriber(
Expand Down

0 comments on commit d850123

Please sign in to comment.