The VRPNWrapper plugin consists of two main C# scripts which can be found in the Assets/Plugin directory of the Unity VRPNProject.
Each VRPNTracker script has several fields; apply tracking, sensor number and derivation, along with two transform references, Device To Unity and Sensor Offset. The apply tracking field should usually be set to “both” and indicates whether analog tracking data is applied to GameObject translation or orientation. VRPN analog trackers can have a sensor number and some trackers provide velocity and acceleration data. The derivation field is set to “none” by default and does not apply received data to the GameObject transform in “velocity” or “acceleration” modes. The Device To Unity transform is used to translate the reported VRPN data into the Unity coordinate system. Usually this is the unity transform, but can be used to offset or scale data coming in from the server. The Sensor Offset transform is used when the sensor device is offset from the actual desired tracking point.
The VRPNTrackerConfig.cs script is regenerated each time a new tracker name is added to the configuration file in the VRPNManager Config File field. The VRPNTrackerCalibrate.cs script can be added to each instance of the VRPNTracker.cs script game object. This script allows for the interactive adjustment of the VRPNTracker Sensor Offset field. It creates a GUI interface that allows position, orientation and camera field of view to be adjusted in realtime. The 8 key turns on the GUI and toggles through each VRPNTracker with and attached VRPNTrackerCalibrate script. Pressing the I,o,p and [ keys begins adjustment of field of view, orientation, XY axis translation or XZ axis translation respectively. Orientation and translation changes are made by switching the VRPNTracker into apply tracking mode of “none” and adjusting the Sensor Offset transform instead. Field of view adjustments are made via the mouse horizontal movement.