Rosjava + depth from kinect [closed]

asked 2013-03-31 10:08:52 -0600

LeopoldPodmolík gravatar image

updated 2013-04-28 23:20:57 -0600

ipso gravatar image

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);
    depthPoints.addMessageListener(new MessageListener<sensor_msgs.Image>() {
         @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 ?

Thank's for any advice

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2015-11-19 20:00:14.635855

Comments

Maybe it's an endianness issue?

damonkohler gravatar image damonkohler  ( 2013-05-07 20:57:42 -0600 )edit