Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
297 views
in Technique[技术] by (71.8m points)

java - Check if area is localized in loaded ADF

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);
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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));

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...