I'm facing the following problem while developing Tango app and not sure whether I'm on the right track or not.
What I'm trying to achieve:
I expect that I'll be able to use these parameters - (x,y), point cloud and Pose in the following algorithm and get a Pose, which is a Rajawali object that RajawaliRenderer knows how to render.
tango initialization is accoring to the following coordinate frame:
TANGO_WORLD_BASE_COORDINATE_FRAME = new TangoCoordinateFramePair(
TangoPoseData.COORDINATE_FRAME_AREA_DESCRIPTION,
TangoPoseData.COORDINATE_FRAME_DEVICE
);
Plan Fit using intersection point -
private void convertByIntersectionPoint(float x, float y,
TangoPointCloudData tangoPointCloudData, TangoPoseData devicePose,
TangoPoseData colorTdepthPose) {
if (tangoPointCloudData != null) {
TangoSupport.IntersectionPointPlaneModelPair intersectionPointPlaneModelPair =
TangoSupport.fitPlaneModelNearPoint(tangoPointCloudData,
colorTdepthPose, x, y);
if (devicePose.statusCode == TangoPoseData.POSE_VALID) {
mRenderer.updateObjectPose(
intersectionPointPlaneModelPair.intersectionPoint,
intersectionPointPlaneModelPair.planeModel,
devicePose);
}
}
}
It throws TangoErrorException on TangoSupport.fitPlaneModelNearPoint.
To my understanding the fitPlaneModelNearPoint method should do pure algorithm that doesn't rely on current Tango session but I cannot be sure because I don't have its implementation.
Any help'd be much appreciated.
Okay it was totally my mistake.
There was a bug in serializing the point cloud. Gson library do not know how to deserialize into subclass and always construct into a parent class - which in this case creates corrupted data