View Single Post
  #3  
Old 04-10-2016, 05:02 PM
Vaquero Vaquero is offline
Member
 
Join Date: Nov 2015
Posts: 62
I've got a problem with the scaling of the incoming data. In the default vrpn.cfg the scale is set to 0.001. But that doesn't seem to be right as my virtual object doesn't correctly overlap with the real object that gets tracked. Depending on the scale the virtual object moves faster or slower and diverges from the real object's position the farther I go from the origin.
How do I get the correct scale factor?

Tomorrow I'll try with the phasespace plugin for vizard in parallel to the vrpn server in hopes of finding some kind of measurement, but any help is much appreciated.


If anyone else is looking for information, I will share what I found so far.
First, get the phasespace VRPN server from here: http://phasespace.com/vrpn/
Note that the versions in the X2E subfolder don't seem to support the stylus.
You need to configure the server, so after extracting the contents of the archive, open the contained vrpn.cfg. It's a long file, so search for "phasespace" and you'll find help on the settings. You may delete everything you don't need.

So your config may look like this:
Code:
vrpn_Tracker_PhaseSpace Tracker0
<owl>
# e.g., connect to Recap2's OWL Live Emulator on the same machine
# else type the IP adress of the server
device="localhost:1"
frequency=480
# slave mode on/off
slave=0
drop_frames=1
scale=0.001

# If slave = 1, any sensor declarations below will be ignored
# Make a rigid body for the calibration wand
# You may look into the wand.rb file for the coordinates of the LEDs relative to the local pivot
sensor=0 type=rigid_body tracker=0
sensor=1 type=point tracker=0 led=4 x=0 y=920 z=-7.615
sensor=2 type=point tracker=0 led=5 x=-7.615 y=795 z=0
sensor=3 type=point tracker=0 led=6 x=0  y=670 z=-7.615
sensor=4 type=point tracker=0 led=7 x=-7.615 y=545 z=0
sensor=5 type=point tracker=0 led=8 x=0 y=420 z=-7.615
sensor=6 type=point tracker=0 led=9 x=-7.615 y=295 z=0
sensor=7 type=point tracker=0 led=10 x=0 y=170 z=-7.615
sensor=8 type=point tracker=0 led=11 x=-7.615 y=45  z=0

# Stylus Point Tracker
sensor=9 type=stylus stylus_id=1  # map sensor 9 to stylus 1
For usage of the VRPN plugin in Vizard take a look at the help. To get the tracker of the wand from above config, you'd do
Code:
vrpn = viz.add('vrpn7.dle') 
wandTracker = vrpn.addTracker('Tracker0@localhost',0) # the 0 is the sensor id
If you often change your rigid body definitions, I find it easiest to connect as a slave and take the rigid body information from Recap2. For that, select the markers in Recap2 you want to form a rigid body and in the "Trackers" tab right click and choose "RigidBody Tracker (Selection)". It seems the VRPN server will first create a sensor for each LED, and after that create the sensor for the rigid body. So if you have 5 LEDs, of which one may not belong to a rigid body an 4 that form a rigid body, the sensor for the rigid body will have the ID 5 (IDs 0-4 are taken by the LEDs). So:
Code:
rigidTracker = vrpn.addTracker('Tracker0@localhost',5)
Reply With Quote