HTC Vive Tracker in Unreal

Hi all,

I was trying to create a mixed reality setup in Unreal Engine 4 using the HTC Vive Tracker to track the real world camera. But I stumpled upon a problem, which I wasn’t able to solve by myself.

While using the “Get Tracked Device Location and Orientation” node within Unreal I’ve realized that the output of the coordinate system is Y-up (Pitch, Yaw, Roll) instead of Z-up (Roll, Pitch, Yaw - used by Unreal). Which I was able to confirm by printing the tracked device orientation.

Which led to the problem that when I was setting my virtual cameras orientation to the orientation of the tracker, that (depending on the method I’ve tried) always one or two axis were wrong/inverted. I’ve also tried both methods (just in case) for setting the world and relative orientation of the virtual camera to the trackers orientation.

Can you provide me with a method with which I’m able to convert the coordinate system in Blueprint or am I doing something completely wrong anyways? Or is it enough to reset the tracker after mounting it on the camera? (I wasn’t able to test this myself because I found out how to do that today)

And things I’ve already tried:

  • Break the vector → switch the axis → make new vector (always one axis was inverted)
  • Used “Invert Rotator” node on the inverted axis which resulted in flickering behavior
  • Break the vector → multiply the necessary axis by -1 → resulted in flickering behavior

Did you figure this out? I had exactly the same problem

Hi there,

so as it seems there is no way right now to reset the coordinate system of a tracker within Unreal. But I realized that when I mount the tracker to the camera the way it’s meant to be (HTC Logo facing forward, like the real camera, and the power LED facing up) then everything works perfectly fine.

The problem with that workaround is, that you need to be able to mount the tracker on your camera that way. So you need something like an L-shaped adapter to make us of the standard camera mount.

This solved the issue for me in that case, but it’s still a little inconvenience.

Hell Thoeme,
Could you please share the blueprint for the vive tracker tracking?

Try creating your Blueprint like this Motion Controller > an Empty Scene Component > SceneCapture2D, then rotate your Empty Scene Comp until you get the desired result. You’ll have to just keep doing 90 degree rotations until you pick the right one.

Hi there,

sure no problem.

Basically that’s all you need to do for starters. But be aware that this only works if you are able to mount the trackers as intended (HTC Logo facing forward, like the real camera, and the power LED facing up). Make sure that you have the correct Device ID for the tracker. You can toggle this also in run-time to check which one works. There is also a node to get all of them, which I can’t remember right now. Just look for Device ID and it should show up.

After this you would add the offsets (location & rotation) your Vive Tracker has, compared to the real camera.These offsets have to be set on the “virtual camera / render target” not on the tracker.

Hi everyone
I would like to track my dslr camera with the live htc controller but I don’t know how to proceed.
Some of you might share a basic scene to make it work
thank you

Using Combine Rotators works for me, you must plug the orientation in B.

Or this messy solution matched the in-game tracker to the real world rotation/location.
It uses the ‘get device world pose’ instead of ‘get tracked device’

Can you share a project file?

This worked for me running UE 4.25.3 Except I had to set the values of the CombineRotators node as: x = 0, y = 90, z = 180.