AR Sandbox post-installation setup

Home Forums AR Sandbox Forum AR Sandbox post-installation setup

This topic contains 5 replies, has 3 voices, and was last updated by  Oliver Kreylos 3 months, 1 week ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #102724

    Oliver Kreylos
    Moderator

    There are a few additional steps one might want to do after successfully installing and calibrating the AR Sandbox software that I left out of the full installation instructions for brevity. These are minor tweaks: ensuring that CalibrateProjector and SARndbox always run in full-screen mode, automatically binding calibration or water management tools to keys, and automatically hiding the mouse cursor if the mouse isn’t moved.

    These steps involve creating custom configuration files, which open up another host of possible fine-tuning options if one wants to go there. The following assumes an installation of Vrui-4.2-005 or newer, and SARndbox-2.3 or newer.

    As of version 4.2, Vrui supports per-application configuration files. These are stored in a directory ~/.config/Vrui-<version>/Applications, and given the same name as the application to which they apply, plus a .cfg extension. In the following, replace Vrui-4.2 with your actual Vrui version, and replace pluma with another text editor if you do not use the MATE desktop environment. For example, the Gnome text editor is called gedit.

    First, create a configuration file to force CalibrateProjector to start in full-screen mode, and bind the calibration tool to two buttons:

    mkdir ~/.config/Vrui-4.2
    cd ~/.config/Vrui-4.2
    mkdir Applications
    cd Applications
    pluma CalibrateProjector.cfg

    Into the new file, paste the following text exactly:

    section Vrui
        section Desktop
            section Window
                windowFullscreen true
            endsection
            
            section Tools
                section DefaultTools
                    section CalibrationTool
                        toolClass CaptureTool
                        bindings ((Mouse, 1, 2))
                    endsection
                endsection
            endsection
        endsection
    endsection

    and then save the file and exit from the text editor.

    If you now start CalibrateProjector, its window will cover the entire screen, with no title bars or panels remaining. If you press the “1” key, the program will capture a tie point, and if you press the “2” key, the program will re-capture the background, indicated by the screen turning red for two seconds.

    You can replace the “1” and “2” key names in the “bindings” tag with any other keys you like.

    Next, create a configuration file to set up the SARndbox itself. In the same terminal, run:
    pluma SARndbox.cfg

    Into the new file, paste the following text exactly:

    section Vrui
        section Desktop
            section MouseAdapter
                mouseIdleTimeout 5.0
            endsection
            
            section Window
                windowFullscreen true
            endsection
            
            section Tools
                section DefaultTools
                    section WaterTool
                        toolClass GlobalWaterTool
                        bindings ((Mouse, 1, 2))
                    endsection
                endsection
            endsection
        endsection
    endsection

    and then save the file and exit from the text editor.

    As in the first case, this will force SARndbox to start in full-screen mode, ensuring that the calibration created using CalibrateProjector exactly matches the one used in the actual AR Sandbox. In addition, the “mouseIdleTimeout 5.0” setting will hide the mouse cursor after five seconds of inactivity. To get the cursor back, simply move the mouse. Finally, the “WaterTool” section binds a tool to add or remove water from the AR Sandbox globally, by pressing “1” to rain, and “2” to drain. As above, set the binding to whatever keys you prefer.

    If you run the AR Sandbox from a laptop, or if your computer has a main display screen in addition to the projector, and you are using “extended desktop” mode where the two displays are logically placed next to each other, then the CalibrateProjector or SARndbox windows might show up on the wrong display. To automatically force them to the correct display, you can use Vrui-4.2’s output naming functionality.

    Open up the SARndbox.cfg configuration file with a text editor, and insert the following into the “Window” section:

    section Window
        ...
        outputName Foo
        ...
    endsection

    then save the file and exit from the text editor. Now run SARndbox with the -vruiVerbose command line option:

    cd ~/src/SARndbox-2.3
    ./bin/SARndbox -uhm -fpv -vruiVerbose

    This will print a lot of information to the console, including the names of all video outputs and monitors connected to your PC. Note the name that corresponds to your projector, and enter it in the configuration file in place of “Foo” above. Then apply the same change to the CalibrateProjector.cfg configuration file.

    • This topic was modified 4 months ago by  Oliver Kreylos. Reason: Added section about output names
    • This topic was modified 3 months, 2 weeks ago by  Oliver Kreylos. Reason: Added mkdir ~/.config/Vrui-4.2
    #102766

    Shot
    Participant

    That’s helpful information. Thanks. However, for our installation, I would like to bind the left mouse button to the rain tool and the right mouse button to the evaporate (dry) tool. I’m using Vrui 3.2 and Sandbox 1.6. Is that possible?

    -Steve

    #102785

    Oliver Kreylos
    Moderator

    You would have to replace bindings ((Mouse, 1, 2)) with bindings ((Mouse, Mouse1, Mouse3)), which are the names of the left and right mouse buttons (the middle button is Mouse2).

    However, the left and right mouse buttons are already used by other tools, and attempting to rebind them like this will be ignored, and cause a warning message on start-up.

    You can redirect those other bindings by inserting the following sections into the DefaultTools section in your patch configuration file:

    section MouseNavTool
      bindings ((Mouse, 1, z, LeftShift, MouseWheel))
    endsection
    
    section MenuTool
      bindings ((Mouse, 2))
    endsection

    That will re-bind the mouse navigation tool to use the 1 key instead of the left mouse button, and the main menu will pop up by pressing the 2 key instead of the right mouse button.

    #102816

    Shot
    Participant

    Thanks, Oliver! Sorry for the double post. I didn’t realize you had answered my question! (I keep forgetting to check the “Notify me…” box!)

    -Steve

    #102819

    williamHsu
    Participant

    hi~ Oliver~ helpful information. Thanks. now i have globaWatertool 1 , 2
    and if i want to add local rain function ( on the tool menu is named ” manage water Locally)
    i should use what’s toolClass name? (where can i find this? i didn’t see it in the vrui/tools )
    and should i just add the bold text ?? or i should copy all the section Tools ……endsection?

    section Vrui
    section Desktop
    section MouseAdapter
    mouseIdleTimeout 5.0
    endsection

    section Window
    windowFullscreen true
    endsection

    section Tools
    section DefaultTools
    section WaterTool
    toolClass GlobalWaterTool
    bindings ((Mouse, 1, 2))
    endsection

    section WaterTool
    toolClass xxxxWaterTool
    bindings ((Mouse, 3, 4))
    endsection

    endsection
    endsection
    endsection
    endsection

    thanks a lot : ))

    #102825

    Oliver Kreylos
    Moderator

    The tool class name is “LocalWaterTool”. In general, the easiest way to find out these things is to save the input graph from within a Vrui application. Input graph files have the same tool binding structure as configuration files. You can copy over desired tool sections verbatim.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

Comments are closed.