USB Button Solution

Home Forums AR Sandbox Forum USB Button Solution

This topic contains 92 replies, has 22 voices, and was last updated by  wihome 3 months ago.

Viewing 15 posts - 76 through 90 (of 93 total)
  • Author
    Posts
  • #117972

    ajy00
    Participant

    Joshua

    On a quick scan I can’t see anything that jumps out … can you share the output from running with -Vruiverbose (as Chris described in earlier post … ~/src/SARndbox-2.5$ ./bin/SARndbox -uhm -fpv -Vruiverbose)
    so that we can perhaps see if there’s anything reported there.
    It might also be useful if you posted your “strange readouts in terminal”.

    As to linking buttons – once implemented they will effectively appear as ‘keys’ to be assigned when pressed, and you will see the Tool Selection menu – use ‘Utility/Script Executor’. Image shared here https://drive.google.com/file/d/1O9EXaHaoqSs3Tjap-xMZQ0RMBYJir9l_/view?usp=sharing

    A

    #117976

    Joshua.waymire
    Participant

    I have attached the Vruiverbose readout. Not exactly sure what is on the readout but maybe on of you can see what I am doing wrong. I have linked the file for you to review.
    VruiVerbose readout through terminal.
    https://drive.google.com/file/d/1U__TQyQzuN1-wCg4JB4s-A_BeX_FUuHX/view?usp=sharing

    I dont see a script executor in my utility submenu.
    https://drive.google.com/file/d/1U__TQyQzuN1-wCg4JB4s-A_BeX_FUuHX/view?usp=sharing

    #117980

    ajy00
    Participant

    Joshua

    Well it looks like the system is running though as expected. The only thing puzzling me is the vruiverbose output is referencing two windows defined in config, whilst the SARndbox.cfg file you have ( and there seem to be a few copies in your Google Drive files) references a single window. I guess the question is are you sure that the SARndbox.cfg file is the one from your /home/warren/.config/Vrui-4.5/Applications/SARndbox.cfg location?

    On the Script Executor .. not sure if you meant to attach an image … What happens when you pres an unassigned key? what menu are you offered?
    A

    #117982

    Joshua.waymire
    Participant

    I apologize but I needed to revise this post:

    I have attached the Vruiverbose readout. Not exactly sure what is on the readout but maybe on of you can see what I am doing wrong. I have linked the file for you to review.
    VruiVerbose readout through terminal.
    https://drive.google.com/file/d/1U__TQyQzuN1-wCg4JB4s-A_BeX_FUuHX/view?usp=sharing

    I dont see a script executor in my utility submenu.
    https://drive.google.com/file/d/18znpph82kLwwPd5sbMEukzFmqLddUIwa/view?usp=sharing

    #118011

    Joshua.waymire
    Participant

    Ok guys and girls,

    I have went over and over my code and still cannot find why my USB encoder is not working. Is there any kind soul that will review my code and see where Im going wrong? Thank you so much in advance. The kids are getting anxious and there may be a mutany if I dont get it running right soon. 😉

    Thanks,
    Josh

    #118012

    tuchwando
    Participant

    Hi Josh, since you don’t have the “Script Executor” option in a menu when pushing the button, you probably have an older VRUI installed.

    Assuming you have Linux and the display driver correctly installed, start fresh from Step 3 here: http://idav.ucdavis.edu/~okreylos/ResDev/SARndbox/SoftwareInstallation.html

    This will install Vrui 4.5, which has the script executor built in (old versions of Vrui didn’t have this yet).

    Patrick

    edit – i see you do have 4.5

    One small thing – your button numbers should probably start at Button0
    A second thing – the file ~/src/SARndbox-2.5/etc/SARndbox.cfg should not be the same as ~/.config/Vrui-4.5/Applications/SARndbox.cfg ; it is a place you can put options like this:

    
    # Configuration file for SARndbox application
    # Copyright (c) 2016 Oliver Kreylos
    
    section SARndbox
    	section Camera
    		# Configuration parameters for Kinect v1
    		compressDepthFrames true
    		smoothDepthFrames false
    	endsection
    
    	waterTableSize (400,300)
    	waterSpeed 1.0
    	waterMaxSteps 30
    	rainStrength 0.25
    	evaporationRate 0.0
    
    	elevationRange (-40,25)
    	rainElevationRange (25,100)
    	
    endsection
    
    • This reply was modified 6 months, 1 week ago by  tuchwando.
    • This reply was modified 6 months, 1 week ago by  tuchwando.
    #118015

    tuchwando
    Participant

    Also, a few more troubleshooting things to try:

    1) Script Executor. The computer freezing when trying to run a script in my experience has been due to the path of the script not being correct – it tries to run a script that isn’t there, and the machine locks up.
    – Test the script executor manually: With the program running, navigate a terminal to the ~/src/SARndbox-2.5/ folder (press F11 to exit fullscreen if needed) and type ./ToggleWeather.sh – This will run the script manually. Similarly you could try running a specific script in your ~/src/SARndbox-2.5/scripts/ folder
    – It’s a little strange that you don’t get the script executor as an option in the menu.

    2) USB encoder. One way to test whether the USB encoder is working is to see if you can assign a function (eg. global water etc) while the program is running, by simply pressing the buttons. First you need to comment out the button assignments in ~/.config/Vrui-4.5/Applications/SARndbox.cfg like so:

    section Vrui
        section Desktop
            #Disable the Screen Saver
            inhibitScreenSaver true
    
            inputDeviceAdapterNames += (HIDAdapter)
            
            section HIDAdapter
                inputDeviceAdapterType HID
                inputDeviceNames (USBEncoder)
    
                section USBEncoder
                    name USBEncoder
                    deviceVendorProductId 0079:0006
                    trackingDeviceName Mouse
                endsection
            endsection
    
            section MouseAdapter
                mouseIdleTimeout 5.0
            endsection
    
            section Window
                windowFullscreen true
            endsection
    
            section Tools
                toolClassNames += (ScriptExecutorTool)
    
               # section DefaultTools
               #     section WaterTool
               #         toolClass GlobalWaterTool
               #         bindings ((USBEncoder, Button0, Button1))
               #     endsection
    
    	   #     section ChangeWeather
    	   #          toolClass ScriptExecutorTool
    	   #          bindings ((USBEncoder, Button2))
    	   #          executablePathName ~/src/SARndbox-2.5/ToggleWeather.sh
    	   #          arguments ()
               #     endsection
               #  endsection
            endsection
        endsection
    endsection        
    

    If when you press a button you get a menu, the USBEncoder is working.

    • This reply was modified 6 months, 1 week ago by  tuchwando.
    #118029

    ajy00
    Participant

    Agree the steps from tuchwando … though might I suggest that because ScroptExecutor isn’t there, it really would be a plan to re-install Vrui – if not bite the bullet and start afresh with a new clean version of the build

    #118093

    Joshua.waymire
    Participant

    Big thanks to all of you that have helped to get the sandbox at my school up and operational. Has been a great learning tool so far and cant wait to expand on it later. I am having one small issue. I cannot get the savedinputgraph to load on the start sandbox shell script. I have linked the files below:
    https://drive.google.com/drive/folders/1r0p-VtMULvHpUEISjO41cRVzYmp9WLID?usp=sharing

    #118094

    ajy00
    Participant

    Joshua

    Can you load the input graph manually? (from right click menu: Vrui System/Devices/Load InputGraph). If that works then I’d guess it must be a directory path issue.

    AJY

    #118274

    Joshua.waymire
    Participant

    I finally got it all working. Thank you to all those who helped out and took the time to review my code and big shout out to @ajy00 and @ ChrisVeale for all the help.

    Future possibilities:
    Screenshot feature.
    Displaying a topographic map alongside their live view of the sandbox.

    #118275

    ajy00
    Participant

    🙂 Well done sir…
    hope the kids appreciate your efforts!

    #118277

    Oliver Kreylos
    Keymaster

    What do you mean by “screenshot feature?”

    #118278

    ajy00
    Participant

    Oliver, I suspect Joshua picked up on part of the scripts shared with him a while back.

    Using SCROT as a minimalist screen capture tool (thanks @mkaszuba), we implemented an additional button – using ScriptExecutorTool – to allow a screen capture of the landscape in the box.
    We use this with the students, challenging them to recreate a landscape in the ARSandbox from looking at a paper topography map or an image on separate screen, then capture the image of their version to see how they compare. Basic understanding of contours etc, and a great team challenge!
    For older students it is also linked to locating and using map references.

    There are some outline topic notes here River Wey Trust resources (references UK Ordnance Survey mapping).

    Screen Capture script we use to capture an image with timed info is

    #capture-screen.sh
    #!bin/bash
    
    cd ~/[directory for screen captures]
    scrot 'SARndbox %Y-%m-%d %H-%M-%s.png' -u
    cd ~/src/SARndbox-2.5
    #118347

    dawsonll
    Participant

    My USB controller has died. It is not recognized by LSUB (nor are there lights on the controller anymore). I only had it working one day… 🙁 Are there trouble shooting measures I should take before trying to return it? I’m a novice, but learning so much as I set up my sandbox. Thanks!

Viewing 15 posts - 76 through 90 (of 93 total)

You must be logged in to reply to this topic.

Comments are closed.