Search code examples
unity-game-enginegoogle-project-tango

Asking PoseProvider for pose on Update vs responding to OnTangoPoseAvailable


Digging through the TangoARPoseController.cs in the Unity demo package for project Tango I noticed that while the other demo pose controllers all use the OnTangoPoseAvailable handler for pose updates, the AR example uses the PoseProvider.GetPoseAtTime meathod directly for pose data from the Update function.

Why?


Solution

  • A key point to achieve true AR view is the align the timestamps between pose and color image. The reason is that the system runs very fast, if we render an object (camera) based on the latest pose, it's highly possible that our color camera texture is out dated, and it's not associated with the latest pose already.

    To simplify the process, Tango API provides a very nice utility function to allow you get a pose based on Tango timestamp PoseProvider.GetPoseAtTime , please note that, all timestamp in Tango system is stamped by same clock.

    In the TangoARPoseController, the code uses the color camera frame's timestamp to query a pose associated with that time. Thus, it guarantee that the object pose (camera pose) and background color camera image is in sync.