Delcom button programs, example SARndbox.cfg

Home Forums AR Sandbox Forum Delcom button programs, example SARndbox.cfg

This topic contains 0 replies, has 1 voice, and was last updated by  peggyfenner 1 week, 6 days ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #103807

    peggyfenner
    Participant

    Hello all!

    I just successfully delivered a new Augmented Reality Table over to the Montgomery School in Chester Springs (I’m sure the science teacher there will register it soon). Since I had a few bumps along the way I wanted to share with you some of my configurations in the hopes it might help someone else.

    First off, if you are planning on implementing the Delcom buttons, DO NOT USE Linux Kernel 4.8.0-58-generic. There is a bug introduced somewhere between 4.4.0 and 4.8.0 where certain USB HID devices won’t attach to the Linux input subsystem – these buttons included. As soon as we downgraded the kernel to 4.4.0-93-generic the Delcom buttons worked well.

    I had a hardware issue where the blue button would bring up the main configuration menu no matter now many times we configured it to use the Button discovered by doing a “Save Input Graph” and looking at the output. I had another Delcom quad switch as I am building 2 of these tables (one for school and one for home) and as soon as I put the extra button switch in the blue button worked.

    We have the Delcom quad button installed:
    https://www.delcomproducts.com/productdetails.asp?PartNumber=706504-F

    The buttons do the following:
    1. Blue: Makes it rain
    2. Green: Dries everything up
    3. Orange: Toggles between normal, lava, snow, black and white (my 8 year old son called this “ice”)
    4. Red: Takes a screenshot and drops the file in a shared google doc. I set this up using the rclone tool:
    https://rclone.org/

    The keyboard keys still work with “1” making it rain and “2” drying it up.

    Here are some of my config files.
    peggy$ cat SARndbox.cfg
    section Vrui
    section Desktop
    section Window
    windowFullscreen true
    # Window endsection
    endsection

    section MouseAdapter
    mouseIdleTimeout 5.0
    # MouseAdapter endsection
    endsection

    section HIDAdapter
    inputDeviceAdapterType HID
    inputDeviceNames (ButtonBox)

    section ButtonBox
    name ButtonBox
    deviceVendorProductId 0fc5:b080
    # buttons:
    # Blue 166
    # Green 167
    # Orange 168
    # Red 169
    # ButtonBox endsection
    endsection

    # HIDAdapter endsection
    endsection

    inputDeviceAdapterNames (MouseAdapter, HIDAdapter)

    section Tools

    toolClassNames += (ScriptExecutorTool)

    section DefaultTools

    section KeyboardWaterTool
    toolClass GlobalWaterTool
    # The “Mouse” section sets keyboard numbers for water, drying
    bindings ((Mouse, 1, 2))
    # WaterTool endsection
    endsection

    section ButtonBoxWaterTool
    toolClass GlobalWaterTool
    # The “ButtonBox” section adds the Delcom settings
    # we want blue (166) and green (167).
    bindings ((ButtonBox, Button166, Button167))
    # WaterTool endsection
    endsection

    section KenFartsALot
    toolClass ScriptExecutorTool
    bindings ((ButtonBox, Button168))
    executablePathName /home/montgomery/OrangeButton.sh
    endsection

    # Use the Script Executor tool to take the screenshot
    # since the builtin screenshot tool isn’t working
    section ButtonScripts
    toolClass ScriptExecutorTool
    bindings ((ButtonBox, Button169))
    executablePathName /home/montgomery/take-screenshot
    endsection

    # DefaultTools endsection
    endsection
    # Tools endsection
    endsection
    # Desktop endsection
    endsection

    # Vrui endsection
    endsection

    peggy$ cat take-screenshot
    #!/bin/sh
    cd /home/montgomery/Screenshots
    scrot ‘SARndbox-%Y%m%d-%H%M%S.png’

    peggy$ cat OrangeButton.sh
    #!/bin/sh
    #
    # We keep a file around that contains our current state.
    curstate=cat /tmp/orangeState
    #
    # Now, we cycle from current state -> new state.
    # The states are:
    # color -> lava -> snow -> b&w
    # (water) (color) (color) (water)
    #
    # If we can’t figure out what state we were in,
    # we go to lava.
    water=Water
    color=Color
    case X”$curstate” in
    Xlava)
    newstate=snow
    water=Snow
    ;;
    Xsnow)
    newstate=bw
    color=BW
    ;;
    Xbw)
    newstate=color
    ;;
    *)
    newstate=lava
    water=Lava
    ;;
    esac
    echo $newstate > /tmp/orangeState
    sardir=/home/peggy/src/SARndbox-2.3
    echo “colorMap $sardir/etc/SARndbox-2.3/Height${color}Map.cpt” > $sardir/fifodir/controlfifo
    shaderdir=$sardir/share/SARndbox-2.3/Shaders
    cp $shaderdir/SurfaceAddWaterColor-${water}.fs $shaderdir/SurfaceAddWaterColor.fs

    —-
    I hope this helps!
    Good luck and have fun!
    Peggy

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

Comments are closed.