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.