Add initial conditions
modified: src/maintain/scripts/test.py
This commit is contained in:
@@ -61,13 +61,13 @@ def box_callback(box, depth, color_info):
|
|||||||
depth_image = bridge.imgmsg_to_cv2(depth, '16UC1')
|
depth_image = bridge.imgmsg_to_cv2(depth, '16UC1')
|
||||||
# pc = orh.rospc_to_o3dpc(pc_msg)
|
# pc = orh.rospc_to_o3dpc(pc_msg)
|
||||||
|
|
||||||
|
if box is not None and len(box.bounding_boxes) > 0:
|
||||||
# get the center of screw
|
# get the center of screw
|
||||||
boundingBox = box.bounding_boxes[0]
|
boundingBox = box.bounding_boxes[0]
|
||||||
screw_x = (boundingBox.xmax + boundingBox.xmin) / 2
|
screw_x = (boundingBox.xmax + boundingBox.xmin) / 2
|
||||||
screw_y = (boundingBox.ymax + boundingBox.ymin) / 2
|
screw_y = (boundingBox.ymax + boundingBox.ymin) / 2
|
||||||
# print(screw_x,screw_y)
|
# print(screw_x,screw_y)
|
||||||
|
|
||||||
|
|
||||||
depth_array = np.array(depth_image, dtype=np.float32)
|
depth_array = np.array(depth_image, dtype=np.float32)
|
||||||
depth_roi = depth_array[boundingBox.ymin:boundingBox.ymax, boundingBox.xmin:boundingBox.xmax]
|
depth_roi = depth_array[boundingBox.ymin:boundingBox.ymax, boundingBox.xmin:boundingBox.xmax]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user