Skip to content

Commit 7c01561

Browse files
committed
feat(temp): debug 3d det
1 parent e567d5b commit 7c01561

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/rai_extensions/rai_open_set_vision/rai_open_set_vision/tools/segmentation_tools.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,25 @@ def _process_mask(
291291
masked_depth_image, intrinsic[0], intrinsic[1], intrinsic[2], intrinsic[3]
292292
)
293293

294-
# TODO: Filter out outliers
295294
points = pcd
295+
# publish resulting pointcloud
296+
import time
297+
298+
from geometry_msgs.msg import Point32
299+
from sensor_msgs.msg import PointCloud
300+
301+
msg = PointCloud()
302+
msg.header.frame_id = "egofront_rgbd_camera_depth_optical_frame"
303+
msg.points = [Point32(x=p[0], y=p[1], z=p[2]) for p in points]
304+
pub = self.connector.node.create_publisher(
305+
PointCloud, "/debug/get_grabbing_point_pointcloud", 10
306+
)
307+
while True:
308+
self.connector.node.get_logger().info(
309+
f"publishing pointcloud to /debug/get_grabbing_point_pointcloud: {len(msg.points)} points, mean: {np.array(points.mean(axis=0))}."
310+
)
311+
pub.publish(msg)
312+
time.sleep(0.1)
296313

297314
# https://github.com/ycheng517/tabletop-handybot/blob/6d401e577e41ea86529d091b406fbfc936f37a8d/tabletop_handybot/tabletop_handybot/tabletop_handybot_node.py#L413-L424
298315
grasp_z = points[:, 2].max()

0 commit comments

Comments
 (0)