Jump to content
 
MariosBikos_HTC

Getting started with the HTC Vive Tracker (Pose + Input via Pogo pins) in Unreal Engine 4.24

Recommended Posts

The HTC VIVE Tracker allows you to not only track objects in VR (getting tracker pose in real-time)  but also use the POGO pins to simulate input buttons (Grip/Trigger/Trackpad/Menu) as if you were using a Vive controller.  In this post I am going to show you how to do both using Unreal Engine 4.24.

We will showcase 2 different scenarios:

  • Scenario 1: we will only use the position and orientation of the Vive Tracker in the engine, without adding any input command events for the Pogo Pins. In this case, 2 Vive controllers will handle the user input while the tracker’s pose will be updated in the engine according to the physical device.
  • Scenario 2: we will use the Vive Tracker for its pose and for input commands. At the moment there is a limitation with SteamVR Input so you can’t get input simultaneously from 2 Vive Controllers and a Vive Tracker. Therefore you will need to use 1 Vive Controller and a Vive Tracker or just a Vive Tracker depending on your application use case.

In both cases we will need a Vive Tracker. If you haven’t used a Vive Tracker with SteamVR before, you will need to pair the Vive Tracker with SteamVR so that it can be recognised as a tracking device in the SteamVR console.

  • To do that, go to Devices → Pair Controller and a window will pop up asking you to pair an HTC Vive Controller.

VWwt5dZd0CFiTeBS2ZMT_-if1i0KglGHXjZoUoKvhOgADT_mBA_SLN5lZDsMGZrsZ6SEamWKOckipoFUeZqi2EM86V2Wn9ZFOcTsazfBfE1zAuvUhZXGX2pkN-TnY1UVZ6hQ_WP5

MAXde-kLceOsW_7LR98BIZx6kxTJ8ec22-NL0bYXi9RdNsE5jkD8RegtVdbnn-mKmyZgdmd5JldSX2dDh3tQNOQU0p_uXKcmrqTDSlQ37QdWUgeD6pfAiwRZRp69mUotRUch9R0g


 

  • In this case, we want to pair a different type of device ( a tracker) so you need to click on the button “I want to pair a different type of Controller” and select the HTC Vive Tracker from the available options.

ZZsSRKAN57-G1BK5a5umGU1IOTgvNcJEsSqAJLdLR6Ul6wOaRqU9XjiPhTxFUn9HpS3fHVCl8nwuEy_DOwkXaQII8nsEjZICXCZIXIal7t-amZAeE-nMcBaDOHjaM90ct2Y8JI_N

 

 

  • After that press and hold the vive tracker System Button (where the Vive logo is) until the device is paired. You will be able to see the vive tracker on your vive console.

2czTrFzm1fEFK2j-cI6XDrSDjnpiT85yWA5HDQYo8uAwVGz2iXD-aEaTaPHscBOtlg14_WFyCx-OV35k3NfHiepSjPhZpiIufePskSBWPGjCy0RJcQvC0Ib1qro3xtB6I5MHPh-w

pdvf-dYCRXhVvo089oxPgHsMe6UjIjreQm8dtq3Czdtuvxe3hidCTwjRUVz9PGWtAm43aa2wnaw4OodQ9wQYu3mgw1v78m_kpxCiszVnbcSsLX70ewo8NtJQ4nLNKQQ5Abhrfj1h



Scenario 1 (POSE TRACKING ONLY)

So let’s start with our Unreal Engine Project for the 1st scenario. If you don't like to read instructions here is a video instead.

First of all, we will use a Blueprint Pawn named “VRPawn” and add 2 MotionController Components, one for each of the Vive Controllers.

For the Right Controller, we will set the Motion Source to “Right” and for the Left Controller to “Left”. We will also tick the box that automatically renders the device model for us in the application. We will also add a MotionController Component for the Vive Tracker. In this case, we need to set the Motion Source to “Special 1” as this is the motion source used for Vive Trackers.

bI7kDUFSTePw3y_zRnxaqYRMuV4vp2QyoZm_i5X2unWidDh0s5zCPDKMtYDcMrtpr0-NIfbzIh75pBuvDKBElLXxNzHTYZmNaXMWy-AMrbIKpPvJxWY03PXSH8yqe61p7yUE12-t

t877VgWifV8K4Z5wt0V0NjIWZg3FpKuf_-wmWEjrd7drKwm4MiTFau6Gh61coGWUJnNVlWipxY6RdLTRaBpAJEte1NQ9cN7Z2cxwGOfldhoDDBmeesuyeZsLH1BhtVRgKkJKQRpw

Y1yxdjW3XGWCmASWBqHg6e7FyDbWijlPKgE7_aP0ksSne4yGjIgnz1a8Pw5zVgOCsQqG3f64WPmW-jVvWfl6BwR8oIFfzY9Olt1Xof9RY6Dn7cApciaUNOM2ACZ8cPE9KnAt9HOo

 

If you try to play in VR Preview you your project, you will notice that the pose of the vive Tracker is not updated. That’s because SteamVR hasn’t set the pose of the Special1 Motion Source to be updated for the Vive Tracker properly yet. Here’s how to do this:

  • Right-Click on the Vive Tracker logo and select “Manage Vive Trackers”.

ZCRaEdg0MRXnzSdTE5hUGm6iciIWANcuAks_qpF7gPUl_Yaw-UJOeK0iADfF8JHpGlB_DmTEt2T40fETETVnX1a47lw6WyIEaEgtMLcn5M-A6THhHrJghxGJW_6mOKdZ37bxm1FB

  • The SteamVR Settings window will open and you need to click Manage Vive Trackers again.

-5jvy1Oa6_47klgrpp-eE4B7mMUZ59cQUdbwlyF5JRb2Fa14vlMG5uG10DoaS4JQ3I_k7TxLJ-zLozeBu5yeddR7foldeMhBOBsXe_S1s0VY_dRDT_zvvUR6IvhGQF8Ghi77U5dR

  • You will then be able to see the currently active tracker and pick a role for it. For scenario 1 we will use the option “Camera” since we only want to use the Vive Tracker for its pose.

WqA_QtByeTAfx6EcgWxJ4lb4n7bDMgcFwdrVUFiiSIKp4amDEJoxQtc-qiurxhLFowKmQGvO_Grk0mAU16bhnCIt-DB4lTwPVLfEawlRcdXZbqMC-JjWEQ5T-L9kPdGMuHJxmp08

 

  • So the Vive Tracker Role is now set to Camera and the Unreal Engine Project’s Motion Controller for our Tracker expects a Special1 Input Source. But how do we connect the 2? We need to open the SteamVR controller Bindings menu by clicking on Devices → Controller Settings and then selecting “Show Old Binding UI”. This window will allow us to define the input bindings for our UE4 project. Make sure that you have played the VR Preview at least one so that you can see the project in the available options as the menu will show you the most recently played applications.

XsJ8PB32PJrhN3jg-DUyU2Raqx7nwhjFzEL644wmQMkIwbxjTsuuHfsx6WPt4Gw6eZ-FPG-CT7siN2SSOUIbljXB3crWeY7RjhMZWqQy-qRBV0tWantSB-nMKgzvLf9kHSQGlZ3c

HqP1kIM7urX8uC_N_mmVZlKqwJ8zsbVioruNXJEzC3eO8EuWEHi6gE9qV-ai3bNY1Tt8vR4QMZojTp_WPeIF8pcLHgb2sefltcZ9-EmF9dqeCIL6c6kLipWwS5Kd3f07RfvKs0Yq

kELHygUFVnwmC_EdLJqZ0kNHJU3qgjjiGVDgBC34PR3E145Vua_XXE4iDVrgnNkXWl2dmOnsczBQ6R1KSNZxy1m3FoKVz3OzIJwNspebBJF8WPdQ7xCcCGvlk7pxQkWrcfwW_V7W

 

  • Now click on the Current Controller button(this is usually set to the Vive Controller by default) and you will see all the available options. Select the "Vive Tracker on Camera" to update the current controller. Now click the Edit button for the current Binding, or create a new Binding if you can't see that option.

xBj9gADLs6YEJXkftPFV8F9lrsiKzxC3W-5IRAAtIWae4Fnuf4XrD3kOlvJz6xqU0yhKHKOUFKhsc4RY4Re2GRjg4gOPYX949HIjzNVr21018-4JMkojMvQQl5hrg6Wdezak-Ao_

jOTP0DyyY3EUk6hrMi5cG7J9npoG4xh5pz7BB7rdbzuq5HjD9Fbh1ho0TaEf9mjPc0Xj32xeDfr0TuNSnY1KQhDw8YmAUErp7k1IXD5xCb5zquEOR1F9HVwE9uG0Xfwxh-JQAH9O

 

  • Next, click the "Edit Action Poses" button and a new popup window will appear. That's where you will need to assign the right hand raw pose to Special 1.

Pse8Pytvixa7ZW-iersA-DsJRiWlL3hvpWt3QaBXGpIoizcaKjOBQVB1KDF8rPm6t1IPzdWCLsGbC8QeFe3U2YJMkjEo7NJRpFMdIDKn3hMAWNsersABWI5j1PYO5lj-b6qhKSlS

UM99U8OTpuP7-12nBoVUvfE3bibHX0JxuTXEEbWerdS3JwsbUESRpDGTgcAPMC42uHgeicHbOHrw9ZlC9NF3pRt6bd_OUGNsVJJ_T9nQ2fQVwByEfZwgGpoHxjgjNHT3tOC9bHhh

KmFtoCoyw00iC_tbVa2eNKTvxr_tU1LDwWU4mQoyPgyGpyQizHOySl8viwq1TJn_7yVrdtoQiRvM2u278IZy_Ar0rhkskSTI0LuVluI3OYp_ryB-jXG4g2k254a7wBWHAG12v7OZ


That’s it! 

Close the window and play the VR Project in VR Preview again and you will notice that the Vive tracker pose is updated properly while running the application. You can now attach any component, e.g a static mesh and make it follow the vive tracker pose.

image.png.688d81d00223faa3400d0fd671d75ca2.png

 

SCENARIO 2 (POGO PINS INPUT)

in this scenario we will use 1 Vive controller (as the Right Controller of the user) and 1 Vive Tracker, but the Vive Tracker will also be able to send input to the UE4 Project via the Pogo pins. 

  • Using the same simple UE4 Project, create a new Input Action in Unreal Engine's Project Settings Input menu. This action event will be triggered every time a controller command is sent from the pogo pins and depending on the SteamVR bindings. In this case I named the action “TrackerAction” and added as key input the Vive Trigger, just to make sure that the Action will then be available in the SteamVR binding menu and so that it can be re-assigned to one of the vive tracker Pogo Pin. 

gbUCNwGSyFavvqke1HsBvW89SkIkYD5D8VpeVDqw97dVrd40QqKtfphJ4qqIlv4CMOhDXPrz2aXaqZy_1_vdKnZB7lX7LTbnFSOCIABaaIzMEYjpo8LhC4CWsvXWgmI-_wjgKY5B

aEZmrSX_zFjWYvnwGFhD1S28kbV_QSziRwIoaCHJqtXTzuS0jhfBzAZLrjTdcwvETaxzs_4f57d_oA86UEQe5yKu7uDNsSH-6F10Zn-tWkwK97JSfSXgrJWxBWSHxISCn80RI5FP

 

  • The only way to get input from the Vive Tracker's POGO pins in this scenario is to change the tracker role to “Held in hand” and select Left/Right depending on how we plan on using the Vive Tracker.

4yJnXFcp9JOanhvux03t_c96MYiP6W6y-wdppJ6fT_5DFUHBftwJ8nXC9RPTpcPomKTv9jaRjNxHDYpyKAQI-BobltUA0Ub3shOWSUMcXKU-0FSgHHOOttDH-2adHrF73Y-aXYzN

  • Now let’s go back to SteamVR Input Bindings UI and select the “Vive Tracker in Hand”. In this case you will need to "Create New Binding" for this type of controller input.

VF2pLYOwsQfLMMrHFSNeoC8ApjBad4-yEQXNZJ62bsTKHf0HASyRuFEO14dJBPu520t6H03jjoTEyTq__Pffp7T2BG5dXPW5E-xWyi2RgshT_5IkEYmU2QhWGaEW5H_nqyZ-Gm7N

wCiy9t7vA_9Z7EMi5w3sPyaE1MkGAcAimt89WVSuLPOdzoCFuWSSdVw25nz7dmvXcjnPfWn0kVTk_0NlmM1jqabeGjZDO72jpodZlRSO3nCeMhMe0Vs4QdX0LFAqh5kLMW1i8VVl

 

  • We can now bind the TrackerAction we created in the UE4 Project to one of the available key bindings (Power/Trigger/Grip/Menu/Thumb). Since the tracker role was set to Left Hand, you will need to pick from the left hand menu options. In this case, I added the TrackerAction as a Trigger input button.

R7Q-raDgEQasNR97StL8XIBuufkX6wgNcp5ms66e-xA_BBpq3UqKbg4jDA7lx7HDFZJVkYvdKICDNATzP8KolCQg1p-kN1_5t6FQKwPPE5Ql2DTlsMyQVIg7AtL9HxaLDyIy1Qhy

  • That's all! If you now use a cable to connect pins 2 + 4 together (Ground+Trigger button), the Trigger button key input command will be sent to SteamVR and SteamVR will trigger the BP Event we created earlier in our UE4 Project, printing "hello". 

image.thumb.png.6b89d67a9a65510eba5d1fc8c273be1a.png


 

Keep in mind that there is a limitation at the moment, since OpenVR won't allow you to use input from the POGO pins while 2x Vive controllers are already in use. Also, in Scenario 2, you need to make sure that SteamVR only has 1x controller(and not both controllers active) and 1x tracker activated and that the controller tracked is actually the Right Controller. To figure this out easily, you can try to turn on both controllers and the tracker and then turn off the controllers one by one until you can see 1x tracker and 1x controller being tracked at the same time by Unreal.

  • Like 1

Share this post


Link to post
Share on other sites

Is there a way to get some unique identifier (Tracker's SN or even Device ID) from the trigger pull? We have 6 trackers we want to use with Pogo pin connection simultaneously, would each one would need it's own Event call setup or could we do TriggerAction with all 6 and just check its ID?

 

EDIT: Also thank you for the detailed post!

@MariosBikos_HTC

Share this post


Link to post
Share on other sites

Please sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...