Reputation: 320
I have spent a some hours on Unity3D SDK Area Learning Scene trying to figure out how to load ADF and localize while using it OOTB. However, after setting m_useADF to true and verifying that the UUID is valid and passed to the TangoApplication object the system is not returning updates for the ADF and Localized parts of the pose information. My theory is that they are either never produced or lost somewhere along the pipeline to the callback.
This is the first part of the corresponding code: public bool m_useADF = true;
if(m_useADF)
{
// Query the full adf list.
PoseProvider.RefreshADFList();
// loading last recorded ADF
string uuid = PoseProvider.GetLatestADFUUID().GetStringDataUUID();
m_tangoApplication.InitProviders(uuid);
Debug.Log ("HERE IS THE UUID: " + uuid);
}
This is where the ADF and Relocalization data should be reported but they are never updated. The controller is correctly registered as a PoseListener and the MotionTracking pose data is updated correctly when the device moves around with status POSE_VALID. I haven't detected any error messages regarding the ADF not loading, however, the status is never updated past TANGO_POSE_INITIALIZING for both the ADF and Relocalization pieces of data.
// ADF
GUI.Label( new Rect(Common.UI_LABEL_START_X,
Common.UI_LABEL_START_Y + Common.UI_LABEL_OFFSET * 3,
Common.UI_LABEL_SIZE_X ,
Common.UI_LABEL_SIZE_Y), "ADF1: <size=15>" + String.Format(Common.UX_TARGET_TO_BASE_FRAME,
TangoEnums.TangoCoordinateFrameType.TANGO_COORDINATE_FRAME_DEVICE,
TangoEnums.TangoCoordinateFrameType.TANGO_COORDINATE_FRAME_AREA_DESCRIPTION) + "</size>");
GUI.Label( new Rect(Common.UI_LABEL_START_X,
Common.UI_LABEL_START_Y + Common.UI_LABEL_OFFSET * 4,
Common.UI_LABEL_SIZE_X ,
Common.UI_LABEL_SIZE_Y), "ADF2: <size=15>" + String.Format(Common.UX_STATUS,
m_status[1],
m_frameCount[1],
m_frameDeltaTime[1],
m_tangoPosition[1],
m_tangoRotation[1]) + "</size>");
// RELOCALIZATION
GUI.Label( new Rect(Common.UI_LABEL_START_X,
Common.UI_LABEL_START_Y + Common.UI_LABEL_OFFSET * 5,
Common.UI_LABEL_SIZE_X ,
Common.UI_LABEL_SIZE_Y), "RELOCALIZED1: <size=15>" + String.Format(Common.UX_TARGET_TO_BASE_FRAME,
TangoEnums.TangoCoordinateFrameType.TANGO_COORDINATE_FRAME_AREA_DESCRIPTION,
TangoEnums.TangoCoordinateFrameType.TANGO_COORDINATE_FRAME_START_OF_SERVICE) + "</size>");
GUI.Label( new Rect(Common.UI_LABEL_START_X,
Common.UI_LABEL_START_Y + Common.UI_LABEL_OFFSET * 6,
Common.UI_LABEL_SIZE_X ,
Common.UI_LABEL_SIZE_Y), "RELOCALIZED2: <size=15>" + String.Format(Common.UX_STATUS,
m_status[2],
m_frameCount[2],
m_frameDeltaTime[2],
m_tangoPosition[2],
m_tangoRotation[2]) + "</size>");
Has anybody faced this before and solved it? Does anybody know if this is a known issue?
Cristhopper
Upvotes: 1
Views: 1143
Reputation: 99
I don't know if this is helpful, but I might know what's going on only in that I experienced the same thing when porting the samples to C#. I haven't use the Unity SDK.
If there is a similar TangoUtilities project or function that supports rendering of the AD, and you are referencing that or have implemented something similar, there is code in the OnPoseAvailable implementation that references the renderer's trajectory:
e.g.
// Update the trajectory, model matrix, and view matrix, then
// render the scene again
if (updateRenderer && (mRenderer.Trajectory != null))
in my version above, I added the && (mRendered.Trajectory != null) because the first few passes, it is still null.
If I recall, this was causing a silent failure, and ceased to allow rendering of any of it.
I thought it was worth sharing, and hope it might be your solution.
Upvotes: 1