USB Button Solution

Home Forums AR Sandbox Forum USB Button Solution

This topic contains 83 replies, has 21 voices, and was last updated by  ajy00 4 days, 8 hours ago.

Viewing 15 posts - 46 through 60 (of 84 total)
  • Author
    Posts
  • #116265

    CassieF
    Participant

    After editing the patch configuration file, trying to run with the patch configuration file causes ‘Segmentation Fault’ to appear when I try to run the AR sandbox.

    Without the buttons added to the patch configuration file, the sandbox opens in fullscreen, etc. without any issues or known errors

    This is on 4.5 build,
    – Cassie

    #116320

    mahesakicak
    Participant

    Thanks for the tutorials Oliver they are truly useful for me to follow and solved the problem.

    #117758

    cschoon
    Participant

    Help with using USB Button to switch from rain to lava etc.. I have used posted code in this forum I keep getting errors when button pressed. Pop up box appears: “warning from ScriptExecutorTool – weather.sh returned with exit code 2.

    I have used /home/<name>/src/scripts/ as my folder. I have made the file executable

    Kind of stuck looking for any ideas?

    Just an update. I ran a check on the script and it says that the shebang #!bin/bash line needed to be line #1 so I switched that up and now when I press the button the pop up box appears but this time is says: weather.sh returned with exit code 127

    So what am I missing?

    Thank you

    • This reply was modified 1 month, 2 weeks ago by  cschoon.
    #117761

    cschoon
    Participant

    as another update. When I run the switch-to-lava.sh and run the AR sandbox, I press the button assigned lava will work. Same for snow, and then the same when I want rain to come back. So the .sh files are working. I must have something incorrect in the .cfg file or the weather file I am missing something.

    Hope that helps someone out.

    Thanks

    #117769

    cschoon
    Participant

    Question:
    Is the echo supposed to pop up a message in the AR Sandbox? Just checking as there is none on mine.

    Thanks

    • This reply was modified 1 month, 2 weeks ago by  cschoon.
    #117787

    ajy00
    Participant

    Hi

    Sounds like you might need to go over the locations of the code you’re using as it sounds like the scripts are getting confused or not finding the elements. Suggest you check the script(s) by assigning them to keys, and link them to the buttons once you’ve got everything straight… debugging is such fun!! ;(
    For the message scripted in weather.sh, that will appear if you run the sandbox using a separate terminal window to issue the start commands, and will appear in that terminal window. It won’t show across the projected landscape.

    #117798

    Joshua.waymire
    Participant

    Hey all,

    I need help BAD. I am a middle school science teacher in Forney, Tx. and I have setup a sandbox and it is working fine.
    However I am wanting to setup a system of buttons similar to the ones above with a drain/flood/cycle option. I tried setting up the code like Oliver said but when I put the code in I’m not sure what I did wrong but the sandbox would not start up at all. I deleted all the code for the buttons and works perfect.

    Im asking if anyone has the files I need to get this going for my students to please share. I am a newbie newbie linux user and Im lost at this point.

    #117799

    Joshua.waymire
    Participant

    Hey all,

    I need help BAD. I am a middle school science teacher in Forney, Tx. and I have setup a sandbox and it is working fine.
    However I am wanting to setup a system of buttons similar to the ones above with a drain/flood/cycle option. I tried setting up the code like Oliver said but when I put the code in I’m not sure what I did wrong but the sandbox would not start up at all. I deleted all the code for the buttons and works perfect.

    Im asking if anyone has the files I need to get this going for my students to please share. I am a newbie newbie linux user and Im lost at this point.

    #117802

    ajy00
    Participant

    Which buttons are you using? Did you get the correct identification for the config file at Oliver’s initial item at #102823?

    That complete file should look something like

    section Vrui
        section Desktop
            # Disable the screen saver:
            inhibitScreenSaver true
            
            section MouseAdapter
                # Hide the mouse cursor after 5 seconds of inactivity:
                mouseIdleTimeout 5.0
            endsection
    
            section Window
                # Open the window on a specific video output port:
                # the next line needs to be updated with the appropriate value for your display
                outputName HDMI-0
                
                # Force the application's window to full-screen mode:
                windowFullscreen true
            endsection
    
            inputDeviceAdapterNames += (HIDAdapter)
            ...
            section HIDAdapter
                inputDeviceAdapterType HID
                inputDeviceNames (USBEncoder)
                
                section USBEncoder
                    name USBEncoder
                    # the next line needs to be updated -if appropriate- for your USB encoder details
                    deviceVendorProductId 0079:0006
                    trackingDeviceName Mouse
                endsection
            endsection
            
            section Tools
                section DefaultTools
                    # Bind a global rain/dry tool to the "1" and "2" keys:
                    section WaterTool
                        toolClass GlobalWaterTool
                        bindings ((Mouse, 1, 2))
                    endsection
                endsection
    
                toolClassNames += (ScriptExecutorTool)
    
            endsection
        endsection
    endsection
    #117803

    ChrisVeale
    Participant

    Just remember also that the cost is case sensitive and quite prone to error.

    Check it all very carefully.

    If you need I can send you the modified files I have (thanks to mkaszuba and ajy00)

    Might also be worth running vrui in verbose mode as it spits out a whole lot of useful information that can assist tracking any issue down…

    #117805

    Joshua.waymire
    Participant

    I am using the same usb encoder and buttons that Oliver recommended. I also used the correct identification according to Olivers post. I have linked a picture of my setup. I will also try to copy my file and copy and paste onto the forum. At a minimum I would like to get the flood and drain button working. Thank you for all your help and all those who contribute to the forum.

    https://drive.google.com/file/d/1KHzFP46tBCKTkwcBEIH-QLsfmBQ8dRzR/view?usp=sharing

    #117817

    Joshua.waymire
    Participant

    Hey Chris,

    I have double checked my code and the case of all the code. I can’t find what Im doing wrong. if you wouldn’t mind could you either share a link to your modified files that I would or email them to me. Thank you in advance. joshuadwaymire@gmail.com

    #117841

    sbarringer
    Participant

    OK, so after one fairly responsible student used the buttons and a spray bottle (to help mold the sand) the buttons were jammed. So I redesigned the case to have a top. I also purchased a USB trackpad to be able to do local weather, manipulate the second screen map, and also re-start the AR software when it crashes (which it will do every once in a while when cycling through the different weather settings – thoughts?). Anyway, I designed a case to mount the trackpad and two USB buttons that work off the same setup as the other three. I may regret not putting a top on the trackpad though… Links below:

    Trackpad from Amazon

    Three button housing with sand shield on top

    Trackpad and two button housing

    #117918

    Joshua.waymire
    Participant

    Sooooo. Im not sure what Im doing wrong. I have added the files necessary and changed the paths in the .cfg files. Thank you for the files @chrisveale. It helped me out considerably for a newbie trying to get these buttons to work. This is the error I am getting :

    I can upload the .cfg files tomorrow after school and maybe someone can check them out and see where Im going wrong.

    @sbarringer – I downloaded the .stl file for your box and have printed it. (Thanks again, its awesome) You seem like you have a good understanding of the code behind the buttons. Any advice, suggestions on getting it working.

    I also have not been able to get the Script executor tool registered. I have the correct code but in terminal according to your instructions It gives me an error of “Cannot make” – no target

    #117921

    sbarringer
    Participant

    Ha – I’m glad it sounds that way! The coding part of the buttons is probably what I understand the least about this. I did one semester of programming in college 20 years ago so all I really did was follow those same instructions. I remember I had some silly problem once where nothing worked (not sure if it was the buttons) and it was from me leaving the brackets in the code []. I was supposed to insert something in place of the brackets and whatever word was inside of them but I thought that it would still be inside of the brackets. So that’s a good example of my grasp on writing the code for this. That being said I have managed to actually get all the parts running. Have you posted what your code looks like here? I haven’t seen it. Maybe if I see it I can help.

Viewing 15 posts - 46 through 60 (of 84 total)

You must be logged in to reply to this topic.

Comments are closed.