You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+66-58Lines changed: 66 additions & 58 deletions
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,35 @@
1
-
# Websocket OpenVR Driver Tutorial
1
+
# Websocket OpenVR Driver
2
+
The aim of this repository is to give the end user a driver that hosts a local websocket server on their computer which they can connect to and spawn trackers in VR.
3
+
It also echoes back the position of all currently active VR devices, allowing you to use the driver to find the position of a HMD using local websockets.
2
4
3
-
This is an adaptation of the repository authored by terminal29, "Simple-OpenVR-Driver-Tutorial"
5
+
This is desirable as it allows simple applications (such as web based applications) to interface with SteamVR without the hassle of setting up their own driver.
4
6
5
-
The aim of this repository is to give the end user a driver that hosts a local websocket server on their computer which they can connect to and spawn trackers in VR using simple JSON.
7
+
Finally, the driver also has the ability to host a simple webserver, which serves the files in `/resources/webserver` on port 8088.
8
+
This can be accessed from: [http://localhost:8088](http://localhost:8088), which serves `/resources/webserver/index.html`.
6
9
7
-
This is desirable as it allows simple Python or JavaScript applications to interface with SteamVR and create trackers.
8
-
This means you can write simple Python code to, for example, emulate a hip tracker using neural networks and a webcam and easily add it to SteamVR.
10
+
This is built upon the work of [terminal29's](https://github.com/terminal29)["Simple-OpenVR-Driver-Tutorial"](https://github.com/terminal29/Simple-OpenVR-Driver-Tutorial), the license for which is found at the bottom of this document.
11
+
12
+
---
13
+
14
+
# Quick setup
15
+
A release file for this driver can be downloaded [here](https://github.com/John-Dean/OpenVR-Tracker-Websocket-Driver/releases/latest/download/driver.zip).
16
+
17
+
## Installation
18
+
Find your SteamVR driver directory, which should be at:
and copy the `websocket_trackers` directory into the SteamVR drivers directory.
21
+
22
+
---
9
23
10
24
# Websocket server
11
-
The websocket server can be connected to at:
25
+
The websocket server is hosted on port 8082, and can be connected to at:
12
26
`ws://127.0.0.1:8082`
13
27
14
-
And commands are sent using JSON in the format:
28
+
## Creating/updating trackers
29
+
Commands are sent using a JSON object in the format:
15
30
`{"id":"tracker_0","x":0,"y":1,"z":2}`
16
31
17
-
Where the following are valid keys:
32
+
Where the following are valid keys:
18
33
- id (String - Required)
19
34
- Unique name of the tracker, if no tracker exists with the id a new tracker is created. For all intents and purposes there is no limit on the number that can be spawned.
20
35
- x,y,z (Numeric - Optional - default 0)
@@ -23,21 +38,23 @@ Where the following are valid keys:
23
38
- Rotation in 3D space
24
39
- connected (Boolean - Optional - default true)
25
40
- Set to true/false to enable/disable the tracker
26
-
41
+
42
+
27
43
If a key is omitted the value will not be changed from the previous update.
28
44
29
-
Commands can be stacked in a JSON array as follows (there should be no limit on how many can be added):
45
+
## Updating multiple trackers in a single request
46
+
Commands can be stacked in a JSON array as follows (there should be no limit on how many can be added):
and copy the `example` directory from the project's build directory into the SteamVR drivers directory. Your folder structure should look something like this:
- Navigate to `C:\Users\<Username>\AppData\Local\openvr` and find the `openvrpaths.vrpath` file. Open this file with your text editor of choice, and under `"external_drivers"`, add another entry with the location of the `example` folder. For example mine looks like this after adding the entry:
Permission is hereby granted, free of charge, to any person obtaining a copy
94
+
of this software and associated documentation files (the "Software"), to deal
95
+
in the Software without restriction, including without limitation the rights
96
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
97
+
copies of the Software, and to permit persons to whom the Software is
98
+
furnished to do so, subject to the following conditions:
99
+
100
+
The above copyright notice and this permission notice shall be included in all
101
+
copies or substantial portions of the Software.
102
+
103
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
104
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
105
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
106
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
107
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
108
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
109
+
SOFTWARE.
102
110
103
-
## License
111
+
## Original license (for [terminal29's](https://github.com/terminal29)["Simple-OpenVR-Driver-Tutorial"](https://github.com/terminal29/Simple-OpenVR-Driver-Tutorial))
104
112
MIT License
105
113
106
-
Copyright (c) 2020 Jacob Hilton (Terminal29)
114
+
Copyright (c) 2020 Jacob Hilton [Terminal29](https://github.com/terminal29)
107
115
108
116
Permission is hereby granted, free of charge, to any person obtaining a copy
109
117
of this software and associated documentation files (the "Software"), to deal
0 commit comments