VRPN

VRPN

A project for integrating Antilatency tracking system with a VRPN system.
Follow the instructions below to learn how to access Antilatency hardware via the VRPN.
To learn more about the VRPN, please, read the official documentation.
You can use Antilatency devices with nDisplay by configuring VRPN inputs. Learn more here.

Project compilation

Clone the source code from GitHub into any directory via cmd by using the following command template, where t_ is tag version selection, [SDK version] is Antilatency SDK version, [VRPN version] is VRPN version: git clone --depth 1 --recurse-submodules -b t_antilatency-integration_[SDK version]_[VRPN version] https://github.com/antilatency/vrpn.git
For example, a command for Antilatency SDK 4.0.0 and VRPN v07.35 looks like this: git clone --depth 1 --recurse-submodules -b t_antilatency-integration_4.0.0_v07.35 https://github.com/antilatency/vrpn.git
Make a project directory inside the vrpn folder. Name it build, for instance. After that open the cmd window in this folder and run the cmake .. command.
Open the [project path]\VRPN.sln file in Visual Studio.
Build the vrpn_server project which is located in the Main Server tab. Before you build it, choose one of the build configurations: Debug or Release. To build a project, right-click on it and select the Build option. It will look as follows:

Start the server

Open the [project path]\server_src\ folder. Then, in the vrpn.cfg file, uncomment the following line (remove a # sign):
#vrpn_alt_tracker Device0 <-env [environment code]> [tag <-p [placement code]>] <more tags...> <options>
The -lp option does not work anymore, since libraries are already linked to the Antilatency SDK submodule.
Here you should specify tracker names (one or more) and the desired options. If the Environment code or Placement code options are not specified, the default settings from AntilatencyService will be used.
The Environment and Placement codes can be obtained from their links in AntilatencyService.
For example, a link to Environment might look like this:
http://www.antilatency.com/antilatencyservice/environment?data=AAVSaWdpZBcABnllbGxvdwQEBAABAQMBAQEDAAEAAD_W&name=DevKit
The data between data= and &name is the code for this Environment.
Learn more about working with links: Environments.
If you want to connect one socket and use default Environment and Placement, the line might look as follows:
vrpn_alt_tracker Device0
Then you need to connect a socket with an Alt and set its Tag property in AntilatencyService, corresponding to what you wrote in vrpn.cfg.
In the provided example, we specified the device's name as Device0, which means that the Tag property should be set to Device0.
Learn how to configure the Tag property: How to configure device custom properties.
Go to the [project path]\server_src\Debug\ or [project path]\server_src\Release\ folder, depending on your build configuration. Start a server via the command line, specifying the path to the vrpn.cfg file:
vrpn_server.exe -f ../vrpn.cfg

Test

Open the [project path]\VRPN.sln file in Visual Studio, if it is not open already.
Build the Debug or Release vrpn_print_devices project located in the Clients tab. To do this, right-click on the project name and select the Build option.
Now you need to run the vrpn_print_devices.exe file, which is located here:
[project path]\client_src\Debug(or Release)\
Make sure that the server is running and run the vrpn_print_devices.exe file from the command line, specifying the tracker tag and the server address using the following template:
vrpn_print_devices.exe -trackerstride 10 [TrackerTag]@localhost
In our example, the command will look as follows:
vrpn_print_devices.exe -trackerstride 10 Device0@localhost,
where -trackerstride is data output frequency; in this case, 1 out of 10 results will be displayed.
In the output you will see:
pos — the position data of the object;
quat — the quaternion data.