# How to get distance of a pixel point through realsense?

I have got x and y pixel coordinate with realsense2 and darknet_ros package. I know how to get distance with librealsense2 and there is a get_distance function.

But the device is Occupied by realsense node. Which topic should I subscribe as a pipe for realsense2 api?

/camera/color/camera_info
/camera/color/image_raw
/camera/color/image_raw/compressed
/camera/color/image_raw/compressed/parameter_descriptions
/camera/color/image_raw/compressedDepth
/camera/color/image_raw/compressedDepth/parameter_descriptions
/camera/color/image_raw/theora
/camera/color/image_raw/theora/parameter_descriptions
/camera/depth/camera_info
/camera/depth/image_rect_raw
/camera/depth/image_rect_raw/compressed
/camera/depth/image_rect_raw/compressed/parameter_descriptions
/camera/depth/image_rect_raw/compressedDepth
/camera/depth/image_rect_raw/compressedDepth/parameter_descriptions
/camera/depth/image_rect_raw/theora
/camera/depth/image_rect_raw/theora/parameter_descriptions
/camera/extrinsics/depth_to_color
/camera/extrinsics/depth_to_infra1
/camera/infra1/camera_info
/camera/infra1/image_rect_raw
/camera/infra1/image_rect_raw/compressed
/camera/infra1/image_rect_raw/compressed/parameter_descriptions
/camera/infra1/image_rect_raw/compressedDepth
/camera/infra1/image_rect_raw/compressedDepth/parameter_descriptions
/camera/infra1/image_rect_raw/theora
/camera/infra1/image_rect_raw/theora/parameter_descriptions
/camera/realsense2_camera_manager/bond
/camera/realsense2_camera_manager/parameter_descriptions

It seems you're somehow missing the topic /camera/depth_registered/points which publishes PointCloud2 messages. Take a look here. EDIT or see q310996 for an alternative.