How to measure distance with realsense

asked 2018-11-25 23:58:55 -0500

jetman gravatar image

I use realsense ROS wrapper from https://github.com/intel-ros/realsense . I want to measure the distance of some objects from depth image of /camera/aligned_depth_to_color/image_raw .

Subscribe /camera/aligned_depth_to_color/image_raw but data range 0~255. I can't know the distance from camera to object.

What is a good way to measure the distance from the depth image topic .

rostopic info is:

header: 
  seq: 0
  stamp: 
    secs: 1542785488
    nsecs: 734966992
  frame_id: "camera_color_optical_frame"
height: 480
width: 640
encoding: "16UC1"
is_bigendian: 0
step: 1280
data: [62, 7, 62, 7, 62, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 62, 7, 62, 7, 62, 7, 62, 7, 62, 7, 62, 7, 62, 7, 62, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 67, 7, 73, 7, 73, 7, 73, 7, 67, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 79, 7, 79, 7, 79, 7, 79, 7, 79, 7, 79, 7, 79, 7, 79, 7, 85, 7, 85, 7, 85, 7, 85, 7, 85, 7, 85, 7, 85, 7, 85, 7, 85, 7, 85, 7, 85, 7, 85, 7, 85, 7, 85, 7, 79, 7, 79, 7, 79, 7, 79, 7, 79, 7, 79, 7, 79, 7, 79, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 73, 7, 79, 7, 79, 7, 79, 7, 79, 7, 79, 7, 79, 7, 79, 7, 79, 7, 85, 7, 85, 7, 85, 7, 85, 7, 85, 7, ...]
edit retag flag offensive close merge delete

Comments

I would really recommend to try and search for this topic on ROS Answers. Use Google: point cloud distance site:answers.ros.org.

Calculating / deriving distance from point clouds / depth images has been discussed so many times it saves you a lot of waiting on answers.

gvdhoorn gravatar image gvdhoorn  ( 2018-11-26 02:45:31 -0500 )edit