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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…