Skip to content

Commit 86d8045

Browse files
committed
Added some debug code for development purposes
1 parent 914b109 commit 86d8045

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

GEMstack/onboard/perception/combined_detection.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

GEMstack/onboard/perception/yolo_node.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ def __init__(
253253
self.camera_name = 'front'
254254
self.camera_front = (self.camera_name=='front')
255255
self.score_threshold = 0.4
256+
self.debug = True
256257
self.initialize()
257258

258259
def initialize(self):
@@ -463,6 +464,20 @@ def synchronized_callback(self, image_msg, lidar_msg):
463464
box_msg.dimensions.x = float(dims[0]) # length
464465
box_msg.dimensions.y = float(dims[1]) # width
465466
box_msg.dimensions.z = float(dims[2]) # height
467+
468+
if self.debug:
469+
print("X")
470+
print(center_vehicle[0])
471+
print("L")
472+
print(dims[0])
473+
print("Y")
474+
print(center_vehicle[1])
475+
print("W")
476+
print(dims[1])
477+
print("Z")
478+
print(center_vehicle[2])
479+
print("H")
480+
print(dims[2])
466481

467482
# Add confidence score and label
468483
box_msg.value = float(conf_scores[i])

0 commit comments

Comments
 (0)