Water Drain

Home Forums AR Sandbox Forum Water Drain

This topic contains 9 replies, has 4 voices, and was last updated by  peggyfenner 2 weeks ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #100659

    Graham Caswell
    Participant

    Hi there,
    We just installed an AR Sandbox at our site, the Museum of Natural History in Halifax, Nova Scotia. We are still kind of tweaking the set up, but have it functioning adequately in our galleries. The question I ahve is regarding the water graphic. I noticed in some of the videos of other installations (atleast I seem to recall seeing it) that one can set up a button at the sand box to “drain” the water. How would you go about this? Or is it possible to have the water dissipate over time automatically and could the rate of dissipation be adjusted? By the way, this software is amazing and people are already going crazy over it!
    Thanks!
    Graham Caswell

    #100660

    Oliver Kreylos
    Moderator

    The software contains a “water management” tool that can be bound to two keys or buttons. First, to account for a bug in the current software, click the left mouse button within the application window. Then press and hold the key/button you want to use to make it rain, and move the mouse (without clicking any mouse buttons) to select “Manage Water” from the tool selection menu that pops up. Once there, release the key/button you were holding. Afterwards, press and release the key/button you want to use to drain the sandbox.

    After this, press and hold either of these keys/buttons to add/remove water from the sandbox.

    See another post on this forum on how to make this tool binding permanent.

    You can also use a single or a pair of USB buttons that act like keyboard keys to add/remove water.

    Finally, there is a command line option to slowly remove water over time. It is -evr <evaporation rate>, where <evaporation rate> is the rate at which water disappears in cm of depth/s.

    #100665

    Graham Caswell
    Participant

    Thanks Oliver,
    I have the hot-keyed the keyboard to allow for manual draining and filling, but am having some difficulty getting the command for automatic draining to work.
    In the terminal, I enter the command as so, -evr<.25> or are the parenthesis required? Perhaps it can’t recognize fractions of centimeters?
    Thanks again,
    Graham

    #100666

    Graham Caswell
    Participant

    Also, thought I’d point out that I figured out that the parenthesis is not supposed to be included. I still haven’t had any success, though.

    #100668

    Oliver Kreylos
    Moderator

    My bad; the angle brackets <…> indicate a variable that needs to be replaced with a concrete value. There is another wrinkle that I forgot myself, and that’s that evaporation rate is actually water deposit rate, meaning that it should be negative to remove water.

    Try adding this to the command line:

    -evr -0.25

    and that should do the trick. There needs to be a space between -evr and -0.25.

    #100722

    rkeet
    Participant

    Does anyone have a specific suggestion for a usb button to obtain and more precise directions on how to code the button to work as a drain.

    Thanks

    #100723

    Oliver Kreylos
    Moderator

    There are many brands/makes of USB buttons, but they vary widely in their capabilities, and it’s usually not specified what exactly they do. That’s dangerous.

    In our AR Sandbox, we use a two-button switch, Delcom 706502-F, where the red button drains and the blue button deposits water.

    Delcom also has one-button switches, such as this one, but they are rather pricey. On the upside, they are robust and known to work.

    Delcom’s switches are programmable via a Windows-based utility available from their web site. They can be programmed as mouse buttons, keyboard keys, or joystick buttons. The ideal configuration for the AR Sandbox is one or two joystick buttons. Most cheap USB buttons only emulate keyboard keys, and usually in a dumb way that makes them unusable for the AR Sandbox.

    To use a USB switch that’s configured as joystick button(s), one has to create a patch configuration file that makes it available as an additional input device, and then bind a water management tool to the new device’s button(s) using Vrui’s standard tool binding interface. Alternatively, one can bind a water management tool automatically via the same patch configuration file. Here’s the file I use to bind our two-button box to the add water / remove water functions:

    section Vrui
      section Desktop
        inputDeviceAdapterNames (MouseAdapter, HIDAdapter)
    
        section HIDAdapter
          inputDeviceAdapterType HID
          inputDeviceNames (ButtonBox)
          
          section ButtonBox
            name ButtonBox
            deviceVendorProductId 0fc5:b080
          endsection
        endsection
        
        section Tools
          section DefaultTools
            section WaterTool
              toolClass GlobalWaterTool
              bindings ((ButtonBox, Button167, Button166))
            endsection
          endsection
        endsection
      endsection
    endsection
    

    The deviceVendorProductId setting would need to be adapted to the actual switch’s ID, and the actual button names (Button166 and Button167 in our case) might have to be changed.

    The name of this patch configuration file, say SandboxButtons.cfg, is then added to SARndbox’s command line as such:

    $ SARndbox [usual options] -mergeConfig SandboxButtons.cfg
    
    #103755

    peggyfenner
    Participant

    Hey there,

    My long reply has gone missing.

    I cannot get the buttons to work. I bought the Delcom quad switch. I programmed it on the Windows box. I can get the lights to go on and off but the device itself is not being recognized by the system as I keep getting the error message “Ignoring tool binding sectino Water Tool due to exception Unknown device ButtonBox.

    peggy@AugmentedRealityTable /etc/udev/rules.d $ uname -a
    Linux AugmentedRealityTable 4.8.0-58-generic #63~16.04.1-Ubuntu SMP Mon Jun 26 18:08:51 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

    peggy@AugmentedRealityTable /etc/udev/rules.d $ lsusb | grep Delcom
    Bus 001 Device 003: ID 0fc5:b080 Delcom Engineering

    peggy@AugmentedRealityTable ~/.config/Vrui-4.2/Applications $ pwd; cat SandboxButtons.cfg
    /home/peggy/.config/Vrui-4.2/Applications
    section Vrui
    section Desktop
    inputDeviceAdapterNames (MouseAdapter, HIDAdapter)

    section HIDAdapter
    inputDeviceAdapterType HID
    inputDeviceNames (ButtonBox)

    section ButtonBox
    name ButtonBox
    deviceVendorProductId 0fc5:b080
    endsection
    endsection

    section Tools
    section DefaultTools
    section WaterTool
    toolClass GlobalWaterTool
    bindings ((ButtonBox, Button1, Button2))
    endsection
    endsection
    endsection
    endsection
    endsection

    peggy@AugmentedRealityTable ~/.config/Vrui-4.2/Applications $ cat SARndbox.cfg
    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
    peggy@AugmentedRealityTable ~/.config/Vrui-4.2/Applications $

    Command running from the console:
    ./bin/SARndbox -uhm -fpv -rer 20 50 -mergeConfig /home/peggy/.config/Vrui-4.2/Applications/SandboxButtons.cfg -vruiVerbose

    It seems that udev isn’t bringing into the system as a HID device and I cannot figure out why.

    I made this file:
    peggy@AugmentedRealityTable /etc/udev/rules.d $ pwd; cat 70-Sandbox.rules
    /etc/udev/rules.d
    SUBSYSTEMS==”usb”, ATTRS{idVendor}==”0fc5″, ATTRS{idProduct}==”b080″, GROUP:=”users”

    I see it showing up in the syslog file:
    Oct 2 12:05:20 AugmentedRealityTable upowerd[1797]: (upowerd:1797): UPower-Linux-WARNING **: treating change event as add on /sys/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/0003:0FC5:B080.0001

    peggy@AugmentedRealityTable /var/log $ ls -l /sys/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/0003:0FC5:B080.0001
    total 0
    -r–r–r– 1 root root 4096 Oct 2 13:35 modalias
    drwxr-xr-x 2 root root 0 Oct 2 13:35 power
    -r–r–r– 1 root root 4096 Oct 2 13:35 report_descriptor
    lrwxrwxrwx 1 root root 0 Oct 2 12:46 subsystem -> ../../../../../../../bus/hid
    -rw-r–r– 1 root root 4096 Oct 2 12:46 uevent

    I watch it being read in by the udevadm command. The permissions seem ok. I can’t find any obvious documentation on how to maybe force the SUBSYSTEM to be hid.. My next step is to strace the processes to see if anything obvious comes up but any help would be greatly appreciated.

    I tried to run the program as root proper and I still get the Unknown Device error.

    Thanks so much,
    Peggy Fenner

    #103756

    peggyfenner
    Participant

    Sorry for the duplicate.. I don’t see a way to delete the 2nd entry.

    • This reply was modified 3 weeks ago by  peggyfenner.
    #103802

    peggyfenner
    Participant

    Hey there,

    Turns out that downgrading to the earlier version of the linux kernel fixed the problem. We went from 4.8.0-58-generic to 4.4.0-93-generic and then the Delcom buttons all showed up and worked.

    peggy@AugmentedRealityTable ~/.config/Vrui-4.2/Applications $ !! | grep Del
    ls -l /dev/input/by-id/ | grep Del
    lrwxrwxrwx 1 root root 9 Oct 9 17:53 usb-Delcom_Products_Inc._USB_FS_IO-event-mouse -> ../event3
    lrwxrwxrwx 1 root root 6 Oct 9 17:53 usb-Delcom_Products_Inc._USB_FS_IO-mouse -> ../js0

    Peggy

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

You must be logged in to reply to this topic.

Comments are closed.