== Immersive !ParaView on !PiCasso at JSC [[PageOutline]]// === Setting up VRPN ==== 1. Get and configure vrpn Clone the vrpn git repository: {{{#!ShellExample git clone https://github.com/vrpn/vrpn.git cd vrpn }}} If you use HID devices, initialize the local HIDAPI subdirectory (./submodules/hidapi) by {{{#!ShellExample git submodule init git submodule update }}} 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: {{{#!ShellExample su yum install libusb yum install libusb-devel exit #logout root }}} ==== 2. Build executables and static libraries with cmake Create a build and a installation directory and call ccmake: {{{#!ShellExample mkdir build mkdir installation cd build 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 {{{#!ShellExample make make install }}} ==== 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: {{{#!ShellExample cd pc_linux64 gcc -shared -Wl -o libvrpn.so *.o cp libvrpn.so ../installation/lib }}} ==== 4. Edit vrpn.cfg to enable DTrack tracker Enter the installation directory and copy the default vrpn.cfg to the bin folder. {{{#!ShellExample cd installation cp etc/vrpn.cfg bin cd bin }}} Now edit the vrpn.cfg file (the one in the bin folder). Find the vrpn_Tracker_DTrack section and add/uncomment the following line: {{{#!ShellExample # at JSC PiCasso the udp port 5001 is used for tracking vrpn_Tracker_DTrack DTrack 5001 }}} To test vrpn, it is also usefull to enable some 'dummy' devices. Uncomment the following lines in vrpn.cfg: {{{#!ShellExample ... vrpn_Tracker_NULL Tracker0 2 2.0 ... vrpn_Button_Example Button0 2 2.0 ... }}} ==== 5. Test vrpn with dummy tracker device Enter the installatoin/bin directory and start the tracker server: {{{#!ShellExample cd installation/bin ./vrpn_server }}} Open another shell and check the output of e.g. the vrpn_Tracker_NULL device: {{{#!ShellExample cd installation/bin ./vrpn_print_devices Tracker0@localhost }}} 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'). {{{#!ShellExample cd ~zilken/DTrack2_v2.7.7 ./DTrack2.sh }}} 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: {{{#!ShellExample cd installation/bin ./vrpn_server }}} Open another shell and check the output of the DTrack device: {{{#!ShellExample cd installation/bin ./vrpn_print_devices DTrack@localhost }}} 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. 1. 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 }}} 2. One .pvvr file (dtrac.pvvr) is needed to describe the connectivity to the tracker via vrpn. For zam069 it looks like: {{{#!xml }}} 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. {{{#!ShellExample cd home/zilken/ParaView-5.0.1-Qt4-OpenGL2-MPI-Linux-64bit/bin ./pvserver zam069.pvx }}} 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. {{{#!ShellExample cd home/zilken/ParaView-5.0.1-Qt4-OpenGL2-MPI-Linux-64bit/bin ./paraview --stereo --stereo-type="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.