0

UPDATE:

I found the lines for re-localization, but de the device doesn't localize itself. I always get the status code POSE_INITIALIZING back after loading the ADF. Also the re-localization in the Java Area_Description_Example doesn't work. Anyone with the same problem? The only apps with working re-localozation are "Explorer" and "ADF Inspector", but I don't have the source code for it.

Here is the solution of my first question, the code to check re-localization after loading an ADF:

TangoPoseData lastFramePose = mTango.getPoseAtTime(mRgbTimestampGlThread,
                            FRAME_PAIR);
    if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) {

           // Device is re-located!               

           // Update the camera pose from the renderer
           mRenderer.updateRenderCameraPose(lastFramePose);
           mCameraPoseTimestamp = lastFramePose.timestamp;
    } else {
           Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread);
    }

OLD:

In my application the user can decide whether to start a new session or load an previously recorded ADF (area description file). I loaded the ADF (adfUUID) and added it to the Tango class object (mTango) like below:

TangoConfig config = mTango.getConfig(TangoConfig.CONFIG_TYPE_CURRENT);
config.putString(TangoConfig.KEY_STRING_AREADESCRIPTION, adfUUID);
mTango.setRuntimeConfig(config);

So my question is now, how can I check if the area is localized with the loaded ADF? I want to have a coordinate reference frame to the start of service of the loaded ADF and not of my new session. This are my settings in my connectTango() function:

TangoConfig config = mTango.getConfig(TangoConfig.CONFIG_TYPE_DEFAULT);
config.putBoolean(TangoConfig.KEY_BOOLEAN_LOWLATENCYIMUINTEGRATION, true);
config.putBoolean(TangoConfig.KEY_BOOLEAN_DEPTH, true);
config.putBoolean(TangoConfig.KEY_BOOLEAN_LEARNINGMODE, true);
config.putBoolean(TangoConfig.KEY_BOOLEAN_COLORCAMERA, true);
mTango.connect(config);

And the fram pair I used is:

private static final TangoCoordinateFramePair FRAME_PAIR = new TangoCoordinateFramePair(
        TangoPoseData.COORDINATE_FRAME_AREA_DESCRIPTION,
        TangoPoseData.COORDINATE_FRAME_DEVICE);
Konsti
  • 83
  • 8

2 Answers2

1

Both "Loaded ADF on with Learning mode on" and "Load ADF on with Learning mode off" are Good. Currently They are using different location pipeline. So the first one will take much longer time localized than the second ones. ADF Inspector is for Load ADF on with Learning off" Tango Explorer should be Re-localized with with "Load ADF on with Learning on"

for question about how to check the ADF localized please see the example java code:

  // Check for Device wrt ADF pose, Device wrt Start of Service pose,
                // Start of Service wrt ADF pose (This pose determines if the device
                // is relocalized or not).
                if (pose.baseFrame == TangoPoseData.COORDINATE_FRAME_AREA_DESCRIPTION
                        && pose.targetFrame == TangoPoseData
                        .COORDINATE_FRAME_START_OF_SERVICE) {
                    if (pose.statusCode == TangoPoseData.POSE_VALID) {
                        mIsRelocalized = true;
                    } else {
                        mIsRelocalized = false;
                    }

Pose Data on the third ones:

ArrayList<TangoCoordinateFramePair> framePairs = new ArrayList<TangoCoordinateFramePair>();
    framePairs.add(new TangoCoordinateFramePair(
            TangoPoseData.COORDINATE_FRAME_START_OF_SERVICE,
            TangoPoseData.COORDINATE_FRAME_DEVICE));
    framePairs.add(new TangoCoordinateFramePair(
            TangoPoseData.COORDINATE_FRAME_AREA_DESCRIPTION,
            TangoPoseData.COORDINATE_FRAME_DEVICE));
    framePairs.add(new TangoCoordinateFramePair(
            TangoPoseData.COORDINATE_FRAME_AREA_DESCRIPTION,
            TangoPoseData.COORDINATE_FRAME_START_OF_SERVICE));
Lu sandy
  • 586
  • 3
  • 8
  • Thank you for your answer. But is there a way to reduce the time for **"Loaded ADF on with Learning mode on"**? Because this case it totally unuseful if you have to wait 5 minutes until the device is localized. – Konsti May 23 '16 at 08:23
  • And is it even possible to enable learning mode on runtime after re-localization is occured? – Konsti May 23 '16 at 08:44
  • sorry, Right now there is no way you can do that – Lu sandy May 24 '16 at 06:23
  • 2
    has anyone been able to get this feature to work at any length of time? i've tried to re-localize using a relatively small space with lots of features and tried for much more than 5 minutes and it never works (even using the Explorer). leanringmode=off works fine just like everyone else reports – ethan123 Dec 24 '16 at 11:53
0

I found some pretty similiar questions on the same topic here:

1. question

2. question

3. question

4. question

So I think the answer is the following: Re-localization with an loaded ADF and learning mode on works, but it takes quite a while (up to 3-5 minutes). Walk around and don't give up.

Re-localization with an loaded ADF and learning mode off works.

Community
  • 1
  • 1
Konsti
  • 83
  • 8