Search code examples
androidgoogle-project-tango

Cannot get Point Cloud using callback onXyzIjAvailable


I know that there're some threads about this issue on stackoverflow but none of them has answers(Google where are you?).

When I test the Augmented Reality sample app from the samples google has published everything works great. I'm getting pose and cloud points.

But when I'm copying the same code, gradle configuration and so on into my application I'm only getting pose and no point cloud.

Instead there's the following message in the logcat.

tango-xyzij-callback.cc:125 No points in point cloud.

It looks like I'm missing some project build configuration but I went over it dozen of times and found nothing.

Here is how I configuring the Tango object:

  TangoConfig config = mTango.getConfig(TangoConfig.CONFIG_TYPE_DEFAULT);
    config.putBoolean(TangoConfig.KEY_BOOLEAN_LOWLATENCYIMUINTEGRATION, true);
    config.putBoolean(TangoConfig.KEY_BOOLEAN_COLORCAMERA, true);
    config.putBoolean(TangoConfig.KEY_BOOLEAN_DEPTH, true); // for getting point cloud
    config.putBoolean(TangoConfig.KEY_BOOLEAN_AUTORECOVERY, true);

    mTango.connect(config);

    ArrayList<TangoCoordinateFramePair> framePairs = new ArrayList();
    framePairs.add(TANGO_WORLD_T_DEVICE);

    mTango.connectListener(framePairs, new OnTangoUpdateListener() { ... }

external lib reference on app's Gradle:

def external_lib_prefix = null
if (project.hasProperty("Tango.catkin_devel_prefix")) {
    external_lib_prefix = project.property("Tango.catkin_devel_prefix")
 } else {
    // Building in standalone sample form.
    external_lib_prefix = "../../TangoReleaseLibs"
}

In the application node in the Manifest:

  <uses-library
        android:name="com.projecttango.libtango_device"
        android:required="true" />

Solution

  • I'm sure there might be lots of reasons for that behaviour, in my case it was that I used the camera object from a different component and did not realesed it. The tango core is using the camera and if it cannot accuire it the results are malfunctioning of the tango core.