@@ -78,6 +78,7 @@ def __init__(
7878
7979 self .yolo_topic = "/yolo_boxes"
8080 self .pp_topic = "/pointpillars_boxes"
81+ self .debug = False
8182
8283 rospy .loginfo (f"CombinedDetector3D Initialized. Subscribing to '{ self .yolo_topic } ' and '{ self .pp_topic } '." )
8384
@@ -93,6 +94,7 @@ def state_outputs(self) -> list:
9394 def initialize (self ):
9495 self .yolo_sub = Subscriber (self .yolo_topic , BoundingBoxArray )
9596 self .pp_sub = Subscriber (self .pp_topic , BoundingBoxArray )
97+ self .pub_fused = rospy .Publisher ("/fused_boxes" , BoundingBoxArray , queue_size = 1 )
9698
9799 queue_size = 10
98100 slop = 0.1
@@ -140,6 +142,7 @@ def _fuse_bounding_boxes(self,
140142 vehicle_state : VehicleState ,
141143 current_time : float
142144 ) -> Dict [str , AgentState ]:
145+ original_header = yolo_bbx_array .header
143146 current_agents_in_frame : Dict [str , AgentState ] = {}
144147 yolo_boxes : List [BoundingBox ] = yolo_bbx_array .boxes
145148 pp_boxes : List [BoundingBox ] = pp_bbx_array .boxes
@@ -183,7 +186,13 @@ def _fuse_bounding_boxes(self,
183186 fused_boxes_list .append (pp_box )
184187 rospy .logdebug (f"Kept unmatched PP box { j } " )
185188
186- # Agenstate
189+ if self .debug :
190+ # Work in progress to visualize combined results
191+ fused_array = BoundingBoxArray ()
192+ fused_array .header = yolo_bbx_array .header
193+ fused_array .boxes = fused_boxes_list
194+ self .pub_fused .publish (fused_array )
195+
187196 for i , box in enumerate (fused_boxes_list ):
188197 try :
189198 # Cur vehicle frame
0 commit comments