How to get distance of a pixel point through realsense?

asked 2019-02-26 08:27:21 -0600

七小丘人 gravatar image

updated 2019-02-26 20:33:51 -0600

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/compressed/parameter_updates
/camera/color/image_raw/compressedDepth
/camera/color/image_raw/compressedDepth/parameter_descriptions
/camera/color/image_raw/compressedDepth/parameter_updates
/camera/color/image_raw/theora
/camera/color/image_raw/theora/parameter_descriptions
/camera/color/image_raw/theora/parameter_updates
/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/compressed/parameter_updates
/camera/depth/image_rect_raw/compressedDepth
/camera/depth/image_rect_raw/compressedDepth/parameter_descriptions
/camera/depth/image_rect_raw/compressedDepth/parameter_updates
/camera/depth/image_rect_raw/theora
/camera/depth/image_rect_raw/theora/parameter_descriptions
/camera/depth/image_rect_raw/theora/parameter_updates
/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/compressed/parameter_updates
/camera/infra1/image_rect_raw/compressedDepth
/camera/infra1/image_rect_raw/compressedDepth/parameter_descriptions
/camera/infra1/image_rect_raw/compressedDepth/parameter_updates
/camera/infra1/image_rect_raw/theora
/camera/infra1/image_rect_raw/theora/parameter_descriptions
/camera/infra1/image_rect_raw/theora/parameter_updates
/camera/realsense2_camera_manager/bond
/camera/realsense2_camera_manager/parameter_descriptions
/camera/realsense2_camera_manager/parameter_updates
edit retag flag offensive close merge delete

Comments

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.

aPonza gravatar imageaPonza ( 2019-02-27 02:06:09 -0600 )edit

Thank you,but I know little about the PointCloud2 format. Can you give some suggestions about how to get distance from pointcloud2?

七小丘人 gravatar image七小丘人 ( 2019-02-28 07:55:33 -0600 )edit