javaandroiddepthjmonkeyenginetango

Google Tango Update Listener onXyzIjAvailable Callback never gets called


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:

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.


Solution

  • 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