Add initial conditions

modified:   src/maintain/scripts/test.py
This commit is contained in:
wxchen
2023-05-09 16:47:18 +08:00
parent 7045f42ceb
commit 227162d767

View File

@@ -61,13 +61,13 @@ def box_callback(box, depth, color_info):
depth_image = bridge.imgmsg_to_cv2(depth, '16UC1')
# pc = orh.rospc_to_o3dpc(pc_msg)
if box is not None and len(box.bounding_boxes) > 0:
# get the center of screw
boundingBox = box.bounding_boxes[0]
screw_x = (boundingBox.xmax + boundingBox.xmin) / 2
screw_y = (boundingBox.ymax + boundingBox.ymin) / 2
# print(screw_x,screw_y)
depth_array = np.array(depth_image, dtype=np.float32)
depth_roi = depth_array[boundingBox.ymin:boundingBox.ymax, boundingBox.xmin:boundingBox.xmax]