Thursday, April 28, 2011

Intersense IS-900 and Vizard

http://dipeshbhattarai.com/category/tracking/

Seemingly trivial case of adding button and analog channels to the Intersense 900 VRPN configuration has become a big problem. I used the following in the vrpn.cfg to configure the IS900:
vrpn_Tracker_InterSense tracker AUTO 115200 \
u /
Wand            button           1       -.99 0.0 0.0 1.0  -.99 0.0 0.0 1.0 /
Wand            analog           0       -.99 0.0 0.0 1.0  -.99 0.0 0.0 1.0
The vrpn server is able add both the channels with no problem. But when I access the data, it always returns 0.
Update:
It seems, we do not need to configure analog channel to access the joystick outputs. The button channel can be used to access the joysticks’ analog outputs. So, I removed the second line from the config file and used the following line in VR Juggler config file to configure the anlog vrpn server and it worked:
<analog_server>button@<vrpnhost></analog_server>


After struggling with IS-900, VRPN and VMD for almost a week, I am finally able to understand the interactions among these components.
The coordinate frame the IS-900 uses in itself is very odd. The X-axis goes from top to bottom, Y-axis from front to back and Z-axis from right to left. Converting that frame to a normal right-handed coordinated required setting up a proper rotation matrix. After setting up that matrix, I had to figure out how VMD uses the matrix to transform the coordinate frame. After going through pile of source code, I finally figured that out. Even then it didn’t work the way I wanted it to work. The problem was the format I was providing the matrix element. VMD expected the elements in column-major format and I was using row-major format.
After I fixed everything, I was able to select the molecules on standalone application mode. As soon I switched to clustered environment, there was problem. The cursor didn’t select anyting. I suspect it has something to do with how VR Juggler assigns the coordinates to views that different computers in cluster handle.