Immersive ParaView on PiCasso at JSC
Setting up VRPN
1. Get and configure vrpn
Clone the vrpn git repository:
If you use HID devices, initialize the local HIDAPI subdirectory (./submodules/hidapi) by
In case you dont use HID devices, edit the file vrpn_Configure.h and comment out the following:
//#define VRPN_USE_HID
If you use HID devices, you also have to install libusb-1.0 as root:
2. Build executables and static libraries with cmake
Create a build and a installation directory and call ccmake:
Inside ccmake, press 'c' and adjust the following parameters:
- CMAKE_INSTALL_PREFIX: point to your installation directory, e.g. /home/zilken/vrpn/git/vrpn/installation
Press 'c' again, then press 'g' and exit ccmake. Compile vrpn by
3. Build shared lib manually
Unfortunately the ccmake build of vrpn only generates a static 'libvrpn.a', whereas ParaView needs a shared 'libvrpn.so'. We have to create this lib by hand as follows:
- enter the directory 'quads' and edit the Makefile. Uncomment the line "HW_OS := pc_linux64" and execute 'make'.
- enter the vrpn source directory and edit the Makefile. Uncomment the line "HW_OS := pc_linux64" and execute 'make'.
- create the shared lib and copy it to the installation folder by:
4. Edit vrpn.cfg to enable DTrack tracker
Enter the installation directory and copy the default vrpn.cfg to the bin folder.
Now edit the vrpn.cfg file (the one in the bin folder). Find the vrpn_Tracker_DTrack section and add/uncomment the following line:
To test vrpn, it is also usefull to enable some 'dummy' devices. Uncomment the following lines in vrpn.cfg:
5. Test vrpn with dummy tracker device
Enter the installatoin/bin directory and start the tracker server:
Open another shell and check the output of e.g. the vrpn_Tracker_NULL device:
You should see the following output:
Tracker Tracker0@localhost, sensor 0: pos ( 0.00, 0.00, 0.00); quat ( 0.00, 0.00, 0.00, 1.00) Tracker Tracker0@localhost, sensor 0: vel ( 0.00, 0.00, 0.00); quatvel ( 0.00, 0.00, 0.00, 1.00), dt 1.00 Tracker Tracker0@localhost, sensor 0: acc ( 0.00, 0.00, 0.00); quatacc ( 0.00, 0.00, 0.00, 1.00), dt 1.00
6. Start and test DTrack ART tracker
First you have to switch on the tracking pc (mounted in the rack together with the two projectors). When the tracking pc is ready, one red LED lights up on both tracking-cameras. Then you have to start the DTrack controller software on zam069 (currently only installed in the home directory of user 'zilken').
In the GUI, menue Settings->Output, check that the tracking output is really send to this computer (zam069 has the local IP address 192.168.1.11). Then click on "Start" to start the tracking. Once the tracking is started, a second LED lights up on each camera. Now start the vrpn server:
Open another shell and check the output of the DTrack device:
You should see the following output for the two tracking devices:
Tracker DTrack@localhost, sensor 0: pos ( 0.10, 0.74, -0.42); quat ( 0.13, 0.08, -0.00, 0.99) Tracker DTrack@localhost, sensor 1: pos (-0.18, 0.72, -0.34); quat (-0.02, -0.45, -0.00, 0.89)
Sensor 0 is the head sensor and sensor 1 is the mouse sensor.
Setting up ParaView
1. Configuring ParaView
To enable immersive ParaView, two configuration files have to be provided.
- One .pvx configuration file (zam069.pvx), defining the display geometry for each ParaView render server (pvserver). For PiCasso at JSC it looks like this:
<?xml version="1.0" ?> <pvx> <Process Type="client" /> <Process Type="server"> <EyeSeparation Value="0.065"/> <Machine Name="zam069.zam.kfa-juelich.de" Environment="DISPLAY=:0" FullScreen="0" ShowBorders="1" Geometry="1400x1050+0+0" LowerLeft=" -0.6 -0.45 -1" LowerRight=" 0.6 -0.45 -1" UpperRight=" 0.6 0.45 -1" /> </Process> </pvx>
- One .pvvr file (dtrac.pvvr) is needed to describe the connectivity to the tracker via vrpn. For zam069 it looks like:
<VRPluginState> <VRConnectionManager> <VRPNConnection name="vrconn" address="DTrack@localhost"> <Tracker id="0" name="Head"/> <Tracker id="1" name="Wand"/> <TrackerTransform value=" 1 0 0 0 0 .966 -.259 -1.4 0 .259 .966 .2 0 0 0 1"/> </VRPNConnection> </VRConnectionManager> <VRInteractorStyles> <Style class="vtkVRTrackStyle" proxyName="RenderView1" proxy="2869" property="EyeTransformMatrix"> <Tracker role="Tracker" name="vrconn.Head"/> </Style> </VRInteractorStyles> </VRPluginState>
Note that the tilting of the PiCasso display by 15 degree is taken into account by the TrackerTransform matrix (cos(15)=0.966, sin(15)=0.259). Furthermore a translaton by (0.0, -1.4, 0.2) is necessary to shift the center of the tracking system to the center of the camera position, which is in the middle and one meter in front of the display.
2. Start immersive ParaView
First of all make sure that your LD_LIBRARY_PATH points to libvrpn.so. Also make sure that the two ParaView configuration files are places in the ParaView bin directory. Enter the ParaView bin directory and start the ParaView server first, e.g.
Then start the ParaView client. To enable stereo rendering, the client has to be started in a stereo render mode! As not all clients are able to open an OpenGL Quadbuffer window (necessary for CrystalEyes stereo mode), you can just use a simple mode like RedBlue.
In the GUI of the ParaView client first connect to the ParaView server (on localhost, port 11111). To test the setup, you may generate a dummy data set, e.g. Sources->Cylinder. Now adjust the stereo modes: in the properties-tab, set "Stereo Type=none" and "Server Stereo Type=Crystal Eyes".
Then load the VR-Plugin by Tools->Manage Plugins->VRPlugin. If libvrpn.so could be found by ParaView, the VR-panel shows up in the GUI. Press the "Restore VR State" button and load the file dtrac.pvvr. Start the tracking by pressing the start button.
When you visualize data in an immersive environment, it is very important to notice that the size (extents) of the data plays an important role! For the PiCasso, the extents should lie within the range of one (meter). In case the extent of your data is too large or too small, it can be adjusted using the scale functionality of the Transform filter.