How to interact with VR glove using different programming methods

Main call flow

Regardless of the chosen programming language, the call flow will be as follows:

  1. Launch the Senso software (if not launched at startup).
  2. Initiate connection (can be controlled by third-party software or set to autoconnect).
  3. Receive and send JSON-formatted TCP or UDP packets.

The Senso GUI interface is a wizard tool designed to simplify the process of creating configuration files and visualizing data.

Using this tool isn’t mandatory, though it can be the fastest way to start.

Connector

This executable module is essential for both SteamVR and non-VR applications.

After the software installation process, this executable named Senso_DK3_connector.exe is launched and added to the autorun folder, so it can be launched automatically upon Windows startup.

The purpose of Senso_DK3_connector.exe is to provide access to RF USB dongles and to deliver tracking data.

When launched, it's shown in the system tray as a blue palm icon.

ins

By default, it starts with several parameters: C:\Senso_DK3\Senso_DK3_connector.exe /prc=127.0.0.1:53453 /prc=127.0.0.1:53454

By default, it accepts incoming TCP/UDP connections on the local address/port 127.0.0.1:53452, though this can be changed using keywords. This port is used primarily for scanning and raw data transfer.

The SteamVR driver, driver_senso.dll, also uses this application to interact with the VR glove.

Additional ports 127.0.0.1:53453 and 127.0.0.1:53454 are instances for third-party software usage.

How to use

To get a list of available gloves nearby, configure, and connect to them, there are two ways, depending on the user:

  1. Autoconnect with predefined values.
  2. Fully controlled connection.

Let's start with the easiest one, autoconnect.

Autoconnection method

also for SteamVR configuration, if it is installed

Launch the Senso GUI. It will launch Senso_DK3_connector.exe (if not launched earlier) and perform a scan.

Then, choose the preferred glove, press `Save and calibrate' and perform the procedure until full calibration.

VR gloves

Please note the information line highlighted in blue in the photo below.

VR gloves

This string is all you need to launch the software manually:

"Senso_DK3_processing.exe /ini=C:\Senso_DK3\config_data\configuration_AC_4D_16_E8_46_A9.ini"

Whenever you need to connect to the glove, just run it exactly as shown, and you'll have another console window with some basic information and connection debug data.

VR gloves

Immediately after this, you can connect to the TCP or UDP port and receive all the data you need. You can also send vibration commands.

To check if everything works as intended, you can launch telnet localhost 53450 or telnet localhost 53451 depending on the glove type (left or right).

When the glove is connected and running, you'll likely see a stream of JSON-formatted data like this:

{"src":"ac:4d:16:e8:46:a9","version":"3.1","name":"SensoDK3","glove":"lh","fullname":"SensoDK3","type":"raw_data","data":{"imu_0":[2,0.00000000,0.00110262,-0.00063160,0.00008398,-0.25996500,-0.88780500,9.75353652],"imu_1":[2,-2.41025470,-2.04380556,-0.67045531,-1,-1789.05313197,102.00000000,-868.00000000],"imu_2":[2,-1.00534389,-1.90823484,-13.24182684,-1,-324.00000000,53.00000000,2027.38016332],"imu_3":[1,-0.14290632,2.25457056,0.31876343,-1,-641.00000000,-357.00000000,1864.80381665],"imu_4":[2,-0.69300588,-0.72811609,-1.80241868,-1,-316.00000000,-488.00000000,1983.88140417],"imu_5":[1,0.29049898,-0.40648841,3.71720142,-1,72.00000000,-608.00000000,1895.26005613],"imu_6":[2,1.49120558,-3.25252258,8.06511755,-1,-313.00000000,214.00000000,1997.08152683],"imu_7":[2,1.61326412,-1.34645840,-0.18661699,-1,-325.00000000,-209.00000000,1969.08099767],"imu_8":[0,0.00000000,0.00000000,0.00000000,-1,0.00000000,0.00000000,0.00000000]}}
{"src":"ac:4d:16:e8:46:a9","version":"3.1","name":"SensoDK3","fullname":"SensoDK3","type":"position","data":{"type":"lh","ts":"13361748156571","palm":{"pos":[0.000,0.000,0.000],"spd":[0.000,0.000,0.000],"quat":[0.988134,-0.005059,-0.153314,-0.007751],"grv":[-0.260,-0.888,9.754],"lia":[0.013,0.045,-0.013],"delta":0.009900,"tilt":-0.007621},"gests":[0.30793,0.97657,0.20096,-0.36145,-0.28588,-0.20933,0.25797,-0.16608,0.01249,0.35713],"wrist":{"quat":[0.869849,0.486973,0.064211,-0.045786],"grv":[-8.775,0.500,-4.258],"lia":[-1.053,-0.125,-0.101],"delta":0.009900,"tilt":0.999695},"bones":{"bone_0":[0.988134,-0.153314,0.007751,0.005059],"bone_1":[0.89513,0.34480,-0.23341,0.15929],"bone_2":[0.98416,0.08190,-0.05739,-0.14638],"bone_3":[0.99391,-0.08266,0.06322,0.03614],"bone_4":[0.99966,-0.02262,-0.00507,0.01191],"bone_5":[0.98817,0.02491,-0.00382,-0.15130],"bone_6":[0.99909,0.01630,-0.02522,-0.03018],"bone_7":[0.99916,-0.03916,-0.01079,0.00609],"bone_8":[0.99971,0.01099,-0.00472,0.02088],"bone_9":[0.99350,0.03263,-0.00537,0.10896],"bone_10":[0.98798,-0.14926,0.02017,0.03471],"bone_11":[0.99853,0.03267,-0.00279,-0.04312],"bone_12":[0.99945,0.00351,0.02897,0.01570],"bone_13":[0.97595,-0.20068,0.08426,-0.01214],"bone_14":[0.99707,0.04339,-0.04010,-0.04861],"bone_15":[0.99880,-0.00073,0.04896,0.00165]},"fingers":[{"ang":[-0.092688,0.185752],"quat":[0.9060,0.3737,-0.0127,0.1982],"q":[0.906020,0.198216,0.373734,-0.012714],"bend":0.201,"quat2":[0.994945,-0.088808,-0.034900,-0.031300],"spd":-0.0012,"grv":[-1.594,-1.025,9.658],"lia":[-0.122,-0.198,0.006],"grv2":[-1.589,0.260,9.944],"lia2":[0.186,0.047,0.211]},{"ang":[-0.361529,0.013665],"quat":[0.982672,-0.180464,0.037918,0.018717],"spd":-0.0090,"grv":[-3.144,-1.751,9.147],"lia":[-0.033,0.001,0.012]},{"ang":[-0.285992,0.001425],"quat":[0.988458,-0.143046,0.049200,0.008234],"spd":-0.0039,"grv":[-1.550,-2.394,9.731],"lia":[-0.049,0.052,0.326]},{"ang":[-0.209471,0.016080],"quat":[0.994239,-0.104360,-0.022771,0.008931],"spd":-0.0157,"grv":[0.353,-2.982,9.296],"lia":[0.013,-0.054,-0.046]},{"ang":[0.257173,-0.042943],"quat":[0.971457,0.129491,-0.198648,-0.006456],"spd":-0.0615,"grv":[-1.535,1.050,9.796],"lia":[0.164,-0.068,0.289]}],"m1":[-172,213,77],"h_rssi":-49,"h_gain":15,"g_rssi":-46,"g_gain":15}}
{"src":"ac:4d:16:e8:46:a9","version":"3.1","name":"SensoDK3","glove":"lh","fullname":"SensoDK3","type":"raw_data","data":{"imu_0":[2,0.00000000,0.00110262,-0.00063160,0.00008398,-0.25996500,-0.88780500,9.75353652],"imu_1":[2,-2.41025470,-2.04380556,-0.67045531,-1,-1789.05313197,102.00000000,-868.00000000],"imu_2":[2,-1.00534389,-1.90823484,-13.24182684,-1,-324.00000000,53.00000000,2027.38016332],"imu_3":[1,-0.14290632,2.25457056,0.31876343,-1,-641.00000000,-357.00000000,1864.80381665],"imu_4":[2,-0.69300588,-0.72811609,-1.80241868,-1,-316.00000000,-488.00000000,1983.88140417],"imu_5":[1,0.29049898,-0.40648841,3.71720142,-1,72.00000000,-608.00000000,1895.26005613],"imu_6":[2,1.49120558,-3.25252258,8.06511755,-1,-313.00000000,214.00000000,1997.08152683],"imu_7":[2,1.61326412,-1.34645840,-0.18661699,-1,-325.00000000,-209.00000000,1969.08099767],"imu_8":[0,0.00000000,0.00000000,0.00000000,-1,0.00000000,0.00000000,0.00000000]}}
{"src":"ac:4d:16:e8:46:a9","version":"3.1","name":"SensoDK3","fullname":"SensoDK3","type":"position","data":{"type":"lh","ts":"13361748156571","palm":{"pos":[0.000,0.000,0.000],"spd":[0.000,0.000,0.000],"quat":[0.988134,-0.005059,-0.153314,-0.007751],"grv":[-0.260,-0.888,9.754],"lia":[0.013,0.045,-0.013],"delta":0.009900,"tilt":-0.007621},"gests":[0.30793,0.97657,0.20096,-0.36145,-0.28588,-0.20933,0.25797,-0.16608,0.01249,0.35713],"wrist":{"quat":[0.869849,0.486973,0.064211,-0.045786],"grv":[-8.775,0.500,-4.258],"lia":[-1.053,-0.125,-0.101],"delta":0.009900,"tilt":0.999695},"bones":{"bone_0":[0.988134,-0.153314,0.007751,0.005059],"bone_1":[0.89513,0.34480,-0.23341,0.15929],"bone_2":[0.98416,0.08190,-0.05739,-0.14638],"bone_3":[0.99391,-0.08266,0.06322,0.03614],"bone_4":[0.99966,-0.02262,-0.00507,0.01191],"bone_5":[0.98817,0.02491,-0.00382,-0.15130],"bone_6":[0.99909,0.01630,-0.02522,-0.03018],"bone_7":[0.99916,-0.03916,-0.01079,0.00609],"bone_8":[0.99971,0.01099,-0.00472,0.02088],"bone_9":[0.99350,0.03263,-0.00537,0.10896],"bone_10":[0.98798,-0.14926,0.02017,0.03471],"bone_11":[0.99853,0.03267,-0.00279,-0.04312],"bone_12":[0.99945,0.00351,0.02897,0.01570],"bone_13":[0.97595,-0.20068,0.08426,-0.01214],"bone_14":[0.99707,0.04339,-0.04010,-0.04861],"bone_15":[0.99880,-0.00073,0.04896,0.00165]},"fingers":[{"ang":[-0.092688,0.185752],"quat":[0.9060,0.3737,-0.0127,0.1982],"q":[0.906020,0.198216,0.373734,-0.012714],"bend":0.201,"quat2":[0.994945,-0.088808,-0.034900,-0.031300],"spd":-0.0012,"grv":[-1.594,-1.025,9.658],"lia":[-0.122,-0.198,0.006],"grv2":[-1.589,0.260,9.944],"lia2":[0.186,0.047,0.211]},{"ang":[-0.361529,0.013665],"quat":[0.982672,-0.180464,0.037918,0.018717],"spd":-0.0090,"grv":[-3.144,-1.751,9.147],"lia":[-0.033,0.001,0.012]},{"ang":[-0.285992,0.001425],"quat":[0.988458,-0.143046,0.049200,0.008234],"spd":-0.0039,"grv":[-1.550,-2.394,9.731],"lia":[-0.049,0.052,0.326]},{"ang":[-0.209471,0.016080],"quat":[0.994239,-0.104360,-0.022771,0.008931],"spd":-0.0157,"grv":[0.353,-2.982,9.296],"lia":[0.013,-0.054,-0.046]},{"ang":[0.257173,-0.042943],"quat":[0.971457,0.129491,-0.198648,-0.006456],"spd":-0.0615,"grv":[-1.535,1.050,9.796],"lia":[0.164,-0.068,0.289]}],"m1":[-172,213,77],"h_rssi":-49,"h_gain":15,"g_rssi":-46,"g_gain":15}}

So now, you can use any programming language to work with this information, decode it, and use it as you wish.

In order to activate the vibration, all you need to do is send a JSON packet that specifies the vibration motor name and the special effect. Here are examples for all fingers and the wrist:

{"type":"vibration","data":{"type":"thumb","code":"20"}}
{"type":"vibration","data":{"type":"index","code":"20 21 22"}}
{"type":"vibration","data":{"type":"middle","code":"20"}}
{"type":"vibration","data":{"type":"third","code":"20"}}
{"type":"vibration","data":{"type":"little","code":"20"}}
{"type":"vibration","data":{"type":"wrist","code":"20"}}

Instead of using names like 'thumb', 'index', etc., numeric values ranging from 0 to 6 can be used.

Codes represent vibration effects, which can be viewed in the Senso GUI.

VR gloves

In cases where several effects (up to 8, separated by space) are specified, they will be triggered as a sequence.

Manual connection method

This method is similar to the one described earlier, except that you can perform the scan, choose the appropriate glove, and manage everything manually from your software.

For this, all you need to do is connect to the ports 127.0.0.1:53453 or 127.0.0.1:53454 (make sure that Senso_DK3_connector.exe is launched).

Then, send 'scan' and other methods.

Methods include:

  • List of available adapters - {"type":"adapters"}
  • Scan for available gloves - {"type":"scan"}
  • Choose left or right glove - {"type":"configure","param":"left"} or {"type":"configure","param":"right"}
  • Choose glove by MAC address - {"type":"configure","param":"mac","value":"ac:4d:16:e8:46:a9"}
  • Connect to a glove - {"type":"connect"}
  • Disconnect - {"type":"disconnect"}

Example

Here is a PHP sample script with all the mentioned methods: glove_test.php