0

first: there are two topics in here which are pretty similar, but one ended with the device being faulty, others are on the C API... that's why a open a new question.

I am using the Google Tango SDK with jMonkeyEngine for a scientific Augmented Reality Application. So far everything worked great. But now I would like to use the Point Cloud Data from the Tango, which is given to a Listener (Class: OnTangoUpdateListener). (Tango Depth Perception) There are 4 methods:

  • onPoseAvailable(TangoPoseData pose)
  • onXyzIjAvailable(TangoXyzIjData xyzIj)
  • onTangoEvent(TangoEvent arg0)
  • onFrameAvailable(int arg0)

an 3 of them are called regularly. The problem is: onXyzIjAvailable gets never called, so I can't access the point cloud data. Here is my code snippet, do you know what I am doing wrong or what I could try?

public class TangoUpdateListener implements OnTangoUpdateListener {
@Override
            public void onXyzIjAvailable(TangoXyzIjData xyzIj)
            {

                System.out.println("POINT CLOUD AVAILABLE");
                Log.e("CLOUD", "CLOUD AVAILABLE");
        }
}

The whole file can be found here: Pastebin

Thank you for your help!

PS: The device works flawlessly with the example project. It's not a hardware issue.

Gem
  • 53
  • 5
  • were you managed to solve it? take a look at http://stackoverflow.com/questions/31981756/project-tango-never-called-the-onxyzijavailable-callback for reference. – Nativ May 04 '16 at 09:37
  • 1
    That thread ended with the thread opener returning his Tango, because it was faulty. However, I found out which part is inhibiting the callback. It seems that PointCloudSensor needs the camera. I give the camera to a second activity to have the camera image in the background for an augmented reality app. The problem is, only one activity seems to be able to access the camera at once... Hope someone can help :) – Gem May 06 '16 at 15:16
  • yes the camera is a single instance and only one app/service/activity and so on can use it. For what I got you can only get the Point Clould when connecting the Tango object to a Renderer(and connecting that renderer to the Surface). I'm not sure thought since I base this assumption only on my experience and not on crowd wisdom. – Nativ May 10 '16 at 06:45

1 Answers1

1

I found out what inhibits the Callback. Acutally only one activity at a time can use the Camera. As I develop an Augmented Reality App, I have two activities. One for the background - showing the camera video - and one for rendering the virtual objects - using the camera for depth information. Although the RGB camera and the Depth camera are not the same device, Android thinks they are, and allows only access to one of them at a time. Therefore deactivating the background video enables the Depth Data Callback and vice versa.

If someone knows how to use both of them at the same time - that would be awesome.

Cheers, Gem

Gem
  • 53
  • 5