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

后端 未结 1 1376
盖世英雄少女心
盖世英雄少女心 2021-01-29 01:04

I have a java application that, when I press a button, records point clouds xyz coordinates together with the right pose.

What I want is to pick an object, record a poin

相关标签:
1条回答
  • 2021-01-29 01:20

    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.

    0 讨论(0)
提交回复
热议问题