ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
No, you're on the right track, subscribing to the depth image is a good way to figure out the distance. The numbers you mention are a one-dimensional integer array (data
); what you now have to do is convert that into a two-dimensional float array that is indexed by pixels and where each float specifies the depth in meters. The encoding
field tells you which encoding to use.
Some pointers: