# Rosjava + depth from kinect [closed]

Hi,

I need get Z-coordinate from kinect. I know that one way is get this information from topic depth/image ... where is compute Z-coordinate ... or another way is that compute from depth points. But I can't get right data from topics by rosjava. I write subscriber ->

  Subscriber<sensor_msgs.Image> depthPoints = connectedNode.newSubscriber("/cam3d/depth/image", sensor_msgs.Image._TYPE);
@Override
public void onNewMessage(sensor_msgs.Image message) {
ChannelBuffer data = message.getData();
int heightM = message.getHeight();
int widthM  = message.getWidth();
for(int x = 0; x < widthM; x++) {
for(int y = 0; y < heightM ; y++) { System.out.println(data.readUnsignedShort());
}
}
}
});


but I see in cmd wrong number, so I don't know what I doing wrong ...

So, How I can get Z-coordinate by rosjava ?