Positional tracking in Unity with Project Tango

378 views Asked by At

I'm using this script from Google's Tango Unity Examples repository to control the movement of the camera in a Unity3D scene. It's meant to use the Tango's position and orientation tracking to move the camera correspondingly within Unity.

However, in the example scene it comes from, as well as the scene I've created, it seems that rotation is the only thing being tracked. No matter how far I move around (the real world), the camera is static. Rotation info transfers well, with no latency. From the snippet below, it looks like the code is correct - whenever the tango pose is available, it transforms the Tango coordinate frame matrix to Unity's, and extracts the position to set it in Unity.

public void OnTangoPoseAvailable(Tango.TangoPoseData pose)
    {
    ...
            // Converting from Tango coordinate frame to Unity coodinate frame.
            Matrix4x4 uwTuc = m_uwTss * ssTd * m_dTuc;

            // Extract new local position
            transform.position = uwTuc.GetColumn(3);

            // Extract new local rotation
            transform.rotation = Quaternion.LookRotation(uwTuc.GetColumn(2), uwTuc.GetColumn(1));
        }
     ...

    }

I've also ruled out the possibility that it's a hardware issue, because positional tracking is working well when I run the Area Explorer and Cube Mover Tango demos.

Could this issue be a result of recent changes in Unity or the Tango API?

0

There are 0 answers