(Project Tango) Rotation and translation of point clouds with area learning

孤街浪徒 提交于 2019-12-02 10:45:14

The original post is a little bit out of date. Previously, we don't have getMatrixTransformAtTime(). So you have to use Tango.getPoseAtTime to query each of the transformation, and then chain them up using matrix.

But now, with getMatrixTransformAtTime, you can directly query area_description_T_depth, even in opengl frame. In order to transform a point cloud to the ADF frame in opengl, you can use following code (pseudo code):

TangoSupport.TangoMatrixTransformData transform =
  TangoSupport.getMatrixTransformAtTime(pointCloud.timestamp,
          TangoPoseData.COORDINATE_FRAME_START_OF_SERVICE,
          TangoPoseData.COORDINATE_FRAME_CAMERA_DEPTH,
          TangoSupport.TANGO_SUPPORT_ENGINE_OPENGL,
          TangoSupport.TANGO_SUPPORT_ENGINE_TANGO);

// Convert it into the matrix format you use in render.
// This is a pure data structure conversion, transform is
// in opengl world frame already.
Matrix4x4 model_matrix = ConvertMatrix(transform);

foreach (Point p in pointCloud) {
  p = model_matrix * p;
}

// Now p is in opengl world frame.

But note that, you have to have a valid area description frame to query the pose based on area description, that is after relocalized with an ADF or in learning mode.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!